Arc Forumnew | comments | leaders | submitlogin
1 point by akkartik 5113 days ago | link | parent

Argh, we're totally talking about different things. And now this thread's gotten hijacked by switch/case/break C whining :)

Part of the problem was that I too was using the wrong terminology. So fuck the names and terms, when I said 'case expressions' I was referring to wart's (def .. :case ..) syntactic sugar to extend any function. This is why I linked to http://en.wikibooks.org/wiki/Haskell/Control_structures#Equa... earlier in the thread. See how I extend keys in http://arclanguage.org/item?id=14244.



1 point by Pauan 5113 days ago | link

Oh, that makes a bit more sense. Technically speaking, Arc's case expression is sorta like guards, though, in the sense of dispatching to different code depending on a condition. You're right that wart's :case is essentially a super nice version of `case`.

Also, what's wrong with `switch` whining? :P This is a JavaScript forum, right? Oh wait...

-----