{"action":"created","issue":{"url":"https://api.github.com/repos/openscad/openscad/issues/1380","repository_url":"https://api.github.com/repos/openscad/openscad","labels_url":"https://api.github.com/repos/openscad/openscad/issues/1380/labels{/name}","comments_url":"https://api.github.com/repos/openscad/openscad/issues/1380/comments","events_url":"https://api.github.com/repos/openscad/openscad/issues/1380/events","html_url":"https://github.com/openscad/openscad/pull/1380","id":93156719,"number":1380,"title":"Add asc() builtin function.","user":{"login":"t-paul","id":1330241,"avatar_url":"https://avatars.githubusercontent.com/u/1330241?v=3","gravatar_id":"","url":"https://api.github.com/users/t-paul","html_url":"https://github.com/t-paul","followers_url":"https://api.github.com/users/t-paul/followers","following_url":"https://api.github.com/users/t-paul/following{/other_user}","gists_url":"https://api.github.com/users/t-paul/gists{/gist_id}","starred_url":"https://api.github.com/users/t-paul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-paul/subscriptions","organizations_url":"https://api.github.com/users/t-paul/orgs","repos_url":"https://api.github.com/users/t-paul/repos","events_url":"https://api.github.com/users/t-paul/events{/privacy}","received_events_url":"https://api.github.com/users/t-paul/received_events","type":"User","site_admin":false},"labels":[{"id":7673856,"url":"https://api.github.com/repos/openscad/openscad/labels/Discussion","name":"Discussion","color":"444444","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/openscad/openscad/milestones/4","html_url":"https://github.com/openscad/openscad/milestones/2016.12","labels_url":"https://api.github.com/repos/openscad/openscad/milestones/4/labels","id":900766,"number":4,"title":"2016.12","description":"Next major release. The goal is 2016.12.\r\nSee also https://github.com/openscad/openscad/projects/1\r\n","creator":{"login":"kintel","id":186094,"avatar_url":"https://avatars.githubusercontent.com/u/186094?v=3","gravatar_id":"","url":"https://api.github.com/users/kintel","html_url":"https://github.com/kintel","followers_url":"https://api.github.com/users/kintel/followers","following_url":"https://api.github.com/users/kintel/following{/other_user}","gists_url":"https://api.github.com/users/kintel/gists{/gist_id}","starred_url":"https://api.github.com/users/kintel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kintel/subscriptions","organizations_url":"https://api.github.com/users/kintel/orgs","repos_url":"https://api.github.com/users/kintel/repos","events_url":"https://api.github.com/users/kintel/events{/privacy}","received_events_url":"https://api.github.com/users/kintel/received_events","type":"User","site_admin":false},"open_issues":34,"closed_issues":38,"state":"open","created_at":"2014-12-11T17:49:13Z","updated_at":"2016-10-29T23:30:20Z","due_on":"2016-12-31T00:00:00Z","closed_at":null},"comments":10,"created_at":"2015-07-05T23:29:15Z","updated_at":"2016-10-30T00:05:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openscad/openscad/pulls/1380","html_url":"https://github.com/openscad/openscad/pull/1380","diff_url":"https://github.com/openscad/openscad/pull/1380.diff","patch_url":"https://github.com/openscad/openscad/pull/1380.patch"},"body":"Suggestion for a builtin `asc()` function to complement the existing `chr()`.\n- Accepts single or multiple strings as input, internally everything is handled as just a list of characters\n- Empty string(s)\n  - `echo(asc(\"\"));` => `0`\n- One single character will produce a number as output\n  - `echo(asc(\"←\"));` => `8592`\n- Multiple characters as input will produce a list of numbers\n  - `echo(asc(\"abc\"));` => `[97, 98, 99]`\n  - `echo(asc(\"ab\", \"c\"));` => `[97, 98, 99]`\n- Reverses the `chr()` call\n  - `i = \"test\"; o = chr(asc(i)); echo(i == o);` => `true`\n- Invalid input will produce a warning and is skipped\n- In case of no valid arguments at all, `undef` is returned\n"},"comment":{"url":"https://api.github.com/repos/openscad/openscad/issues/comments/257123355","html_url":"https://github.com/openscad/openscad/pull/1380#issuecomment-257123355","issue_url":"https://api.github.com/repos/openscad/openscad/issues/1380","id":257123355,"user":{"login":"kintel","id":186094,"avatar_url":"https://avatars.githubusercontent.com/u/186094?v=3","gravatar_id":"","url":"https://api.github.com/users/kintel","html_url":"https://github.com/kintel","followers_url":"https://api.github.com/users/kintel/followers","following_url":"https://api.github.com/users/kintel/following{/other_user}","gists_url":"https://api.github.com/users/kintel/gists{/gist_id}","starred_url":"https://api.github.com/users/kintel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kintel/subscriptions","organizations_url":"https://api.github.com/users/kintel/orgs","repos_url":"https://api.github.com/users/kintel/repos","events_url":"https://api.github.com/users/kintel/events{/privacy}","received_events_url":"https://api.github.com/users/kintel/received_events","type":"User","site_admin":false},"created_at":"2016-10-30T00:05:16Z","updated_at":"2016-10-30T00:05:16Z","body":"@doug-moen Thanks for that piece of input!\r\n\r\nWhile I agree with your sentiment, I'm a bit hesitant to introducing another way of naming such functions for OpenSCAD (at least pre-OpenSCAD2). ..in particular because we already have `chr()` which has a similar counterpart in a few other languages.\r\nHence, I think it would make sense to use `ord()` to name an (as exact as possible) inverse of `chr()`.\r\n\r\n`ord()` over `asc()` simply because it has more momentum in popular programming languages today.\r\n\r\n..but I think we agree to the point that this is merely a question of naming said functions, so we still have time for more counter suggestions :)"}}
{"actor":{"display_login":"kintel"}}