unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: Stefan Israelsson Tampe <stefan.itampe@gmail.com>,
	guile-user@gnu.org,  guile-devel <guile-devel@gnu.org>
Subject: Re: and-let* is not composable?
Date: Tue, 10 Sep 2013 15:42:10 +0200	[thread overview]
Message-ID: <CAGua6m1wa3H8QhiSHj=gKrmk33p=V0oLeFP=MqfCUQbxt5pcjA@mail.gmail.com> (raw)
In-Reply-To: <87hadtof0z.fsf@Kagami.home>

[-- Attachment #1: Type: text/plain, Size: 3372 bytes --]

Ahh, I thought we nuked the unhygienic macros in our tool-chain, That is a
BUG!

Anyway can I suggest a Bug report where we
1) Make the unhygienic define-macros in the following files hygienic,
-------------------------------------------------
module/srfi/srfi-4.scm:
module/srfi/srfi-69.scm:
module/srfi/srfi-4/gnu.scm:
module/system/base/syntax.scm:
module/system/base/language.scm:
module/system/base/lalr.upstream.scm:
module/statprof.scm:
module/oop/goops.scm:
module/oop/goops/save.scm:
module/oop/goops/accessors.scm:
module/texinfo/plain-text.scm:
module/ice-9/i18n.scm:
module/ice-9/time.scm:
module/ice-9/serialize.scm:
module/ice-9/session.scm:
module/ice-9/optargs.scm:
module/scripts/snarf-check-and-output-texi.scm:
module/scripts/lint.scm:
module/sxml/ssax/input-parse.scm:
module/sxml/transform.scm:
module/sxml/upstream/SXPath-old.scm:
module/sxml/upstream/SSAX.scm:;
module/language/tree-il/primitives.scm:
module/language/ecmascript/base.scm:
module/language/assembly/disassemble.scm:
module/rnrs/bytevectors.scm:

And also change the defmacro forms in,
---------------------------------------------------------
module/system/base/lalr.scm:
module/texinfo/reflection.scm:
module/ice-9/and-let-star.scm:
module/ice-9/calling.scm:
module/ice-9/expect.scm:
module/ice-9/optargs.scm:
module/scripts/generate-autoload.scm:
module/scripts/generate-autoload.scm:

/Stefan




On Mon, Sep 9, 2013 at 11:34 PM, Ian Price <ianprice90@googlemail.com>wrote:

> Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:
>
> > (use-modules (srfi srfi-2))
> > (use-modules (srfi srfi-1))
> >
> > (define-curried (string-matches pattern string)
> >    (and-let* ((match-struct (string-match pattern string))
> >                  (count (match:count match-struct)))
> >       (map (lambda(n)(match:substring match-struct n))
> >          (iota (1- count) 1))))
> >
> > scheme@(guile-user)> (string-matches "([a-z])" "a")
> > $4 = ("a")
> >
> >
> > ,exp ((string-matches "([a-z])") "a")
> > $5 = ((lambda (string-871)
> >    (let ((match-struct-876
> >            (string-match "([a-z])" string)))
> >      (if match-struct-876
> >        (let ((count-880 (match:count match-struct-876)))
> >          (if count-880
> >            (map (lambda (n-883)
> >                   (match:substring match-struct-876 n-883))
> >                 (iota (#{1-}# count-880) 1))
> >            #f))
> >        #f)))
> >  "a")
> >
> > And we see that string is not managed correctly. Is this a bug? I
> > can't understand why this is not treated as intended!
>
> The problem is one that occurs when hygienic and non-hygienic macros are
> mixed. Here, and-let* is the non-hygienic one. Basically, in a hygienic
> macro, you carry around a bunch of context to allow you to refer to the
> right variable names. Then defmacro comes along, strips all that away,
> and uses the raw symbol names.
>
> We can fix and-let* to be hygienic, that's pretty easy, but I'm not sure
> what you can do about this in general. It's not like you can pass in the
> gensymed name, because that will break the way people who for some
> reason still right defmacros expect them to work.
>
> Dunno, maybe I'm just missing some insight here.
>
> --
> Ian Price -- shift-reset.com
>
> "Programming is like pinball. The reward for doing it well is
> the opportunity to do it again" - from "The Wizardy Compiled"
>

[-- Attachment #2: Type: text/html, Size: 4799 bytes --]

  reply	other threads:[~2013-09-10 13:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09 17:35 and-let* is not composable? Panicz Maciej Godek
2013-09-09 20:26 ` Stefan Israelsson Tampe
2013-09-09 21:34   ` Ian Price
2013-09-10 13:42     ` Stefan Israelsson Tampe [this message]
2013-09-10 13:51       ` Ian Price
2013-11-02  2:39     ` Ian Price
2013-11-02 19:01       ` Ian Price
2013-09-10 17:57 ` Ian Price
2013-09-11 12:25   ` Panicz Maciej Godek
2013-09-11 14:05     ` Ian Price
2013-09-13 18:40       ` Panicz Maciej Godek
2013-09-14  8:19         ` Stefan Israelsson Tampe
2013-10-04 22:27       ` Panicz Maciej Godek
2013-10-05  8:00         ` Ian Price

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='CAGua6m1wa3H8QhiSHj=gKrmk33p=V0oLeFP=MqfCUQbxt5pcjA@mail.gmail.com' \
    --to=stefan.itampe@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    /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).