[Prev][Next][Index][Thread]
Re: Is Dylan a functional language?
In article <slrn9s7a3v.jus.neelk@brick.cswv.com>, neelk@alum.mit.edu
wrote:
> What I really miss in Dylan is cheap keyword arguments as in Ocaml.
> Labeled arguments are pretty much always the right way to go, except
> that I don't trust the Dylan compiler to optimize them as well as in
> Caml.
Gwydion d2c does a good job of turning keyword arguments into cheap
positional arguments if:
- you don't use #all-keys
- the call is dispatched directly to a known function
If you call an unknown function, or go through a generic function
dispatch (one that isn't optimized away), then all sorts of expensive
things happen -- basically keyword arguments are then passed as a (heap
allocated) vector with even arguments being the keyword and odd
arguments being the value and then a wrapper function goes through and
checks all the keywords and marshalls them into posisional arguments for
the actual function.
-- Bruce
Follow-Ups:
References: