[setf (+ (** c 2) (+ (* -5 c) 6)) 0] ?!

On Thu, Jun 27, 2019, 07:39 Alexander Burger <a...@software-lab.de> wrote:

> Hi Bruno,
>
> > So, why is there no setf in picolisp?
>
> The answer is simple: It does not make sense.
>
> PicoLisp is a pure interpreter, and what 'setf' does is setting the value
> of
> what the expression *would* return. I'm not fit in CommonLisp, but
>
>    (setf (car X) 7)
>
> means to set the CAR of the cell pointed at by X to 7.
>
> So a compiler analyzes the argument (car X), and compiles
>
>    (set X 7)  # in PicoLisp
>
> Similarly,
>
>    (setf (get 'X 'a) 7)
>
> compiles to
>
>    (put 'X 'a 7)
>
>
> There is a 'setf' function in PicoLisp (meant as a joke) in
>
>    misc/setf.l
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>

Reply via email to