guile-devel
[Top][All Lists]
Advanced

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

Re: case-lambda integration


From: Ludovic Courtès
Subject: Re: case-lambda integration
Date: Thu, 22 Oct 2009 23:15:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hi!

Andy Wingo <address@hidden> writes:

> On Thu 22 Oct 2009 00:00, address@hidden (Ludovic Courtès) writes:

[...]

>> So the keyword alist is new meta-data stored alongside the procedure,
>> right?
>
> Yes. It is stored in the procedure's object table.
>
> The metadata itself does change on this branch. Before the metadata was
> a thunk returning (BINDINGS SOURCES . PROPERTIES); now the thunk returns
> (BINDINGS SOURCES ARITIES . PROPERTIES). Arities is an
> extents-delimited description of the procedure's arities, for debugging
> and printing purposes.

OK, thanks for explaining.

> One more thing in lambda* -- I have added a #:predicate option, so that
> this particular lambda case only matches if evaluating the predicate in
> the lexical context of the arguments returns a true value.
>
> This should allow:
>
>   (typecase-lambda
>     (((a <foo>) (b <bar>))
>      (specific-frob a b))
>     ((a b)
>      (general-frob a b)))
>
>   => (case-lambda*
>        ((a b #:predicate (and (eq? (class-of a) <foo>)
>                               (eq? (class-of b) <bar>)))
>         (specific-frob a b))
>        ((a b)
>         (general-frob a b)))
>
> Thus it allows effective-method implementation in Scheme and not
> using evaluator address@hidden hacks :-)))

Sounds cool, and indeed refined compared to the evaluator hacks.

I’m looking forward to seeing all this land in ‘master’!

>> So (ice-9 optargs) could very much be deprecated?  There may be subtle
>> corner cases needing attention, though.
>
> Sure that would be possible. For 1.8 -> 2.0 reasons we can just make
> optargs re-export lambda* from the base environment, and deprecate
> optargs in 2.2.

Yeah, excellent.

Ludo’.





reply via email to

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