{ Rethinking Braces }... as an array type?

I feel like I've "disproved" the value of braces for lexical objects. And so the somewhat glum finding is that you aren't really getting all that much bang for your buck out of a new array brace type that you couldn't do before with MAKE OBJECT!.

In fact, the new brace type couldn't be used a lot of places. You wouldn't want to derive objects using it, because it would greedily create objects:

base-object: {a: 10, b: 20}
derived-object: extend base-object {c: 30}

This would wind up creating a useless intermediate OBJECT! with a key of C and a value of 30, because the parameter would be evaluated before EXTEND would receive it. You'd be better off passing [c: 30] so the structure could be analyzed and integrated into a single new created object.

These sorts of findings rain on the parade of the idea of braces for objects.

4 Likes