[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with recursive destructive function
From: |
Michael Heerdegen |
Subject: |
Re: Help with recursive destructive function |
Date: |
Sun, 29 Jul 2018 02:09:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Eric Abrahamsen <address@hidden> writes:
> Pretty sure it did work, in effect it was doing this:
>
> (defun upcase-ref (ref)
> (cl-callf upcase (gv-deref ref)))
>
> (let ((tree "one"))
> (upcase-ref (gv-ref tree))
> tree)
Ok. This changes the binding of the variable named "tree", but not the
value. The old value is gone. I guess this is good enough for what you
want.
> Which for some reason the larger function is not doing any more. I'm not
> sure if it's necessary, but for instance I will have to be able to
> replace a list (representing an object constructor) into an actual
> object, which I assume is equivalent to this string upcase example.
The first thing `deep-edit' does when binding `stack' is to dereference
the passed reference. The reference itself is never used, so its
"target" can't be changed.
Michael.