Re: A cute reader hack



Pascal Costanza <pc@xxxxxxxxx> writes:

No, but you can pass the following instead:

(lambda (&rest args)
(declare (dynamic-extent args))
(copy-list args))

What do you want to use this for?

You seem to have suggested to declare as dynamic-extent the &rest
parameter which is passed down to another function, irrespective
of how the other function is written (if "idiom" is understood as
"any code matching this pattern").

I was just worried that this optimization requires the knowledge about
the other function. In particular it would be unsafe with the _func
reader syntax that this thread is about, because the function might
return its original parameter list as a part of its result.

--
__("< Marcin Kowalczyk
\__/ qrczak@xxxxxxxxxx
^^ http://qrnik.knm.org.pl/~qrczak/
.



Relevant Pages

  • Re: A cute reader hack
    ... (declare (dynamic-extent args)) ... You seem to have suggested to declare as dynamic-extent the &rest ... It is always unsafe to modify &rest arguments. ...
    (comp.lang.lisp)
  • Re: functions in a list
    ... (defun + (&rest args) ... (declare (dynamic-extent args)) ...
    (comp.lang.lisp)
  • Re: function aliasing
    ... (declare (dynamic-extent args)) ... (define-compiler-macro f1 (&rest args) ... The DYNAMIC-EXTENT looks wrong. ...
    (comp.lang.lisp)
  • Re: A cute reader hack
    ... (lambda (&rest args) ... (declare (dynamic-extent args)) ...
    (comp.lang.lisp)
  • Re: A cute reader hack
    ... (defun \_-reader (stream char) ... (declare (dynamic-extent args)) ...
    (comp.lang.lisp)