satyr / coco

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

`that` with default #199

Closed vendethiel closed 11 years ago

vendethiel commented 11 years ago

That's maybe something designed, but that isn't anaphorized (switch a; case 1 then; default that) because default is not in Switch's aTargets (I know you know).

satyr commented 11 years ago

something designed

Yep. Same for else.

vendethiel commented 11 years ago

I can see the why for else, since it's always falsy, but that's not the case for default

satyr commented 11 years ago

Hm. Normal switch is an oddball for anaphorization to begin with: the topic isn't a truthy-check unlike others.

Options:

  1. Quit anaphorizing normal switch (with topic).
  2. Quit anaphorizing switch at all.
  3. Anaphorize for else/default as well.
  4. Leave them as is.
vendethiel commented 11 years ago

Not sure what you mean "with topic" ?

I suppose it could be added to else too (got into this case only once) for consistency with default, but that doesn't make must sense to me.

satyr commented 11 years ago
switch topic  # <--
case candidate
  ...

switch  # topic-less
case condition
  ...
vendethiel commented 11 years ago

3) or 5) anaphorize default but do not anaphorize topicless switch :D.

satyr commented 11 years ago

do not anaphorize topicless switch

Why?

vendethiel commented 11 years ago

Because I had no idea it was giving this result. My bad, I retract that point. (I hardly see anaphorization for default in topic-less switch)

dbkaplun commented 11 years ago

I would opine to anaphorize default as well.