[e-lang] Terms as Views

Dean Tribble tribble at e-dean.com
Wed Aug 30 00:43:54 CDT 2006


A small piece of context: making term handling simple is important to being
able to use terms as parse nodes an simple structured data.  After some
phone conversation about this, I agree with Kevin's assessment of the
(exploratory) suggestion to integrate terms with objects.  What we really
want is to be able to use terms easily.  Much of the complexity of using
terms comes from the pain of mapping from strings, ints, and lists to and
from their term equivalents.  The experience of this can be made much better
with some judicious changes in how terms interact with datatypes.  For
example, when a quasi term is constructed, instead of strings mapping to
term tags, they should map to term strings:

? def x := "xray"
? term`containing($x)`

currently produces:

 #  term`containing(xray)`

where most of the current uses would expect:

#  term`containing("xray")`

If the outer term describes a VariableNode, and the argument is the name,
deconstructing that and getting a term rather than a string would be
surprising.  Currently to produce a term with an embedded string, you need:

?  term`containing(.String.$x)`

The .String. clutters up the code to produce terms, reducing their
convenience a lot.  The proposed easy plan for this is to change the term
quasi construction to make the string into a string node rather than a tag.
Creating tags can still be straightforward by having the quasi grammar treat
the string differently if it is followed by a paren:

? def nodeName = "Var";
? term`$nodeName($x)`

should produce:

term`Var("xray")`

On 8/16/06, Kevin Reid <kpreid at mac.com> wrote:
>
> Dean Tribble, I, and Mark Miller just thought this up.
>
> I'm barely awake now, but I want to get this written down and out
> before I forget most of it. Dean, MarkM, please explain further if
> this is too condensed.
>
> I also have to say that the idea isn't looking as good as it was
> before I wrote this message.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.eros-os.org/pipermail/e-lang/attachments/20060829/6248a25a/attachment-0001.html 


More information about the e-lang mailing list