{"issue":{"created_at":"2011-11-24T17:57:15Z","state":"closed","updated_at":"2011-11-25T20:34:14Z","user":{"gravatar_id":"d3b21284fac5f383113329929f098262","id":316469,"url":"https://api.github.com/users/alexwall","login":"alexwall","avatar_url":"https://secure.gravatar.com/avatar/d3b21284fac5f383113329929f098262?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":15,"body":"Hi, \r\n\r\ncoffee-script compiles this\r\n\r\n    loop\r\n      switch step\r\n        when 1\r\n          console.log \"do it and continue with step 2\"\r\n        when 2\r\n          console.log \"do it and in some situation skip step 1\"\r\n        when 3\r\n          console.log \"do it\"\r\n\r\nto that    \r\n    \r\n    while (true) {\r\n      switch (step) {\r\n        case 1:\r\n          console.log(\"do it and continue with step 2\");\r\n          break;\r\n        case 2:\r\n          console.log(\"do it and in some situation skip step 1\");\r\n          break;\r\n        case 3:\r\n          console.log(\"do it\");\r\n      }\r\n    }\r\n\r\nBut I don't want the `break` inside case 1. What can I do?\r\n\r\n-Cheers Alex","assignee":null,"id":2343833,"number":1891,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[{"name":"question","color":"cc317c","url":"https://api.github.com/repos/jashkenas/coffee-script/labels/question"}],"title":"automatic break inside the switch statement","closed_at":"2011-11-24T18:57:47Z","html_url":"https://github.com/jashkenas/coffee-script/issues/1891","url":"https://api.github.com/repos/jashkenas/coffee-script/issues/1891","milestone":null},"action":"created","comment":{"created_at":"2011-11-25T20:34:14Z","updated_at":"2011-11-25T20:34:14Z","user":{"gravatar_id":"d3b21284fac5f383113329929f098262","id":316469,"url":"https://api.github.com/users/alexwall","login":"alexwall","avatar_url":"https://secure.gravatar.com/avatar/d3b21284fac5f383113329929f098262?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Your suggestion seams interessting but it doesn't solve the problem. \r\nMy point is: I don't  want unnecessary function calls (break and call fsm again)\r\n\r\nAdditionally: this solution creates new problems: \r\n\r\n1. inconsistency: actions.READ() to switch to READ-state and using process.nextTick (-> fsm next_step) for other steps\r\n2. unnecessary workarounds: `actions[state]()`: So `switch state` is in my opinion a better representation of the fsm\r\n3. the created javascript code is more complex and has no advantages\r\n","id":2877921,"url":"https://api.github.com/repos/jashkenas/coffee-script/issues/comments/2877921"}}