{"action":"created","issue":{"url":"https://api.github.com/repos/ozra/onyx-lang/issues/23","repository_url":"https://api.github.com/repos/ozra/onyx-lang","labels_url":"https://api.github.com/repos/ozra/onyx-lang/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/ozra/onyx-lang/issues/23/comments","events_url":"https://api.github.com/repos/ozra/onyx-lang/issues/23/events","html_url":"https://github.com/ozra/onyx-lang/issues/23","id":135274615,"number":23,"title":"Feature suggestion: suffix while","user":{"login":"stugol","id":1113153,"avatar_url":"https://avatars.githubusercontent.com/u/1113153?v=3","gravatar_id":"","url":"https://api.github.com/users/stugol","html_url":"https://github.com/stugol","followers_url":"https://api.github.com/users/stugol/followers","following_url":"https://api.github.com/users/stugol/following{/other_user}","gists_url":"https://api.github.com/users/stugol/gists{/gist_id}","starred_url":"https://api.github.com/users/stugol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stugol/subscriptions","organizations_url":"https://api.github.com/users/stugol/orgs","repos_url":"https://api.github.com/users/stugol/repos","events_url":"https://api.github.com/users/stugol/events{/privacy}","received_events_url":"https://api.github.com/users/stugol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-21T23:18:45Z","updated_at":"2016-02-24T20:51:05Z","closed_at":null,"body":"Strongly suggest a value-collecting suffix `while`:\r\n```\r\ntext = \"abcdef\"\r\nresults = text.shift while !text.empty?\r\nputs results\t\t\t-- [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"]\r\nresults = text.shift while !text.empty?\r\nputs results\t\t\t-- [ ]\r\n```\r\nAlso a suffix `until`, which would run at least once."},"comment":{"url":"https://api.github.com/repos/ozra/onyx-lang/issues/comments/188448911","html_url":"https://github.com/ozra/onyx-lang/issues/23#issuecomment-188448911","issue_url":"https://api.github.com/repos/ozra/onyx-lang/issues/23","id":188448911,"user":{"login":"ozra","id":563674,"avatar_url":"https://avatars.githubusercontent.com/u/563674?v=3","gravatar_id":"","url":"https://api.github.com/users/ozra","html_url":"https://github.com/ozra","followers_url":"https://api.github.com/users/ozra/followers","following_url":"https://api.github.com/users/ozra/following{/other_user}","gists_url":"https://api.github.com/users/ozra/gists{/gist_id}","starred_url":"https://api.github.com/users/ozra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozra/subscriptions","organizations_url":"https://api.github.com/users/ozra/orgs","repos_url":"https://api.github.com/users/ozra/repos","events_url":"https://api.github.com/users/ozra/events{/privacy}","received_events_url":"https://api.github.com/users/ozra/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T20:51:05Z","updated_at":"2016-02-24T20:51:05Z","body":"Hrrm, this discussion has been up in an issued in crystal, and I was very much for ditching suffix whiles because of how different expectations people seem to have on them.\r\n\r\nI've only instinctively reached for the construct once, coding in the parser, and when getting the error was like \"ah, right, _my_ bad, hehe\", copy n paste + one enter and done. It's not too much to fuzz about.\r\n\r\nNow, of course, this is a bit of a different matter, with the collecting involved. When it comes to that I really think it's something that should be implemented in user space \"functional\" method-style. Then it's crystal clear to the code reader what to expect, and the code will be as terse, and easier to combine and chain.\r\n\r\nI instincitvely feel this is not a candidate for \"core'ing\" -, but please, if you will, give some slighty more real-world(ish) examples along with \"method-style\" implementation to compare with so it's easier to evaluate the _level of generality and usefulness_ of it?\r\n"}}