There is always the big "back compatibility"question. Mentioned #[none] and similar may be used in many plain text data files, but I guess it's still not late for R3 and Red to change it to #(none) and use #[ ] for maps.
(I can say this as I have not ported any of my R2 scripts to R3 yet!)
Why wouldn't we use #(...) for maps rather?
It does not looks fine to me... btw, why to have special construct for map! anyway? one can always use:
>> #[map![a 2 b 3]] == make map! [ a 2 b 3 ]
Which leads to question if this would be considered as nice:
#(#[a 1 b 2])
>> #[map![a 2 b 3] is it ok that I can do this?] == make map! [ a 2 b 3 ]
#[#(a 1 b 2)]
"why to have special construct for map! anyway?" To be able for REN to compete with JSON.
#(...) is probably ok for construction syntax, leaving #[...] for maps.
#(#[a 1 b 2]) is not needed anyway, as map! does not support indexes like block! and so it does not have special serialized syntax.
Oldes, the syntax would be simply #(a: 1 b: 2) or #[a: 1 b: 2].
I prefer # over #() because maps are really lists. They just have an extra constraint. Technically we don't need them of course. but it does simplify things for generic libraries that would otherwise have to be hinted to create maps in place of lists.
Behavior in the case of extra values in maps needs to be defined. i.e., what's valid or what is silently ignored. It brings up another question though, which I've been thinking about lately.
Do we require an outer container (map or list)? If not, what should the behavior be? If we check for names and matching values, do we have to wait for the end to say it's valid? Some formats are designed to allow streaming. Do we care about that?
- I am against changing the existing #[...] construction syntax - If there is a need to have a new syntax for maps, I would prefer something like ![....], m[...], etc. See http://issue.cc/r3/2094
(Wow, hi Ladislav)
To explain it further, I claim that Rebol syntax is designed so that
map! [a: 1 b: 2 c: 3]
should be interpreted as a word followed by a block, while
map![a: 1 b: 2 c: 3]
should be interpreted as a different type of syntax, where the map! text modifies the meaning.
There are users who claim that this idea is limiting their freedom to require the computer to use the above syntax types interchangeably.
My answer is that Rebol was designed to handle absence (or presence) of space as significant in accordance with existing typographic conventions.
Everybody wanting to have the freedom to leave out spaces where they see fit should turn to a different language.
I like the <datatype>[...] style of syntax due these reasons: -can be used not only for map! -won't break the current use of #[...] construct (compatibility) -extension of the Rebol loader should be efficient and very easy (code for parsing <datatype> should be already here, jest additional check for whitespace or "[" right after)
It's evident that Rebol's primary designer did _not_ design Rebol in a way that there is a space required between e.g. a closing and an operning square bracket `][`.
Leaving that discussion aside, the proposed <datatype>[...] has its merits.