satyr / coco

Unfancy CoffeeScript

Home Page:http://satyr.github.com/coco/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keyless variable in implicit object

vendethiel opened this issue · comments

commented

We have {a} in the case of an explicit object, but I don't quite seem to remember a feature that'd allow this kind of thing to be simplified:

a =
  b: b
  # since we have:
  ...: c

If you must:

a =
   ...: {b}
commented

Hm, thanks. Would you be interested in supporting it, or not at all?

Support what?

commented

a single-variable variation

But how? You can't blindly consume non-properties into a braceless object.

E.g. f p: q, g() wants to be f({p: q}, g()), not f({p: q, g: g}()).

commented

no, not blindly. I was thinking of some syntax, like *: a, but this might just be good enough.