[parenscript-devel] The implementation of keyword parameters

Daniel Gackle danielgackle at gmail.com
Thu Aug 9 20:24:58 UTC 2007


I like the addition of keyword params but using a json object to store the
key params at runtime adds some overhead that I'm wondering if we could
avoid. Could we make the compiler generate regular JS functions with ordered
signatures? For example:

  (ps (defun f(&key a b)))

would turn into:

  function f(a b) { }

and the compiler would take care of detecting function calls and generating
params in the right order. So:

  (ps (f :a 1 :b 2)) => f(1,2)

while

  (ps (f :b 1 :a 2)) => f(2, 1)

What do you guys think?

Daniel

p.s. This may sound like excessive optimization, but on our project
efficiency is critical and we do a ton of profiling. We have some functions
that are good candidates for &key signatures, but not if they get slower.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20070809/87fd8129/attachment.html>


More information about the parenscript-devel mailing list