From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10455 invoked by alias); 2 Jan 2017 02:51:12 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 9718 invoked by uid 89); 2 Jan 2017 02:50:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*kawa, 2017 X-HELO: mail-qk0-f170.google.com Received: from mail-qk0-f170.google.com (HELO mail-qk0-f170.google.com) (209.85.220.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Jan 2017 02:49:55 +0000 Received: by mail-qk0-f170.google.com with SMTP id h201so202221025qke.1 for ; Sun, 01 Jan 2017 18:49:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CHYsES5N37dvDu0AaAxXTYS76+4/0bxUXISYvt3tiL0=; b=lo8YxUBV3+/HCRc4NQkLr3LXSYWgBR2ynS9Teut9/aU6se68m7Sy4LMDizh3cgLT46 Z5cf1T1XmapEkpZHF8pf9bI9837LoCdxRm0NvrPd9oB/r0w2SWG0FZkfY+h54fXNLvFD djBBhB0ZBQ4MFbTNY/O1KfiW0+xg9v89jwWOyUL6hahOyY3a/Wk1IcLviukvWFziBLmR VSNXtb0FAPGSuQgWFt9XuQXw7eCiEPGFqnlKfpgWAuyNdJxzDgN4B8R4kjBvZWQyKxdD DdxRG4CvtlYVjUo4G0aYnoeVPaq5/EsXiIMx4IRPXAEa4c4vZJ89pfWpeVH11tbD9zEQ QOYg== X-Gm-Message-State: AIkVDXIfAwZbFiEhyns+1tQ7ilML7Em1iZuodYbaOibyduyviwXxHiTlWue1ZywJ6Emvyy3y1Hae/azOjyaUdQ== X-Received: by 10.55.47.71 with SMTP id v68mr55638247qkh.319.1483325393580; Sun, 01 Jan 2017 18:49:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.88.243 with HTTP; Sun, 1 Jan 2017 18:49:13 -0800 (PST) In-Reply-To: <5f2e6df0-498b-735d-65a5-33a0d7c68d9d@bothner.com> References: <5f2e6df0-498b-735d-65a5-33a0d7c68d9d@bothner.com> From: Duncan Mak Date: Mon, 02 Jan 2017 02:51:00 -0000 Message-ID: Subject: Re: How to set procedure name in macros To: Per Bothner Cc: kawa mailing list Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2017-q1/txt/msg00003.txt.bz2 Hello Per, I'm running the Kawa 2.2 release jars and define-d didn't work for me. It still says 'foo'. Perhaps it's a fix that hasn't made it to a released build? Looking forward to Kawa 2.3 ;-) Duncan. On Sun, Jan 1, 2017 at 7:37 PM, Per Bothner wrote: > > > On 01/01/2017 02:59 PM, Duncan Mak wrote: >> >> Hello all, >> >> Happy new year! >> >> In my DEFINE-FOO macro and I noticed that I can't control the name of >> the lambda in the syntax expansion. > > > This works: > > (define-syntax define-d > (lambda (stx) > (syntax-case stx () > ((_ n) #`(define n (letrec ((foo (lambda () #f))) > (set-procedure-property! foo 'name 'n) > foo)))))) > > First, you needs to quite the property value. > Secondly, you should not use the same identifier for the syntax parameter > as the name" keyword. > > I'm not clear why the following doesn't work - I'm looking into it. > > (define-syntax define-c > (lambda (stx) > (syntax-case stx () > ((_ n) #`(define n (letrec ((foo (lambda () name: 'n > #f))) > foo)))))) > > -- > --Per Bothner > per@bothner.com http://per.bothner.com/ -- Duncan.