We now have the ability to have source-level "expression barriers"... that show up as commas:
>> all [1 + 2, 3 + 4]
== 7
>> all [1 +, 2 3 + 4]
** Script Error: + is missing its value2 argument
>> all [(1 +) 2 3 + 4] ; error parity
** Script Error: + is missing its value2 argument
Not a "COMMA!" Type... It's Less Than Meets The Eye
The first implementation of this was indeed called "COMMA!" and it behaved like you might expect:
old>> first [,]
== ,
old>> type of first [,]
== \~{comma!}~\ ; antiform
old>> mold first [,]
== ","
But over time, observations about this started to reveal that maybe COMMA! wasn't "just another value". For instance, you couldn't decorate them with sigils, because standalone Sigils were things:
>> obj: make object! [a: '@, b: '$, c: ~, d: '',]
== &[object! [
a: @
b: $
c: ~
d: ''
]
The realization came to be that the COMMA! wasn't the data type... rather, commas were artifacts of rendering in lists to show you where the real type was... an invisible type called BLANK!.
Further, BLANK! is the base type of the other things you see above--like the lone Sigils (@ or $ or ^)... or the most slight of all quasiforms (~) or a standalone quote count (' or '' or ''' etc.)
So this strange datatype has no molding of its own, but is only suggested by the rendering around it.
Having its antiform be VOID! led to the satisfying statement: "VOID! is the antiform of BLANK!" vs. the much more head-scratching "VOID! is the antiform of COMMA!" ![]()
Expanded Application To UPARSE
I also added the feature to UPARSE and made a patch of the feature into PARSE3 (it is difficult with how parse3 is written to do a "good" job of this):
>> parse "aaabbb" [some "a" some "b"] ; you can still do this
== "aaabbb"
>> parse "aaabbb" [[some "a"] [some "b"]] ; could have always done this
== "aaabbb"
>> parse "aaabbb" [some "a", some "b"] ; this is new!
== "aaabbb"
>> parse "aaabbb" [some, "a" some "b"] ; catching misunderstandings!
** Script Error: expression barrier hit while fulfilling argument
Beyond the expression barrier feature--which I have always believed to be important--having commas available in dialects is powerful.
Note that I left in support for 1,1 being a synonym for 1.0 based on the idea of space significance. This means you'll have less ability to copy/paste data from other contexts directly, like (1,2,3) ... but it's not clear how much gain there is from allowing that when so many other things won't work (especially in plan -4, where foo(a, b c) isn't loadable either).
At least for the moment, this breaks the idea of supporting commas in URL!s directly. While it might be possible to say that http://a,b is legal but http://a, is not, how such things are scanned needs to be redesigned so there's not so much sporadic code all over the place. I'm open to the idea...just not assuming it as a foregone conclusion.
I Actually Like It
Many years ago when expression barriers were first being cooked up, I had been mostly swayed by the "commas and periods are too hard to tell apart" idea...to say that the only purpose they should have in the language would be as synonyms.
If this idea is taken to extremes, we would also say that the number 1 and lowercase L and the uppercase i and the vertical bar all have to be the same, due to I1l|. being too hard to differentiate. (Though fonts and syntax highlighting choices can go a long way in that.)
Today my thinking is that you don't necessarily control this kind of thing from the language level. You give people choices, and they write their code as it feels good to them. If they've got a certain mix of data and don't like comma with it, they should use another arrangement. Put things in groups, or on newlines, or whatever.
I'll point out you have the option to put an entire expression in a group, or just the last thing and keep the comma. It's up to you. So taking the maybe-ugly combo of blank-tailed TUPLE! and comma, you could go with your taste:
1 + a., 2 + 3
1 + (a.), 2 + 3
(1 + a.) 2 + 3
(1 + a.) (2 + 3)
[
1 + a.
2 + 3
]
It's something people can ignore entirely if they want. Don't use it if you don't like it!