From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Catonano Newsgroups: gmane.lisp.guile.user Subject: Re: macroexpand-1 Date: Tue, 29 May 2018 21:01:06 +0200 Message-ID: References: <87zi0iwlo0.fsf@netris.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1527620522 21882 195.159.176.226 (29 May 2018 19:02:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 29 May 2018 19:02:02 +0000 (UTC) Cc: Guile User To: Mark H Weaver Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue May 29 21:01:57 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNjsb-0005aa-OV for guile-user@m.gmane.org; Tue, 29 May 2018 21:01:57 +0200 Original-Received: from localhost ([::1]:34538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNjui-00084n-Pq for guile-user@m.gmane.org; Tue, 29 May 2018 15:04:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNjrr-0005Nn-QQ for guile-user@gnu.org; Tue, 29 May 2018 15:01:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNjrn-0002w7-Ik for guile-user@gnu.org; Tue, 29 May 2018 15:01:11 -0400 Original-Received: from mail-yw0-x22a.google.com ([2607:f8b0:4002:c05::22a]:36616) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNjrn-0002vc-Dh for guile-user@gnu.org; Tue, 29 May 2018 15:01:07 -0400 Original-Received: by mail-yw0-x22a.google.com with SMTP id v68-v6so5175567ywd.3 for ; Tue, 29 May 2018 12:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GrhsNOsDofTChXvll6s9Evm9b8PxAILDaT5RQnC86Uc=; b=rfRBvnF6p3tWAuR0zvDE6NoTUQ5DJBgDIOQtGjhxyP9aE1uqgeBmJzEP3tQEDEeV33 nt+ka7BCWVNFOe5IYHJQUiLH0Y0lds3P5nHWpPXwWbMFTQrxJJhngE/3OSGYgjy+JZPk XOJ1LGM7mOHxpIXHBoxQroUpAoEOPt6nHXnkXlSuAfkgFhvgNBBK02/FtqXqXnqOwLip FcLvGo3ZSwT499977xG14Ba2Hsy2tSKCthZxdGguRiB1+uiv8P27hEoaykSgKxupTQpZ efCxX/DsZE9wz5KDlfybcnGkbFuTmQSlJy27KvV8W9Vtp2javxKS0IptRkiBg1NElIDT 3W2w== 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=GrhsNOsDofTChXvll6s9Evm9b8PxAILDaT5RQnC86Uc=; b=pCw3wPpMW6ptc/zmyovUF3Eh5qX603vrrXinwbcWWTchrOteGrfk9HsF/7sRePHE2p fNa9y3ruXzZYgdMRaEimPyyRILMhgv7lTY9SmyI6nMh5FMofAk5t3jdm+X0RJkApuYiC 96Z2Uzm8V2XDj0P2nN4krpRaXSupK512Wtk7OXMShW+QeNwAd2LB5EFsMxXb6M5IHGya RKrx6siQPBG6bJPWei9vjqJsBEg1nnFP8oKyKFBwUekXHno4cJdNkBuE9lIF0iB36zN/ e41c3dLjC3PvbW3tomRlzNSuMvX5mdu7RQyAYdnoRKdsGpcfxvMPv9WwSNRhyDnzpjA0 77vA== X-Gm-Message-State: ALKqPwc7w+86bgtIzSf5jiSFbkvi6CC+BPnpRUMxOog/TqKd8yPV7OU1 mrEWYVehGmVLxVG5LBb4iCuZ45TcVgDJVaFJ3Gzg X-Google-Smtp-Source: ADUXVKKm5Lrz8QjWiYPUmJuKP3JBCXqj8VH3dwwzO71UUKAQuKfHTe4KMFV7WevSl3S61lLb9vR/cEe3hcBSfgbPKQY= X-Received: by 2002:a0d:f0c5:: with SMTP id z188-v6mr10192005ywe.368.1527620466490; Tue, 29 May 2018 12:01:06 -0700 (PDT) Original-Received: by 2002:a81:6dce:0:0:0:0:0 with HTTP; Tue, 29 May 2018 12:01:06 -0700 (PDT) In-Reply-To: <87zi0iwlo0.fsf@netris.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4002:c05::22a X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14590 Archived-At: Mark, 2018-05-29 17:01 GMT+02:00 Mark H Weaver : > Hi, > > Catonano writes: > > > in the NEWS file, I read: > > > > > > ... > > ** Removed function: `macroexpand-1' > > > > It is unclear how to implement `macroexpand-1' with syntax-case, though > > PLT Scheme does prove that it is possible. > > > > > > what's the problem with macroexpand-1 and syntax-case ? > > In Guile 1.x, 'macroexpand-1' performed a single macro expansion step at > the top-level form of an expression, using its old non-hygienic macro > expander. There are several problems with trying to provide such an > interface in a Hygienic macro expander, and especially in the > 'syntax-case' expander with its support for 'datum->syntax'. For one > thing, our modern macro expander doesn't even work with the plain > S-expressions which 'macroexpand-1' accepted and produced. It works > with "syntax objects", which effectively annotate every identifier with > extra information needed to determine which binding it references, and > also extra information needed to implement 'datum->syntax'. This in > turn requires detailed knowledge of the lexical environment in which > expansion is taking place, whereas 'macroexpand-1' provides no way for > the user to provide this information. > > Mark > I have been reading this document about the scheme higienic macros https://www.cs.indiana.edu/~dyb/pubs/bc-syntax-case.pdf I stopped reading it when I read that the implementation relies on a previously bootstrapped version of another macro expansion implementation. So I have a general overview of the issue But Racket has some facilities to step and debug macros, as you can see here https://docs.racket-lang.org/macro-debugger/index.html Aren' t Racket macros higienyc ? In this question I've been promptly suggested a quick solution to perform a single macro expansion step https://stackoverflow.com/questions/50073207/macro-expansion-in-guile-scheme/50515880#50515880