unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.ping.de>
Cc: guile-user@gnu.org
Subject: Re: Found a bug in guile 1.6.0
Date: 27 Dec 2002 00:08:57 +0100	[thread overview]
Message-ID: <87bs38cr92.fsf@zagadka.ping.de> (raw)
In-Reply-To: <1040938196.4595.75.camel@localhost>

Roland Orre <orre@nada.kth.se> writes:

> I found a bug when a let clause only contains a macro.
> When the clause also contains a lambda clause it works.

I don't think this is a bug in Guile, but a bug in the way you are
using procedure->macro.

The best solution is not to use procedure->macro.  Use define-macro
(or defmacro) or define-syntax.

'procedure->macro' does not generate what you probably think it does.
It creates a "non-memoizing macro", which is expanded everytime it is
executed.  The second time thru, tho, 'x' contains the internal form
of the macro invocation, which is not something that 'car' etc know
how to access.

You could try

  (define-macro (push! stack obj)
    `(set! ,stack (cons ,obj ,stack)))

but note that 'stack' is evaluated twice, which matters when you use
non-trivial setters/getters.

(Just curious: where did you learn about procedure->macro?  we don't
want people to use it.)

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


  reply	other threads:[~2002-12-26 23:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-18 18:42 Continuations: possible newbie question Thien-Thi Nguyen
2002-12-26 21:30 ` Found a bug in guile 1.6.0 Roland Orre
2002-12-26 23:08   ` Marius Vollmer [this message]
     [not found] <200212262346.gBQNkaNc029823@smtp.nada.kth.se>
2002-12-26 23:50 ` Returned mail: see transcript for details Roland Orre
2002-12-27  0:02   ` Found a bug in guile 1.6.0 Roland Orre

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=87bs38cr92.fsf@zagadka.ping.de \
    --to=mvo@zagadka.ping.de \
    --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).