unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Ian Hulin <ian@hulin.org.uk>
Cc: "Ludovic Courtès" <ludo@gnu.org>, guile-user@gnu.org
Subject: Re: make-module question.
Date: Sun, 29 Aug 2010 12:05:50 -0700	[thread overview]
Message-ID: <m31v9h1box.fsf@unquote.localdomain> (raw)
In-Reply-To: <4C6C5225.1010806@hulin.org.uk> (Ian Hulin's message of "Wed, 18 Aug 2010 22:35:33 +0100")

Greets,

On Wed 18 Aug 2010 14:35, Ian Hulin <ian@hulin.org.uk> writes:

> On 18/08/10 15:03, Ludovic Courtès wrote:
>> Ian Hulin <ian@hulin.org.uk> writes:
>>> Also what are the args the REPL says you can supply to (make-module) ?.

> It looks like there are three optional parameters, and the code is
> trying to do a home-grown version of (ice-9 optargs) [...]

In git, the definition begins:

(define* (make-module #:optional (size 31) (uses '()) (binder #f))
  ...)

> As the lilypond C++ routine immediately adds stuff to the uses list it
> could be useful to call make-module with this parameter.
> However, how do you call the thing while getting it to accept that you
> don't want to pass it the first parameter and want to let it default the
> value, but the first positional one you are passing is actually the
> second actual one, as you don't have any list separators in Scheme like
> in C++, or Pascal or whatever. So Scheme cannot distinguish between
> (make-module ( my-obarray-size)) and (make-module ( my-uses-list))
> whereas a language with list-element separators could make this clear
> make-module ( my_obbaray_size, , );
> and make-module ( , my_uses_list ,  );

You use #:key instead of #:optional arguments. make-module needs to be
declared to have #:key arguments, though, which is not currently the
case.

Andy
-- 
http://wingolog.org/



  reply	other threads:[~2010-08-29 19:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10 19:25 make-module question Ian Hulin
2010-08-18 14:03 ` Ludovic Courtès
2010-08-18 21:35   ` Ian Hulin
2010-08-29 19:05     ` Andy Wingo [this message]
2010-09-04 21:10       ` Ian Hulin
2010-09-06 11:25         ` 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=m31v9h1box.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=guile-user@gnu.org \
    --cc=ian@hulin.org.uk \
    --cc=ludo@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).