{"action":"opened","issue":{"url":"https://api.github.com/repos/parallaxinc/OpenSpin/issues/37","repository_url":"https://api.github.com/repos/parallaxinc/OpenSpin","labels_url":"https://api.github.com/repos/parallaxinc/OpenSpin/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/parallaxinc/OpenSpin/issues/37/comments","events_url":"https://api.github.com/repos/parallaxinc/OpenSpin/issues/37/events","html_url":"https://github.com/parallaxinc/OpenSpin/issues/37","id":259695001,"number":37,"title":"#define vs Newton and Schroedinger and his cat (Milton)","user":{"login":"drawkula","id":9768622,"avatar_url":"https://avatars1.githubusercontent.com/u/9768622?v=4","gravatar_id":"","url":"https://api.github.com/users/drawkula","html_url":"https://github.com/drawkula","followers_url":"https://api.github.com/users/drawkula/followers","following_url":"https://api.github.com/users/drawkula/following{/other_user}","gists_url":"https://api.github.com/users/drawkula/gists{/gist_id}","starred_url":"https://api.github.com/users/drawkula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drawkula/subscriptions","organizations_url":"https://api.github.com/users/drawkula/orgs","repos_url":"https://api.github.com/users/drawkula/repos","events_url":"https://api.github.com/users/drawkula/events{/privacy}","received_events_url":"https://api.github.com/users/drawkula/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-22T03:46:16Z","updated_at":"2017-09-22T03:46:16Z","closed_at":null,"author_association":"NONE","body":"Newton has no cat (subobject):\r\n```\r\n$ cat Newton.spin \r\n#ifdef X\r\n#warning X defined\r\n#endif\r\n\r\n#ifndef X\r\n#warning X not defined\r\n#endif\r\n\r\npub Newton\r\n```\r\nCompiling without defining `X` looks ok:\r\n```\r\n$ /opt/openspin/bin/openspin Newton.spin \r\nPropeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.\r\nVersion 1.00.80 Compiled on Aug 15 2017 15:07:36\r\nCompiling...\r\nNewton.spin\r\nNewton.spin:6: warning: #warn:  X not defined\r\nDone.\r\nProgram size is 28 bytes\r\n```\r\nCompiling with `-D`(-efining) `X` and with and without `-a`(-lternative preprocesor) looks ok too...\r\n```\r\n$ /opt/openspin/bin/openspin -D X Newton.spin \r\nPropeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.\r\nVersion 1.00.80 Compiled on Aug 15 2017 15:07:36\r\nCompiling...\r\nNewton.spin\r\nNewton.spin:2: warning: #warn:  X defined\r\nDone.\r\nProgram size is 28 bytes\r\n$ /opt/openspin/bin/openspin -a -D X Newton.spin \r\nPropeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.\r\nVersion 1.00.80 Compiled on Aug 15 2017 15:07:36\r\nCompiling...\r\nNewton.spin\r\nNewton.spin:2: warning: #warn:  X defined\r\nDone.\r\nProgram size is 28 bytes\r\n```\r\nNow adding `-u`(-ncertainty):\r\n```\r\n$ /opt/openspin/bin/openspin -u -D X Newton.spin \r\nPropeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.\r\nVersion 1.00.80 Compiled on Aug 15 2017 15:07:36\r\nCompiling...\r\nNewton.spin\r\nNewton.spin:2: warning: #warn:  X defined\r\nNewton.spin:6: warning: #warn:  X not defined\r\nDone.\r\nUnused Method Elimination:\r\nNothing removed.\r\n--------------------------\r\nProgram size is 28 bytes\r\n$ /opt/openspin/bin/openspin -u -a -D X Newton.spin \r\nPropeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.\r\nVersion 1.00.80 Compiled on Aug 15 2017 15:07:36\r\nCompiling...\r\nNewton.spin\r\nNewton.spin:2: warning: #warn:  X defined\r\nNewton.spin:6: warning: #warn:  X not defined\r\nDone.\r\nUnused Method Elimination:\r\nNothing removed.\r\n--------------------------\r\nProgram size is 28 bytes\r\n```\r\n\r\nBut now for something not really completely different:\r\n\r\nSchroedinger has a cat (subobject):\r\n```\r\n$ cat Schroedinger.spin \r\n#ifdef X\r\n#warning X defined\r\n#endif\r\n\r\n#ifndef X\r\n#warning X not defined\r\n#endif\r\n\r\nobj\r\n\r\n  cat : \"Milton\"\r\n\r\npub Schroedinger\r\n$ cat Milton.spin \r\n#ifdef X\r\n#warning X defined\r\n#endif\r\n\r\n#ifndef X\r\n#warning X not defined\r\n#endif\r\n\r\npub Milton\r\n```\r\nCompiling without a define and without `-u`(-ncertainty):\r\n```\r\n$ /opt/openspin/bin/openspin Schroedinger.spin \r\nPropeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.\r\nVersion 1.00.80 Compiled on Aug 15 2017 15:07:36\r\nCompiling...\r\nSchroedinger.spin\r\nSchroedinger.spin:6: warning: #warn:  X not defined\r\n|-Milton.spin\r\nMilton.spin:6: warning: #warn:  X not defined\r\nSchroedinger.spin:6: warning: #warn:  X not defined\r\nDone.\r\nProgram size is 44 bytes\r\n```\r\nCompiling with defining `X` and not using `-u`(-ncertainty):\r\n```\r\n$ /opt/openspin/bin/openspin -D X Schroedinger.spin \r\nPropeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.\r\nVersion 1.00.80 Compiled on Aug 15 2017 15:07:36\r\nCompiling...\r\nSchroedinger.spin\r\nSchroedinger.spin:2: warning: #warn:  X defined\r\n|-Milton.spin\r\nMilton.spin:6: warning: #warn:  X not defined\r\nSchroedinger.spin:6: warning: #warn:  X not defined\r\nDone.\r\nProgram size is 44 bytes\r\n$ /opt/openspin/bin/openspin -a -D X Schroedinger.spin \r\nPropeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.\r\nVersion 1.00.80 Compiled on Aug 15 2017 15:07:36\r\nCompiling...\r\nSchroedinger.spin\r\nSchroedinger.spin:2: warning: #warn:  X defined\r\n|-Milton.spin\r\nMilton.spin:6: warning: #warn:  X not defined\r\nSchroedinger.spin:6: warning: #warn:  X not defined\r\nDone.\r\nProgram size is 44 bytes\r\n```\r\nThis is confusing enough, so adding `-u`(-ncertainty) is not needed to make my head spin...\r\n\r\nMeow!\r\n\r\nCan please someone explain this to me without using quantum physics?"}}
{"actor":{"display_login":"drawkula"}}