metaeducation / ren-c

Library for embedding a Rebol interpreter into C codebases
GNU Lesser General Public License v3.0
128 stars 27 forks source link

ELIDE needs GROUP! when surrounded by Expression Barriers #1066

Closed hostilefork closed 4 years ago

hostilefork commented 4 years ago

This works as expected, with all three invisibles disappearing, giving a null position as a result:

>> evaluate [comment "This" elide print "Vaporizes" comment "COMPLETELY!"]
Vaporizes
; null

But when you put expression barriers between them, it complains after the ELIDE:

>> evaluate [comment "This" | elide print "Vaporizes" | comment "COMPLETELY!"]
Vaporizes
‌** Script Error: Ambiguous infix expression--use GROUP! to clarify
** Near: [... "Vaporizes" | comment ~~ "COMPLETELY!"]

Putting the ELIDE in a GROUP! will resolve it:

>> evaluate [comment "This" | (elide print "Vaporizes") | comment "COMPLETELY!"]
Vaporizes
; null

But that seems unfortunate to require. Is this mechanically unavoidable?

hostilefork commented 4 years ago

The model has been revised significantly. EVALUATE now stops on each invisible step, whether it is a barrier or not.

Long story made short: this is no longer an issue.