Alan Manuel Gloria:
> >> I once had to code this expression:
> >>
> >> force(car(force(unwrap-box(s))))
> >>
> >> And it's ugly.
> >>
> >> I could use I-expressions:
> >>
> >> force
> >> . car
> >> . . force
> >> . . . unwrap-box s
> >>
> >> But that wastes precious vertical space.
> >>
> >> So I propose the SUBLIST semantic.

I'm wondering - can we consider SUBLIST == ENLIST?

You can call this a new variant if you want, which is why I'm starting a new 
thread. But I *think* they could be defined as being the same operator.

Semantics could be, where $$ is the SUBLIST==ENLIST separator, that given:
    EXPR1 $$ EXPR2
It maps to:
    (EXPR1 EXPR2)
I.E., it becomes cons(EXPR1 EXPR2).

where either EXPR1 and EXPR2 can be empty, and EXPR2 can span lines.  The 
beginning of EXPR1 is the end of this line's indentation, the previous $$, or 
previous \\, whichever  comes first. EXPR2 is processed as if it were beginning 
a line, and can have child lines.

I'm not sure if I'm changing your original intent for the ENLIST operator; if I 
am, please enlighten me!

But if you accept this definition, this means that:
    force(car(force(unwrap-box(s))))
can be written as:
    force $$ car $$ force $$ unwrap-box s

> Of course, the lack of true currying means that a slight variant like:
.   foo(bar(nitz quux(meow)))
...

True, the operator is less helpful in this case.  You could do this:

.    foo $$ bar nitz quux(meow)

I have no trouble believing that SPLIT (\\) is a useful thing, because it's 
helpful for keywords, and it can simultaneously be the group operator.

And I can see that there are cases where SUBLIST==ENLIST as define above is 
useful.  One thing going for it is, if you can buy the definition above, it's a 
pretty clean & simple definition.

But... how *important* is this SUBLIST==ENLIST operator?  What other use cases 
recommend it?  Are there enough use cases to justify adding it?  What would be 
the best symbol, if implemented? $, $$, ~, something else?

--- David A. Wheeler

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to