Re: A cute reader hack



Marcin 'Qrczak' Kowalczyk <qrczak@xxxxxxxxxx> writes:

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/

It is always unsafe to modify &rest arguments.

--
This is a song that took me ten years to live and two years to write.
- Bob Dylan
.



Relevant Pages

  • Re: A cute reader hack
    ... (lambda (&rest args) ... (declare (dynamic-extent args)) ... You seem to have suggested to declare as dynamic-extent the &rest ...
    (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
    ... (defun \_-reader (stream char) ... (declare (dynamic-extent args)) ...
    (comp.lang.lisp)
  • Re: A speakable (kind of) SUO-KIF ?
    ... parens, but this is a simple example. ... function before declaring or defining it). ... Just define g or at least declare it before using it for ... For 3 args: ...
    (comp.lang.lisp)