AltME: Ren - Data Exchange Format

Messages

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)]
DocKimbel
"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.
Oldes
#(#[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.
*need*
DocKimbel
Oldes, the syntax would be simply #(a: 1 b: 2) or #[a: 1 b: 2].
Gregg
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.

Last message posted 412 weeks ago.