Guards are now ready for discussion (was: Nov 18 notes)

P T Withington ptw at
Mon Nov 22 12:08:35 PST 2010

On 2010-11-22, at 14:33, Brendan Eich wrote:

> Is losing the braces really worth the added complexity?

Perhaps not.  Braces are surely as good a way to denote keyword args as any other flag.  It occurred to me that there is no equivalent of object literals in the languages I know that have keyword arguments.  There are strong parallels, which is probably why the discussion of the guarded literal syntax brought it to my mind.  But that makes me wonder how I would write a function with "keyword arguments" that were both guarded and had default values?

  function f (a:V, b:W=w {c:X=x, d:Y=y}) ...

or, the less parallel:

  function f (a:V, b:W=w {(c:X):x, (d:Y):y}) ...

More information about the es-discuss mailing list