{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/comments/223578768","pull_request_review_id":162738160,"id":223578768,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzU3ODc2OA==","diff_hunk":"@@ -286,22 +286,26 @@ end\n \"\"\"\n     macro_assign_and_return(code, variable, name;\n                             final_variable=variable,\n-                            register_fun::Union{Nothing, Function}=nothing,\n+                            register::Bool=false,\n                             model=nothing)\n \n Return runs `code` in a local scope which returns the value of `variable`\n and then assign `final_variable` to `name`.\n-If `register_fun` is given, `register_fun(model, name, variable)` is called.\n+If `register` is true is given, `register_object(model, name, variable)` is\n+called in the generated code.\n \"\"\"\n function macro_assign_and_return(code, variable, name;\n                                  final_variable=variable,\n-                                 register_fun::Union{Nothing, Function}=nothing,\n+                                 register::Bool=false,","path":"src/macros.jl","position":17,"original_position":17,"commit_id":"eae1d8b5320058ead1a350b398d2fa87e437cbf9","original_commit_id":"eae1d8b5320058ead1a350b398d2fa87e437cbf9","user":{"login":"blegat","id":1048205,"node_id":"MDQ6VXNlcjEwNDgyMDU=","avatar_url":"https://avatars3.githubusercontent.com/u/1048205?v=4","gravatar_id":"","url":"https://api.github.com/users/blegat","html_url":"https://github.com/blegat","followers_url":"https://api.github.com/users/blegat/followers","following_url":"https://api.github.com/users/blegat/following{/other_user}","gists_url":"https://api.github.com/users/blegat/gists{/gist_id}","starred_url":"https://api.github.com/users/blegat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blegat/subscriptions","organizations_url":"https://api.github.com/users/blegat/orgs","repos_url":"https://api.github.com/users/blegat/repos","events_url":"https://api.github.com/users/blegat/events{/privacy}","received_events_url":"https://api.github.com/users/blegat/received_events","type":"User","site_admin":false},"body":"Maybe we can remove the `register` boolean argument and branch on whether `model` is `nothing` or not ?\r\nThis function does not work if `register` is `true` and `model` is nothing anyway so it might be cleaner","created_at":"2018-10-09T06:56:17Z","updated_at":"2018-10-09T06:56:17Z","html_url":"https://github.com/JuliaOpt/JuMP.jl/pull/1533#discussion_r223578768","pull_request_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/1533","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/comments/223578768"},"html":{"href":"https://github.com/JuliaOpt/JuMP.jl/pull/1533#discussion_r223578768"},"pull_request":{"href":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/1533"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/1533","id":221292594,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxMjkyNTk0","html_url":"https://github.com/JuliaOpt/JuMP.jl/pull/1533","diff_url":"https://github.com/JuliaOpt/JuMP.jl/pull/1533.diff","patch_url":"https://github.com/JuliaOpt/JuMP.jl/pull/1533.patch","issue_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/1533","number":1533,"state":"open","locked":false,"title":"register expressions in the model scope","user":{"login":"mlubin","id":1733683,"node_id":"MDQ6VXNlcjE3MzM2ODM=","avatar_url":"https://avatars3.githubusercontent.com/u/1733683?v=4","gravatar_id":"","url":"https://api.github.com/users/mlubin","html_url":"https://github.com/mlubin","followers_url":"https://api.github.com/users/mlubin/followers","following_url":"https://api.github.com/users/mlubin/following{/other_user}","gists_url":"https://api.github.com/users/mlubin/gists{/gist_id}","starred_url":"https://api.github.com/users/mlubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlubin/subscriptions","organizations_url":"https://api.github.com/users/mlubin/orgs","repos_url":"https://api.github.com/users/mlubin/repos","events_url":"https://api.github.com/users/mlubin/events{/privacy}","received_events_url":"https://api.github.com/users/mlubin/received_events","type":"User","site_admin":false},"body":"Closes #1109","created_at":"2018-10-09T02:42:14Z","updated_at":"2018-10-09T06:56:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5080d6ac422588f1a5be8478bd558779389c5277","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/1533/commits","review_comments_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/1533/comments","review_comment_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/1533/comments","statuses_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/statuses/eae1d8b5320058ead1a350b398d2fa87e437cbf9","head":{"label":"JuliaOpt:ml/register","ref":"ml/register","sha":"eae1d8b5320058ead1a350b398d2fa87e437cbf9","user":{"login":"JuliaOpt","id":5667382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2NjczODI=","avatar_url":"https://avatars1.githubusercontent.com/u/5667382?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaOpt","html_url":"https://github.com/JuliaOpt","followers_url":"https://api.github.com/users/JuliaOpt/followers","following_url":"https://api.github.com/users/JuliaOpt/following{/other_user}","gists_url":"https://api.github.com/users/JuliaOpt/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaOpt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaOpt/subscriptions","organizations_url":"https://api.github.com/users/JuliaOpt/orgs","repos_url":"https://api.github.com/users/JuliaOpt/repos","events_url":"https://api.github.com/users/JuliaOpt/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaOpt/received_events","type":"Organization","site_admin":false},"repo":{"id":6150069,"node_id":"MDEwOlJlcG9zaXRvcnk2MTUwMDY5","name":"JuMP.jl","full_name":"JuliaOpt/JuMP.jl","private":false,"owner":{"login":"JuliaOpt","id":5667382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2NjczODI=","avatar_url":"https://avatars1.githubusercontent.com/u/5667382?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaOpt","html_url":"https://github.com/JuliaOpt","followers_url":"https://api.github.com/users/JuliaOpt/followers","following_url":"https://api.github.com/users/JuliaOpt/following{/other_user}","gists_url":"https://api.github.com/users/JuliaOpt/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaOpt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaOpt/subscriptions","organizations_url":"https://api.github.com/users/JuliaOpt/orgs","repos_url":"https://api.github.com/users/JuliaOpt/repos","events_url":"https://api.github.com/users/JuliaOpt/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaOpt/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/JuliaOpt/JuMP.jl","description":"Modeling language for Mathematical Optimization (linear, mixed-integer, conic, semidefinite, nonlinear)","fork":false,"url":"https://api.github.com/repos/JuliaOpt/JuMP.jl","forks_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/forks","keys_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/teams","hooks_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/events","assignees_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/tags","blobs_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/subscription","commits_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/merges","archive_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/downloads","issues_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/deployments","created_at":"2012-10-10T00:34:45Z","updated_at":"2018-10-08T13:30:33Z","pushed_at":"2018-10-09T02:42:15Z","git_url":"git://github.com/JuliaOpt/JuMP.jl.git","ssh_url":"git@github.com:JuliaOpt/JuMP.jl.git","clone_url":"https://github.com/JuliaOpt/JuMP.jl.git","svn_url":"https://github.com/JuliaOpt/JuMP.jl","homepage":"","size":11419,"stargazers_count":585,"watchers_count":585,"language":"Julia","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":149,"mirror_url":null,"archived":false,"open_issues_count":79,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":149,"open_issues":79,"watchers":585,"default_branch":"master"}},"base":{"label":"JuliaOpt:master","ref":"master","sha":"06a58d8d20d0002fadf1018cdc99f4874a88ef20","user":{"login":"JuliaOpt","id":5667382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2NjczODI=","avatar_url":"https://avatars1.githubusercontent.com/u/5667382?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaOpt","html_url":"https://github.com/JuliaOpt","followers_url":"https://api.github.com/users/JuliaOpt/followers","following_url":"https://api.github.com/users/JuliaOpt/following{/other_user}","gists_url":"https://api.github.com/users/JuliaOpt/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaOpt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaOpt/subscriptions","organizations_url":"https://api.github.com/users/JuliaOpt/orgs","repos_url":"https://api.github.com/users/JuliaOpt/repos","events_url":"https://api.github.com/users/JuliaOpt/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaOpt/received_events","type":"Organization","site_admin":false},"repo":{"id":6150069,"node_id":"MDEwOlJlcG9zaXRvcnk2MTUwMDY5","name":"JuMP.jl","full_name":"JuliaOpt/JuMP.jl","private":false,"owner":{"login":"JuliaOpt","id":5667382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2NjczODI=","avatar_url":"https://avatars1.githubusercontent.com/u/5667382?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaOpt","html_url":"https://github.com/JuliaOpt","followers_url":"https://api.github.com/users/JuliaOpt/followers","following_url":"https://api.github.com/users/JuliaOpt/following{/other_user}","gists_url":"https://api.github.com/users/JuliaOpt/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaOpt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaOpt/subscriptions","organizations_url":"https://api.github.com/users/JuliaOpt/orgs","repos_url":"https://api.github.com/users/JuliaOpt/repos","events_url":"https://api.github.com/users/JuliaOpt/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaOpt/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/JuliaOpt/JuMP.jl","description":"Modeling language for Mathematical Optimization (linear, mixed-integer, conic, semidefinite, nonlinear)","fork":false,"url":"https://api.github.com/repos/JuliaOpt/JuMP.jl","forks_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/forks","keys_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/teams","hooks_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/events","assignees_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/tags","blobs_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/subscription","commits_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/merges","archive_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/downloads","issues_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/deployments","created_at":"2012-10-10T00:34:45Z","updated_at":"2018-10-08T13:30:33Z","pushed_at":"2018-10-09T02:42:15Z","git_url":"git://github.com/JuliaOpt/JuMP.jl.git","ssh_url":"git@github.com:JuliaOpt/JuMP.jl.git","clone_url":"https://github.com/JuliaOpt/JuMP.jl.git","svn_url":"https://github.com/JuliaOpt/JuMP.jl","homepage":"","size":11419,"stargazers_count":585,"watchers_count":585,"language":"Julia","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":149,"mirror_url":null,"archived":false,"open_issues_count":79,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":149,"open_issues":79,"watchers":585,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/1533"},"html":{"href":"https://github.com/JuliaOpt/JuMP.jl/pull/1533"},"issue":{"href":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/1533"},"comments":{"href":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/1533/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/1533/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaOpt/JuMP.jl/pulls/1533/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaOpt/JuMP.jl/statuses/eae1d8b5320058ead1a350b398d2fa87e437cbf9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"blegat"}}