[e-lang] StaticScope's hasMetaStateExpr definition

Mark S. Miller markm at cs.jhu.edu
Sun Jul 23 14:00:02 EDT 2006


Kevin Reid wrote:
> On Jul 23, 2006, at 0:12, Mark S. Miller wrote:
>> 2) If done in the style of the current ENode trees, it requires an  
>> explicitly
>> different kind of object per syntactic form.
> 
> E-on-CL already does this. I offer it as an example.
> 
>> How many is it?
> 
> E-on-CL introduces 65 additional ENode subclasses. The list is  
> included below.
> [...]
> - Why not? What are the costs?
> [...]
>> Perhaps a more S-expression-ish representation, such as a term- 
>> tree, would be more  appropriate for this use?
> 
> To me, there is not really any difference, except in the style of the  
> interface. E-on-CL uses macros to define CL classes, but it could  
> just as well be done with a single class with a 'node type' slot;  
> that is only an implementation choice.

Perhaps this issue illustrates well the power of macros, and the pain of doing 
without them. In E-on-Java or E-on-Squeak, this would require 65 class 
definitions, which at least seem much heavier than 65 BNF productions and 
expansion rules. Similarly, in an E-on-E embedding this would require 65 
object definitions. OTOH, the "single class with a 'node type' slot" 
representation seems more natural for this to me. It is sufficiently 
S-expression-like, that I think we should try using term-trees for this. To 
the extent that term-trees currently can't handle this, perhaps they should be 
fixed:

Because term-trees are currently constrained to be statically DeepPassByCopy, 
they can't contain Selfish objects. This conflicts with your use of opaque 
DeepFrozen Selfish object identity to represent fresh[1] temporary variable 
names. This suggest that, in order to be even more like S-expressions (or more 
like Prolog terms), terms should be allowed to hold non-terms as children. As 
with E ConstLists, an individual term should be DeepPassByCopy iff all its 
children are DeepPassByCopy. Further, a term could be considered a term-tree 
iff all its children are smaller term-trees. The determination that a term is 
a term-tree could be memoized.

[1] If I understand your technique correctly, and if I understand FreshML's 
freshness correctly, both of which are questionable, then I think the two may 
be related. See <http://www.fresh-ocaml.org/> and 
<http://homepages.inf.ed.ac.uk/jcheney/publications/cheney05icfp.pdf>

-- 
Text by me above is hereby placed in the public domain

     Cheers,
     --MarkM


More information about the e-lang mailing list