From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12526 invoked by alias); 2 Jan 2017 02:54:54 -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 11364 invoked by uid 89); 2 Jan 2017 02:51:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1374, H*Ad:U*kawa, 2017 X-HELO: mail-qk0-f179.google.com Received: from mail-qk0-f179.google.com (HELO mail-qk0-f179.google.com) (209.85.220.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Jan 2017 02:51:39 +0000 Received: by mail-qk0-f179.google.com with SMTP id t184so342094829qkd.0 for ; Sun, 01 Jan 2017 18:51:39 -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=YaVyqY9J5dDrnvidBUmVL8Z5xFF4TH2vf/JOUWfVhXk=; b=eU30i6is/y3gk9YYqEUg4iLY6iVK06tD2BaHRKX4ZFKZpJCI+yHq07qYofRWkEKkhz W2CYtLRLll12YcFpiNorKHdC8H9MIw4FqpPUZ7MyxlmPvFm5lKhbo9bhGIC+83zTUzpr ts4WG+JwhecYIzk5Ac5ekpD3MJqTUUmmbTPL9rGSqNXqNLZTXP5466lrLnOdGGriEhXp pF045/JStGkMcojOKrD1Be6Cw7QF/ZsoUfONezkztu5/giIF3hZZyeouyxo2taNxIIcA arHK/QMKB/agIvo98zRxuSxkxlrWeJYp+zC02+EG2wzKjb2yba3kzBmkpuQKNXz2J7uo /6Wg== X-Gm-Message-State: AIkVDXIroTllCAk7FS+zkE6NKDdSAaV+zd4y5mULAFNNHwk3cd3gPTZr0mwquRq8FSU7uJEJtfBE/tH8VYk7SQ== X-Received: by 10.55.23.78 with SMTP id i75mr52606855qkh.212.1483325498308; Sun, 01 Jan 2017 18:51:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.88.243 with HTTP; Sun, 1 Jan 2017 18:50:57 -0800 (PST) In-Reply-To: References: <5f2e6df0-498b-735d-65a5-33a0d7c68d9d@bothner.com> From: Duncan Mak Date: Mon, 02 Jan 2017 02:54: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/msg00004.txt.bz2 Oh sorry, I sent prematurely, define-d does work in Kawa 2.2. Thanks! On Sun, Jan 1, 2017 at 9:49 PM, Duncan Mak wrote: > 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. -- Duncan.