satyr / coco

Unfancy CoffeeScript
http://satyr.github.com/coco/
MIT License
498 stars 48 forks source link

Keyless variable in implicit object #244

Closed vendethiel closed 8 years ago

vendethiel commented 8 years ago

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
satyr commented 8 years ago

If you must:

a =
   ...: {b}
vendethiel commented 8 years ago

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

satyr commented 8 years ago

Support what?

vendethiel commented 8 years ago

a single-variable variation

satyr commented 8 years ago

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}()).

vendethiel commented 8 years ago

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