Allen Wirfs-Brock wrote:
I now could be quite happy with the paren based cascade idea that Brendan suggested last night. I'm surprised that no one has commented on the bnf I provided in a subsequent message.

Grammar is a detail at this point. The objection to parens is reasonable enough: they look bad when split across multiple lines:

obj.(
  deep.(
    deeper: val;
    deeper2: val2
  )
)

(assume everything doesn't fit on one line).

Schemers might style this thus:

obj.(deep.(deeper: val;
           deeper2: val2))

but that looks bad too -- too ragged-left with arbitrary indentation and )))) pile-ups at the end.

Braces look right because they follow K&R style, which as Crock points out wins in JS because of restricted productions, specifically

  return {
    obj: literal,
    here: right
  };

So,

obj.{
  deep.{
    deeper: val;
    deeper2: val2
  }
}

/be



_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to