texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] New "content" glue type


From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] New "content" glue type
Date: Thu, 20 May 2004 11:04:21 +0200 (CEST)

On Wed, 19 May 2004, David Allouche wrote:
> I'm having a look at some of the changes in 1.0.3.9.
>
> "scm_to_content" is the conversion glue that is used for "content"
> arguments of most functions which previously expected a "tree" but are
> not strictly tree-related, and were often used in association with
> "object->tree" (now "stree->tree")
>
> The code of "scm_to_content" implies that scheme objects whose root is a
> s-exp but which contain "tree" objects are acceptable "content" values.
> Is that officially supported? Is it allowed, for example, to do:
>
>     (tm-assign p `(fold ,(tree-ref t 0) ,(tree-ref t1)))
>
> instead of:
>
>     (tm-assign p (tree2 'fold (tree-ref t 0) (tree-ref t 1))) ?

Absolutely, yes. The idea is that the 'content' data type is not
only an abstraction for tree and stree, but actually more than that:
an instance of the type 'content' is an stree in which any node
may be replaced by a TeXmacs tree.

Notice that one still has to be a bit careful when using
tm-assign etc.: we do not make any copies of TeXmacs trees,
so you may get problems when assigning two different locations with
the same tree. A more elaborate interface will be developed later,
but at least we have a more solid C++ basis now.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]