Lists/Maps/Sets (Was Re: The story of E, part 2 (fwd))

Dan Bornstein danfuzz@milk.com
Fri, 9 Oct 1998 09:48:11 -0700 (PDT)


Just a brief note from the past, as it were, regarding lists and mappings
and my favorite dead language, ScriptX!

ScriptX lists had the syntax:

  [v1, v2, v3]

ScriptX mappings had the syntax:

  [k1 -> v1, k2 -> v2, k3 -> v3]

ScriptX had no raw syntax for sets, however the standard way to do this
was to add a coercion to the expression (which was also done to get
a "list" or "mapping" to a particular class other than the defaults):

  [v1, v2, v3] as HashedSet
  [v1, v2, v3] as SortedArray
  [k1 -> v1, k2 -> v2, k3 -> v3] as <uh, don't remember anything appropriate>

If you instead introduced a "set" or "map" keyword, then I think you'd still
be able to unambiguously differentiate between lists, maps and sets:

  [v1, v2, v3]
  set [v1, v2, v3]
  [k1 -> v1, k2 -> v2, k3 -> v3]

or whatever. This would save from confusion of curlies as scoping vs
curlies as aggregation, and would also make the aggregation constructs look
more similar to each other, both of which I think would be Good Things.

-dan