{Name For The Braced Array Type}

It's early yet in the discussion of whether to make braces a new array type. But people seem receptive and feel like maybe Rebol has put itself in a bad position by using that particularly valuable piece of keyboard real-estate for something "superficial" like making strings a little cleaner, sometimes. :-/

For lack of another name I had called it BRACED!.

But I don't like that much more than I would want to call blocks BRACKETED! (or BRACK! :roll_eyes:)... nor call groups PARENTHESIZED! (or PAREN! :face_vomiting: )

Here is my suggestion for the 3 array types:

[block] (group) {fence}

I like that FENCE is five letters...matching GROUP and BLOCK. I like that it starts with a distinct character.

I actually think having it be divorced from anything obvious about creating objects can be seen as an asset instead of a liability. Because that's only what it's for sometimes.

  • "In the PARSE dialect, blocks are used to represent subrules. Groups switch over to running ordinary code as with DO. While fences are used to... (insert your active imagination here)"

  • "If there's an integer inside of a pair of fences, such as {{10}}, then that represents a citation. Citations can appear at either the beginning or end of a reference block."

It's one of those things that might seem a little weird at first, but as you become accustomed to saying it then it becomes normal...and you're grateful to have such a convenient word at hand.

Other Uses of "Fence" in Programming

Dictionary definition of fence: a barrier, railing, or other upright structure, typically of wood or wire, enclosing an area of ground to mark a boundary, control access, or prevent escape.

The term fence has only two meanings in programming that jump immediately to mind...the one most people would know are these three-backticks used to format code in MarkDown:

When you are writing things in **MarkDown**
The following is a "code fence"
int main(int argc, char *argv) {
    printf("I'm not a huge fan of the ```, myself.\n");
    return EXIT_SUCCESS;
*(I myself prefer to indent by 4 spaces, instead.)*

Less well-known to the scripting world would be "fencing instructions" which are low-level processor stuff used to mitigate things like Spectre.

Other Options?

{ CURLY! } is too goofy, immediate veto from me.

I've explained why I don't like { BRACE! } or { BRACED! }. Plus brace has the problem of being singular like PAREN!, while BRACED! seems to talk about the contents vs. the actual structure of the container itself...which I guess might have to be "bracing" or "braces" or something. FENCE! lets you mentally model it as actually referring to "the container in and of itself".

For terms that relate to "contained things" there might be the likes of { CLAUSE! }...but that feels a bit more prescriptive to what it's for. And object-making doesn't line up with that. FENCE! is more abstract to me, somehow.

One could argue that { CLUSTER } might sound more like an array that produced an object. ("Hey, cluster these keys together, into a blob.") You might similarly argue for { AGGREGATE! } as being "more meaningful".

But I'm drawn to the viscerality of FENCE!. It feels learnable within this vocabulary. Especially when you see it lined up with GROUP! and BLOCK!. I'm kind of attached to it now. :two_hearts:

1 Like

Fence sounds like a winner to me.


Give it some thought for a moment... And?...

A data type that, like a Rebol function can take parameters in doubles: key/value pair, or just keys as in a list with or without [type!] . Something like Uparse could be its constructor.

Most programming languages use a sequence data type, but its usually homogeneous.

Ours would be heterogeneous, serialized(molded), and based on its delimitation, you or it can choose its data structure type.

This would allow us to pull theres in and push ours out without many changes.

We could also have the convenience of not loading but still Reboling away on it some what safely.

This can work.

Take a look at Euphorias' sequence type. Rebol is allready there. It just needs a R/S, VM, Ren-C, EU, C, or plain old Rebol Dialect parser.

I put together the %Rebol-Dom.r and its Mdlparser.r just for this purpose.

It's just my way of prototyping the Sequence idea.

Just my 2 cents worth of thoughts.