Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: 1999/04/30
Subject: Re: There has got to be a better way...
Duane Rettig <du...@franz.com> writes: It doesn't have to work this way, btw. You could arrange for there to > Kent is right; keywords offer great flexibility at definitely non-trivial > time cost, though not in consing. Keywords are stored in a table on > the stack, and an out-of-line primitive call is made to sort out the > argument specification and fill in the table. It is fairly fast, but > definitely not function-entry speed. be multiple entry points for a keyword call, relating to how they were called. Consider: (defun foo (&key x y) ...) could be compiled as: (defun foo (&rest args) ;hopefully rarely called, so ok to be slow with additional bookkeeping so that This... Compiles to... where you then made sure the appropriate positional stubs were It would be nice if there was a simple way to request this stuff of It's pretty similar to the way "number calling" used to work (for (Really far afield: The trick was in Maclisp that the general purpose > If you don't want to back all the way off to required arguments only, You mean thecompiler works by calling the function with the full > you can still use optionals. This takes some flexibility away, but > allows the options, and testing for the presence of optionals are > only an instruction or two for each optional. In fact, for n arguments > of which at least n-k are optionals, if the compiled code decides that > the kth argument is not present, it can go ahead and assign the default > values to the kth through nth arguments. complement of args and skipping (or minimizing) the optional code setup work? You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||