guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make-module question.


From: Andy Wingo
Subject: Re: make-module question.
Date: Sun, 29 Aug 2010 12:05:50 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Greets,

On Wed 18 Aug 2010 14:35, Ian Hulin <address@hidden> writes:

> On 18/08/10 15:03, Ludovic Courtès wrote:
>> Ian Hulin <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]