Functions like COMMENT and ELIDE return VOID!
>> comment "vanishes"
== \~\ ; antiform (void!)
>> 10 + 20 comment "vanishes"
== 30
>> 10 + 20 elide print "Prints but vanishes"
Prints but vanishes
== 30
>> 10 + 20 (elide print "Grouping keeps vanishing behavior")
Grouping keeps vanishing behavior
== 30
You can save the result of a vanishing evaluation in a variable:
>> result: comment "make a void"
== \~\ ; antiform (void!)
...and using ^META-fetching, you can copy that into another variable:
>> other: ^result
== \~\ ; antiform (void!)
...aaaand if you EVAL a block of code, it looks like it should vanish... because COMMENT returns void:
>> eval [comment "make a void"]
== \~\ ; antiform (void!)
But it seems that unless you call a function like COMMENT or ELIDE directly, the vanishing gets lost...and it makes an empty PACK!...which doesn't vaporize (calls itself "heavy void").
>> 1 + 2 ^result
== \~()~\ ; antiform (pack!) "heavy void"
>> 1 + 2 eval [comment "test"]
== \~()~\ ; antiform (pack!) "heavy void"
>> f: make frame! comment/
>> f.skipped: "test"
>> 1 + 2 eval f
== \~()~\ ; antiform (pack!) "heavy void"
The same thing seems to happen in PARSE. Rules like ELIDE work fine if you use them directly, and you can put them in a block:
>> parse "aaabbbb" [tally "a" elide some "b"]
== 3
>> parse "aaabbbb" [tally "a" [elide some "b"]]
== 3
But if you abstract the block into a rule variable, the vanishing behavior goes away:
>> rule: [elide some "b"]
>> parse "aaabbbb" [tally "a" rule]
== \~()~\ ; antiform (pack!) "heavy void"
Is there any way to get invisibility if you're not using a direct call to these functions?
