[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Re: I need some help to edit a tree
From: |
Kon Lovett |
Subject: |
Re: [Chicken-users] Re: I need some help to edit a tree |
Date: |
Thu, 1 Mar 2007 09:30:17 -0800 |
On Mar 1, 2007, at 9:09 AM, minh thu wrote:
2007/3/1, Kon Lovett <address@hidden>:
On Feb 28, 2007, at 2:28 PM, minh thu wrote:
<snip>
Yes, that's what I do. But the problem is to descend in the tree to
update the correct part. But I manage to it. The fact there's no
lvalue is a bit disturbing : I need to write a procedure to get the
value and another one the set it, both are similar but the setter
needs to keep one more level to be able to use set-car!.
Well anything in Scheme that has the semantics of a storage cell is
an "lvalue", so a cons cell, vector, string, etc. are lvalues. A
character, fixnum, etc. are not lvalues.
(Immediates & Immutables are not lvalues.)
Yes, you need the cons cell to update an element. You have 2 kinds of
elements, nodes & leaves. But if you only deal internally w/ nodes
you always have a cons cell. The problem comes in w/ a leaf w/ a list
value. If you never store a cons cell as leaf then ok, otherwise
detecting a leaf-node is problematic. General purpose tree code
usually uses a different representation of a node, a structure for
example, for just this reason; some type disjoint from any type that
is legal as a leaf value.
BTW, I think the SXML sxpath can navigate an arbitrary list.
Do you think it's a good idea to write a kind of advanced
libreadline/editor which operates on S-EXPs, not on strings ? To
manage source code, documenting it, ...
Remember source code has textual comments that are not s-exps. Also,
forms like '#;' & '#|...|#' are invisible to the reader but should be
visible to a source editor.
Yes, a Scheme source editor in Scheme would be nice. An essential
component of a "pure" Chicken IDE. However, it must deal w/ embedded
C-family code, textual comments, etc. Not an easy proposition.
Best Wishes,
Kon
Thanks,
thu
- Re: [Chicken-users] Re: I need some help to edit a tree,
Kon Lovett <=