{"action":"created","issue":{"url":"https://api.github.com/repos/jfecher/ante/issues/13","repository_url":"https://api.github.com/repos/jfecher/ante","labels_url":"https://api.github.com/repos/jfecher/ante/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/jfecher/ante/issues/13/comments","events_url":"https://api.github.com/repos/jfecher/ante/issues/13/events","html_url":"https://github.com/jfecher/ante/issues/13","id":188926104,"number":13,"title":"Support for union types by the language?","user":{"login":"PavelVozenilek","id":5585037,"avatar_url":"https://avatars.githubusercontent.com/u/5585037?v=3","gravatar_id":"","url":"https://api.github.com/users/PavelVozenilek","html_url":"https://github.com/PavelVozenilek","followers_url":"https://api.github.com/users/PavelVozenilek/followers","following_url":"https://api.github.com/users/PavelVozenilek/following{/other_user}","gists_url":"https://api.github.com/users/PavelVozenilek/gists{/gist_id}","starred_url":"https://api.github.com/users/PavelVozenilek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PavelVozenilek/subscriptions","organizations_url":"https://api.github.com/users/PavelVozenilek/orgs","repos_url":"https://api.github.com/users/PavelVozenilek/repos","events_url":"https://api.github.com/users/PavelVozenilek/events{/privacy}","received_events_url":"https://api.github.com/users/PavelVozenilek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-12T18:15:37Z","updated_at":"2016-11-12T21:56:38Z","closed_at":null,"body":"Say I have:\r\n\r\n```\r\ntype Char =  c8|c32 c\r\nlet Char ch = ...\r\n```\r\n\r\nDoes the language support \"polymorphic use\" through union parameters? Say I have functions:\r\n\r\n```\r\nfun foo: ch8 par = ...\r\nfun foo: c32 par = ...\r\n\r\n// Now the compiler may insert run-time decision \r\n// which function to call. \r\n// It could also do compile-time check that all possibilities are covered, \r\n// that there's a foo overload for every union member\r\n//\r\nfoo(ch)  // will this work?\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/jfecher/ante/issues/comments/260151056","html_url":"https://github.com/jfecher/ante/issues/13#issuecomment-260151056","issue_url":"https://api.github.com/repos/jfecher/ante/issues/13","id":260151056,"user":{"login":"PavelVozenilek","id":5585037,"avatar_url":"https://avatars.githubusercontent.com/u/5585037?v=3","gravatar_id":"","url":"https://api.github.com/users/PavelVozenilek","html_url":"https://github.com/PavelVozenilek","followers_url":"https://api.github.com/users/PavelVozenilek/followers","following_url":"https://api.github.com/users/PavelVozenilek/following{/other_user}","gists_url":"https://api.github.com/users/PavelVozenilek/gists{/gist_id}","starred_url":"https://api.github.com/users/PavelVozenilek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PavelVozenilek/subscriptions","organizations_url":"https://api.github.com/users/PavelVozenilek/orgs","repos_url":"https://api.github.com/users/PavelVozenilek/repos","events_url":"https://api.github.com/users/PavelVozenilek/events{/privacy}","received_events_url":"https://api.github.com/users/PavelVozenilek/received_events","type":"User","site_admin":false},"created_at":"2016-11-12T21:56:38Z","updated_at":"2016-11-12T21:56:38Z","body":"Such feature would probably have different implementation than ordinary vtable, it may be more like Smalltalk does it.\r\n\r\nAnyway, I understood the macro example, really good one.\r\n\r\n--------------\r\n\r\nWill it be possible to invoke a macro without explicitly using its name (the `union_call` here), e.g. to hijack some existing function? For example to wrap some function(s) with mutex, w/o touching the source or how they are used in an application?"}}
{"actor":{"display_login":"PavelVozenilek"}}