{"action":"opened","issue":{"url":"https://api.github.com/repos/openscad/openscad/issues/1770","repository_url":"https://api.github.com/repos/openscad/openscad","labels_url":"https://api.github.com/repos/openscad/openscad/issues/1770/labels{/name}","comments_url":"https://api.github.com/repos/openscad/openscad/issues/1770/comments","events_url":"https://api.github.com/repos/openscad/openscad/issues/1770/events","html_url":"https://github.com/openscad/openscad/issues/1770","id":170810287,"number":1770,"title":"Assignment of Variables","user":{"login":"amarjeetkapoor1","id":13377588,"avatar_url":"https://avatars.githubusercontent.com/u/13377588?v=3","gravatar_id":"","url":"https://api.github.com/users/amarjeetkapoor1","html_url":"https://github.com/amarjeetkapoor1","followers_url":"https://api.github.com/users/amarjeetkapoor1/followers","following_url":"https://api.github.com/users/amarjeetkapoor1/following{/other_user}","gists_url":"https://api.github.com/users/amarjeetkapoor1/gists{/gist_id}","starred_url":"https://api.github.com/users/amarjeetkapoor1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amarjeetkapoor1/subscriptions","organizations_url":"https://api.github.com/users/amarjeetkapoor1/orgs","repos_url":"https://api.github.com/users/amarjeetkapoor1/repos","events_url":"https://api.github.com/users/amarjeetkapoor1/events{/privacy}","received_events_url":"https://api.github.com/users/amarjeetkapoor1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-12T06:57:38Z","updated_at":"2016-08-12T06:57:38Z","closed_at":null,"body":"OpenSCAD supports that we can re-assign the same variable with some different value anytime in SCAD file but It uses only the value that is assigned at last everywhere in rest of the file. So, What is use of supporting Re-Assignment of variable as its create confusion. \r\n\r\n```\r\na=12;\r\necho(a);\r\na=45;\r\n```\r\nAbove code should output 12 instead of 45.\r\nIt should be either that we use value of variable till it is Re-Assign or we should give error when variable is Re-Assigned.\r\n\r\nPlus there are several other abnormalities related to assignment like \r\n\r\n```\r\na=14;\r\nb=12;\r\na=b+12;\r\necho(a);\r\n```\r\nand\r\n```\r\na=14;\r\na=a+12;\r\necho(a);\r\n```\r\nboth are gives undef value.\r\n\r\nThere are also problem with storing location of assignment in ASTnode like:\r\n```\r\na=12;\r\na=14;\r\n```\r\nAs at present we support re-assignment. So, the value of `a` =14 for whole program. but location of ASTnode remains 1. It is not updated when `a` is re-assigned.\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"amarjeetkapoor1"}}