unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
Cc: guile-devel@gnu.org
Subject: Re: let-keywords?
Date: Tue, 12 Dec 2006 10:35:17 +1100	[thread overview]
Message-ID: <8764cihuq2.fsf@zip.com.au> (raw)
In-Reply-To: <eljtva$h6a$1@sea.gmane.org> (Han-Wen Nienhuys's message of "Mon,  11 Dec 2006 16:37:25 +0100")

Han-Wen Nienhuys <hanwen@xs4all.nl> writes:
>
> I think that ice-9's let-keyword* macro is the thing that I've been
> looking for, but I haven't been able to work out how to use it. 

I think it goes like

	(let-keywords '(#:foo "hello" #:xyzzy "world") #t
	              ((foo  "default for foo")
	               (bar  "default for bar"))
	  foo => "hello"
	  bar => "default for bar"

"allow-other-keywords" is whether it's an error to have something
unknown like #:xyzzy in the args.

I think the "let-keywords*" variant allows the default for one
variable to use the value of a previous one.

	(let-keywords* '(#:foo 1 #:xyzzy 2) #t
	               ((foo  1)
	                (bar  (+ foo 2)))
	  foo => 1
	  bar => 3

Would those help for the manual, or can anyone think of more typical
or clearer samples?


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2006-12-11 23:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-11 15:37 let-keywords? Han-Wen Nienhuys
2006-12-11 23:35 ` Kevin Ryde [this message]
2006-12-11 23:57   ` let-keywords? Han-Wen Nienhuys
2006-12-13 21:28     ` let-keywords? Kevin Ryde
2006-12-14 11:20       ` let-keywords? Han-Wen Nienhuys

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=8764cihuq2.fsf@zip.com.au \
    --to=user42@zip.com.au \
    --cc=guile-devel@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).