unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Wolfgang J Moeller <wjm@heenes.com>
Cc: Mark Harig <idirectscm@aim.com>, guile-devel@gnu.org
Subject: Re: enhancement requests ("load-ignoring-cached-go")
Date: Thu, 30 Jun 2011 13:38:41 +0200	[thread overview]
Message-ID: <87y60ja6rh.fsf@pobox.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1104211646520.3553@gwdw03.gwdg.de> (Wolfgang J. Moeller's message of "Thu, 21 Apr 2011 17:56:44 +0200 (CEST)")

Hi!

On Thu 21 Apr 2011 17:56, Wolfgang J Moeller <wjm@heenes.com> writes:

> btw., in R6RS and this latest "pre-R6RS" 'psyntax', the first argument
> to datum->syntax must be an identifier, not an arbitrary syntax
> form. Permitting the latter in the old 'psyntax' might have been a
> mistake ...  I've still got to read up some more, and think of a test.

Hum, this might indeed be a bug.  Thing is, the answer is not entirely
clear.  Check this commit log:

    commit 9846796b6abb6ecbce0d596db32daa7ac5921a2a
    Author: Andy Wingo <wingo@pobox.com>
    Date:   Sun Jun 6 13:00:59 2010 +0200

        fix module-hygiene corner case by relying more on syntax objects
        
        * module/ice-9/psyntax.scm (chi-macro): Instead of assuming that output
          of a macro should be scoped relative to the module that was current
          when the macro was defined, allow the module information associated
          with the syntax object itself to pass through unmolested. Fixes bug
          29860.
          (datum->syntax): Propagate the module of the identifier through to the
          new syntax object, so that datum->syntax preserves module hygiene in
          addition to lexical hygiene.
          (include, include-from-path): Refactor to plumb though the hygiene
          information from the filename instead of the `include', allowing
          hygiene from the original caller of include-from-path to propagate
          through.
        
        * module/ice-9/psyntax-pp.scm: Regenerated.
        
        * test-suite/tests/syncase.test ("macro-generating macro"): Add test for
          bug 29860.

There were two bugs fixed there, but I'm only interested in the latter,
affecting `include-from-path'.  The issue was that:

  (define-syntax include-from-path
    (syntax-rules ()
      ((_ relname) (include (search-path relname)))))

  ...

  (include-from-path "foo")

wasn't working, because the included forms were getting scoped relative
to the `include' in the macro, not the `include-from-path' in the
original invocation.  That's because `include' used the #'include
identifier for `datum->syntax' on the forms.  This change fixed it to
use the mark on "foo" instead -- a hack perhaps?  Perhaps `include'
should take a second argument, an identifier, to use in syntax->datum
calls.

Anyway, the hack did end up working though, and it would be prohibited
by a change to datum->syntax.  ISTR that Racket folk had a similar issue
about a year ago too.  Perhaps it makes more sense in their context, in
which (foo) implicitly donotes an instance of the `%app' abstraction.
Dunno!

I guess I'm going to let this sleeping dog lie around for a while.
When & if the time comes to fix it there will be some other code that
needs patching too.

Thanks for the note,

Andy
-- 
http://wingolog.org/



  reply	other threads:[~2011-06-30 11:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-17 11:50 enhancement requests Andy Wingo
2011-03-21  0:24 ` Wolfgang J Moeller
2011-03-21  8:23   ` Andy Wingo
2011-03-29  9:50   ` Andy Wingo
2011-03-29 14:40     ` Wolfgang J Moeller
2011-04-15  9:29   ` Andy Wingo
2011-04-18  9:53     ` Wolfgang J Moeller
2011-04-21  9:34       ` Andy Wingo
2011-04-21 10:21         ` enhancement requests ("load-ignoring-cached-go") Wolfgang J Moeller
2011-04-21 14:04           ` Andy Wingo
2011-04-21 15:56             ` Wolfgang J Moeller
2011-06-30 11:38               ` Andy Wingo [this message]
2011-04-23 19:17             ` Mark Harig
2011-03-29 10:18 ` enhancement requests Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y60ja6rh.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=idirectscm@aim.com \
    --cc=wjm@heenes.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).