{"action":"created","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/1492","repository_url":"https://api.github.com/repos/HaxeFoundation/haxe","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/1492/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/1492/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/1492/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/1492","id":14821167,"number":1492,"title":"Issue 1492 - proposal: @:native for functions would be great - haxe","user":{"login":"issuesbot","id":4543331,"avatar_url":"https://avatars.githubusercontent.com/u/4543331?v=3","gravatar_id":"","url":"https://api.github.com/users/issuesbot","html_url":"https://github.com/issuesbot","followers_url":"https://api.github.com/users/issuesbot/followers","following_url":"https://api.github.com/users/issuesbot/following{/other_user}","gists_url":"https://api.github.com/users/issuesbot/gists{/gist_id}","starred_url":"https://api.github.com/users/issuesbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issuesbot/subscriptions","organizations_url":"https://api.github.com/users/issuesbot/orgs","repos_url":"https://api.github.com/users/issuesbot/repos","events_url":"https://api.github.com/users/issuesbot/events{/privacy}","received_events_url":"https://api.github.com/users/issuesbot/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"waneck","id":178171,"avatar_url":"https://avatars.githubusercontent.com/u/178171?v=3","gravatar_id":"","url":"https://api.github.com/users/waneck","html_url":"https://github.com/waneck","followers_url":"https://api.github.com/users/waneck/followers","following_url":"https://api.github.com/users/waneck/following{/other_user}","gists_url":"https://api.github.com/users/waneck/gists{/gist_id}","starred_url":"https://api.github.com/users/waneck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waneck/subscriptions","organizations_url":"https://api.github.com/users/waneck/orgs","repos_url":"https://api.github.com/users/waneck/repos","events_url":"https://api.github.com/users/waneck/events{/privacy}","received_events_url":"https://api.github.com/users/waneck/received_events","type":"User","site_admin":false},"assignees":[{"login":"waneck","id":178171,"avatar_url":"https://avatars.githubusercontent.com/u/178171?v=3","gravatar_id":"","url":"https://api.github.com/users/waneck","html_url":"https://github.com/waneck","followers_url":"https://api.github.com/users/waneck/followers","following_url":"https://api.github.com/users/waneck/following{/other_user}","gists_url":"https://api.github.com/users/waneck/gists{/gist_id}","starred_url":"https://api.github.com/users/waneck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waneck/subscriptions","organizations_url":"https://api.github.com/users/waneck/orgs","repos_url":"https://api.github.com/users/waneck/repos","events_url":"https://api.github.com/users/waneck/events{/privacy}","received_events_url":"https://api.github.com/users/waneck/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones/1","html_url":"https://github.com/HaxeFoundation/haxe/milestones/3.2","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones/1/labels","id":343008,"number":1,"title":"3.2","description":"","creator":{"login":"issuesbot","id":4543331,"avatar_url":"https://avatars.githubusercontent.com/u/4543331?v=3","gravatar_id":"","url":"https://api.github.com/users/issuesbot","html_url":"https://github.com/issuesbot","followers_url":"https://api.github.com/users/issuesbot/followers","following_url":"https://api.github.com/users/issuesbot/following{/other_user}","gists_url":"https://api.github.com/users/issuesbot/gists{/gist_id}","starred_url":"https://api.github.com/users/issuesbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issuesbot/subscriptions","organizations_url":"https://api.github.com/users/issuesbot/orgs","repos_url":"https://api.github.com/users/issuesbot/repos","events_url":"https://api.github.com/users/issuesbot/events{/privacy}","received_events_url":"https://api.github.com/users/issuesbot/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":572,"state":"closed","created_at":"2013-05-28T03:42:24Z","updated_at":"2016-07-18T06:49:27Z","due_on":"2015-03-21T23:00:00Z","closed_at":"2015-06-05T13:18:16Z"},"comments":34,"created_at":"2013-05-28T05:23:13Z","updated_at":"2016-09-30T07:25:23Z","closed_at":"2014-08-03T20:27:54Z","body":"<i>[Google Issue #1492 : https://code.google.com/p/haxe/issues/detail?id=1492]</i>\n <i>by heinz.ho...@googlemail.com, at 16/02/2013, 22:55:53</i>\nI think this would be a nice addition to...\n\n1. integrate global available functions into the haxe package structure\n2. Restructure already available Libraries without a lot of overhead\n3. overloading of constructors with static functions.\n4. Less code for writing externals\n5. get rid of the inline hack, which by the way doesn't work with overloads of different arity.\n6. No problem with special chars like &quot;$&quot;, you can use a valid name for it.\n\nProposal allow @ :native for functions and also introduce @ :nativeGlobal (or some shorter name) which could be used to call global available functions.\n\nExamples for Javascript:\n\n@ :native(&quot;gapi&quot;)\n<pre>extern class MyGPlusApi {\n\t@:nativeGlobal(&quot;gapi.plusone.go&quot;) public static function go ():Void;\n\t@:native(&quot;$whatever&quot;) public static function whatever ():Void;\n\t}\n</pre>\n</b>\n\n&quot;MyGPlusApi.go()&quot;       compiles to   &quot;gapi.plusone.go()&quot; \n&quot;MyGPlusApi.whatever()&quot; compiles to   &quot;gapi.$whatever&quot;\n\n<pre>extern class JQueryShortcut {\n\t@:overload(function (selector:String, ?context:JQuery):JQuery {})\n\t@:overload(function (selector:String, ?context:Element):JQuery {})\n\t@:nativeGlobal(&quot;$&quot;) public static function jq (element:Element):JQuery;\n\t// alternative\n\t// @:nativeGlobal(&quot;new JQuery&quot;) public static function jq (element:Element):JQuery;\n\t}\n</pre>\n</b>\nimport JQueryShortcut.jq;\n\njq(&quot;body&quot;, jq(&quot;#myId)) becomes $(&quot;body&quot;, $(&quot;#myId&quot;))\njq(&quot;body&quot;) becomes $(&quot;body&quot;)\n\nFor php externals you could write:\n\n@ :nativeGlobal(&quot;serialize&quot;) public static function serialize( v : Dynamic );\n@ :nativeGlobal(&quot;unserialize&quot;) public static function serialize( v : Dynamic );\n\ninstead of (no overloading possible for the following)\n\n<pre>public static function serialize( v : Dynamic ) : String {\n\treturn untyped __call__(&quot;serialize&quot;, v);\n\t}\n</pre>\n</b>\n\n<pre>public static function unserialize( s : String ) : Dynamic {\n\treturn untyped __call__(&quot;unserialize&quot;, s);\n\t}\n</pre>\n</b>\n\nI think that this would be a very useful addition.\n\nbest,\nh\n\n\n\n\n\n"},"comment":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/comments/250677925","html_url":"https://github.com/HaxeFoundation/haxe/issues/1492#issuecomment-250677925","issue_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/1492","id":250677925,"user":{"login":"gogoprog","id":1249453,"avatar_url":"https://avatars.githubusercontent.com/u/1249453?v=3","gravatar_id":"","url":"https://api.github.com/users/gogoprog","html_url":"https://github.com/gogoprog","followers_url":"https://api.github.com/users/gogoprog/followers","following_url":"https://api.github.com/users/gogoprog/following{/other_user}","gists_url":"https://api.github.com/users/gogoprog/gists{/gist_id}","starred_url":"https://api.github.com/users/gogoprog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gogoprog/subscriptions","organizations_url":"https://api.github.com/users/gogoprog/orgs","repos_url":"https://api.github.com/users/gogoprog/repos","events_url":"https://api.github.com/users/gogoprog/events{/privacy}","received_events_url":"https://api.github.com/users/gogoprog/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T07:25:23Z","updated_at":"2016-09-30T07:25:23Z","body":"Has @:nativeGlobal idea been dropped?\r\n"}}
{"actor":{"display_login":"gogoprog"}}