{"action":"created","issue":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/2112","labels_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/2112/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/2112/comments","events_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/2112/events","html_url":"https://github.com/jashkenas/coffeescript/issues/2112","id":3159640,"number":2112,"title":"switch proposal","user":{"login":"johngeorgewright","id":1423566,"avatar_url":"https://avatars.githubusercontent.com/u/1423566?v=3","gravatar_id":"","url":"https://api.github.com/users/johngeorgewright","html_url":"https://github.com/johngeorgewright","followers_url":"https://api.github.com/users/johngeorgewright/followers","following_url":"https://api.github.com/users/johngeorgewright/following{/other_user}","gists_url":"https://api.github.com/users/johngeorgewright/gists{/gist_id}","starred_url":"https://api.github.com/users/johngeorgewright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johngeorgewright/subscriptions","organizations_url":"https://api.github.com/users/johngeorgewright/orgs","repos_url":"https://api.github.com/users/johngeorgewright/repos","events_url":"https://api.github.com/users/johngeorgewright/events{/privacy}","received_events_url":"https://api.github.com/users/johngeorgewright/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jashkenas/coffeescript/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2012-02-09T16:45:51Z","updated_at":"2015-09-02T10:43:45Z","closed_at":null,"body":"Hello there,\r\n\r\nI've just started using coffee script with node.js and I'm quickly falling in love. I have a proposal though... I understand the logic behind the switch statements generally requiring to break after each case, however, in most other languages I quite often like to use the fall through option. I.e:\r\n\r\n```javascript\r\nswitch (resp.statusCode) {\r\n  case 409:\r\n    console.log('Product is already assigned.');\r\n\r\n  case 403:\r\n    // save it locally\r\n    save(item);\r\n    break;\r\n\r\n  case 404:\r\n    console.error('Product doesn\\'t exist');\r\n    break;\r\n\r\n  case 500:\r\n    console.error('Something went really wrong');\r\n    break;\r\n}\r\n```\r\n\r\nWhen writing this in coffee script I have to duplicate code:\r\n\r\n```ruby\r\nswitch res.statusCode\r\n  when 409\r\n    console.log 'Product is already assigned.'\r\n    # save it locally\r\n    save item\r\n  # save it locally\r\n  when 403 then save item\r\n  when 404 then console.error 'Product doesn\\'t exist'\r\n  when 500 then console.error 'Something went really wrong.'\r\n```\r\n\r\nWhat would be great is if I could somehow recreate the usual fall through... with something like a \"continue\" command:\r\n\r\n```ruby\r\nswitch res.statusCode\r\n  when 409\r\n    console.log 'Product is already assigned.'\r\n    continue\r\n  # save it locally\r\n  when 403 then save item\r\n  when 404 then console.error 'Product doesn\\'t exist'\r\n  when 500 then console.error 'Something went really wrong.'\r\n```\r\n\r\nI know this example is very small, but sometimes there is a fair amount that can be abstracted with the fall through.\r\n\r\nThanks,\r\nJohn"},"comment":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/comments/137024513","html_url":"https://github.com/jashkenas/coffeescript/issues/2112#issuecomment-137024513","issue_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/2112","id":137024513,"user":{"login":"LKorowicki","id":13901320,"avatar_url":"https://avatars.githubusercontent.com/u/13901320?v=3","gravatar_id":"","url":"https://api.github.com/users/LKorowicki","html_url":"https://github.com/LKorowicki","followers_url":"https://api.github.com/users/LKorowicki/followers","following_url":"https://api.github.com/users/LKorowicki/following{/other_user}","gists_url":"https://api.github.com/users/LKorowicki/gists{/gist_id}","starred_url":"https://api.github.com/users/LKorowicki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LKorowicki/subscriptions","organizations_url":"https://api.github.com/users/LKorowicki/orgs","repos_url":"https://api.github.com/users/LKorowicki/repos","events_url":"https://api.github.com/users/LKorowicki/events{/privacy}","received_events_url":"https://api.github.com/users/LKorowicki/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T10:43:45Z","updated_at":"2015-09-02T10:43:45Z","body":"@lydell I am not authorized to share code which I am currently working on"}}