{"action":"created","issue":{"url":"https://api.github.com/repos/less/less.js/issues/2072","labels_url":"https://api.github.com/repos/less/less.js/issues/2072/labels{/name}","comments_url":"https://api.github.com/repos/less/less.js/issues/2072/comments","events_url":"https://api.github.com/repos/less/less.js/issues/2072/events","html_url":"https://github.com/less/less.js/issues/2072","id":36464451,"number":2072,"title":"Allow variable redefinition inside guarded self running blocks","user":{"login":"lukeapage","id":309321,"avatar_url":"https://avatars.githubusercontent.com/u/309321?v=3","gravatar_id":"","url":"https://api.github.com/users/lukeapage","html_url":"https://github.com/lukeapage","followers_url":"https://api.github.com/users/lukeapage/followers","following_url":"https://api.github.com/users/lukeapage/following{/other_user}","gists_url":"https://api.github.com/users/lukeapage/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeapage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeapage/subscriptions","organizations_url":"https://api.github.com/users/lukeapage/orgs","repos_url":"https://api.github.com/users/lukeapage/repos","events_url":"https://api.github.com/users/lukeapage/events{/privacy}","received_events_url":"https://api.github.com/users/lukeapage/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/less/less.js/labels/Feature%20Request","name":"Feature Request","color":"fe9400"},{"url":"https://api.github.com/repos/less/less.js/labels/Low%20Priority","name":"Low Priority","color":"02e10c"},{"url":"https://api.github.com/repos/less/less.js/labels/Medium%20Priority","name":"Medium Priority","color":"0000E0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2014-06-25T09:56:08Z","updated_at":"2015-04-10T17:30:56Z","closed_at":null,"body":"```\r\n.a {\r\n @b: a;\r\n & when (@b = a) {\r\n   @a: 10px;\r\n }\r\n b: @a;\r\n}\r\n```\r\n\r\nIn this case you get a syntax error from less. I propose it should work.\r\n\r\n```\r\n.a {\r\n @b: a;\r\n @a: 2px;\r\n & when (@b = a) {\r\n   @a: 10px;\r\n }\r\n b: @a;\r\n}\r\n```\r\n\r\nthis case I am not sure about.\r\n\r\n```\r\n.a {\r\n @b: a;\r\n &.a when (@b = a) {\r\n   @a: 5px;\r\n }\r\n b: @a;\r\n}\r\n```\r\n\r\nthis should stay as an error.\r\n\r\n@seven-phases-max and @SomMeri what do you think?\r\n\r\nI was trying to make code that redefined a couple of variables based on an option.\r\n\r\nI guess the other way of doing it would be this\r\n\r\n```\r\n.a(@b) when (@b = true) {\r\n   .a(12px);\r\n}\r\n.a(@b) when (@b = false) {\r\n   .a(5px);\r\n}\r\n.a(@a) when (default() = true) {\r\n b: @a;\r\n}\r\n```\r\nand maybe thats just clearer?"},"comment":{"url":"https://api.github.com/repos/less/less.js/issues/comments/91628936","html_url":"https://github.com/less/less.js/issues/2072#issuecomment-91628936","issue_url":"https://api.github.com/repos/less/less.js/issues/2072","id":91628936,"user":{"login":"seven-phases-max","id":5304376,"avatar_url":"https://avatars.githubusercontent.com/u/5304376?v=3","gravatar_id":"","url":"https://api.github.com/users/seven-phases-max","html_url":"https://github.com/seven-phases-max","followers_url":"https://api.github.com/users/seven-phases-max/followers","following_url":"https://api.github.com/users/seven-phases-max/following{/other_user}","gists_url":"https://api.github.com/users/seven-phases-max/gists{/gist_id}","starred_url":"https://api.github.com/users/seven-phases-max/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seven-phases-max/subscriptions","organizations_url":"https://api.github.com/users/seven-phases-max/orgs","repos_url":"https://api.github.com/users/seven-phases-max/repos","events_url":"https://api.github.com/users/seven-phases-max/events{/privacy}","received_events_url":"https://api.github.com/users/seven-phases-max/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T17:30:55Z","updated_at":"2015-04-10T17:30:55Z","body":"All right. Excel, filemaker, maridb, wolfram - I'll buy it, won't argue anymore...  "}}