AltME: Ren - Data Exchange Format

Messages

Andreas
The longer I think about it (years, by now), the more convinced I get that we really should have #[...] as literal form for map!s.
(Not yet sure what to do regarding construction syntax.)
PeterWood
Do you see some significance of the hash sign in respect to maps?
You could say that &[ ... ] relates to the key & value pairs.
Gregg
It's funny. I was just thinking about this exact issue and that we do need *something* but I haven't come up with anything better that is short (just a symbol) and meaninful. A colon/double colon or =/== makes sense in that keys end in colons or mean, roughly "equals", and kind of like production rules in grammars, but are syntactically much further from REBOL.
DocKimbel
#{...} could be a possible literal form for construction syntax.
Andreas
> Do you see some significance of the hash sign in respect to maps?
Yes, but not a strong one. A map is a "hash table", hence the hash.
However, the primary reason I really like the hash sign #[...] notation is that it visually stands out. I experimented with :[...] ("colon block") for a while, but that's just too muted, too easily overlooked.
Andreas
#{...} for construction syntax would certainly be a possibility. But then we'd have to find another syntax for binary!.
Maybe #(...) for construction syntax makes sense? (And #(...) is unused, at the moment.) In a way, construction syntax can be understood to be something "forced", something immediate which somewhat matches the use of paren (....) in other contexts.
Henrik
what happens to serialized values, like #[none] ?
Gregg
It's still there Henrik.
:[] doesn't stand out much Andreas, I agree.
Gregg
I should say that REBOL's construction syntax is still in REBOL. Ren doesn't know anything about it. At least according to the current spec.

DocKimbel
Right, #(...) is what I meant. :-)
Andreas
> what happens to serialized values, like #[none] ?
Those things are called "construction syntax" now. An alternative syntax for construction syntax, under the premise that #[...] would be nice for maps, is what we are discussing right now.
Henrik
OK, thanks
Andreas
Sorry, that maybe sounded a bit gruff -- not intended. Any thoughts would be more than welcome :)

Oldes
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!)
DocKimbel
Why wouldn't we use #(...) for maps rather?
Oldes
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])
and...
>> #[map![a 2 b 3] is it ok that I can do this?]
== make map! [
    a 2
    b 3
]
#[#(a 1 b 2)]

Last message posted 412 weeks ago.