mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Scheme: tree-set! vs tree-assign! ?


Chronological Thread 
  • From: "Philippe Joyez" <address@hidden>
  • To: address@hidden,address@hidden
  • Subject: Re: [TeXmacs] Scheme: tree-set! vs tree-assign! ?
  • Date: Fri, 18 Nov 2016 13:22:25 +0100

HI Karl,

The manual says:
"""
(tree-assign! var new-value) (tree assignment)
On input, we have a Scheme variable var of type tree and new-value of type
content. The macro replaces the tree by new-value and updates var accordingly.
The new tree value of var is returned.


(tree-set! which accessors^* new-value) (smart tree assignment)
This routine replaces the tree (tree-ref which accessors^*) by a new content
value new-value. Besides the fact that the routine tree-set supports
additional accessors for which (see the description of tree-ref below), tree-
set differs from tree-assign in this respect that tree-set tries to cleverly
decompose the assignment into fundamental modification routines. The objective
of this decomposition is to make a less intrusive modifications in the
document, so as to preserve as many tree positions and cursor positions as
possible.
"""

So, besides being more flexible (with the "accessors"), tree-set will also
make sure (if possible at all) that any other existing tree variables that
point inside the subtree that is being modified still point to the relevant
part of the modified subtree after the function returns.



Archive powered by MHonArc 2.6.19.

Top of page