I'm producing some examples of the echo function.
I came across a funny scope thing.
> z=0;
> //i=3;
> j=4;
> k=5;
> i=3; // comment out & uncomment line 2
>
> i = echo(j=j,k=k) z; // set new value of i to z (ie 0)
> echo(i=i,j=j);
>
> o= 10 + echo(i=i) 5;
> echo(o=o); // 15
That works as expected.
If you invert the commented out lines it produces
> WARNING: Ignoring unknown variable 'j'.
> WARNING: Ignoring unknown variable 'k'.
> ECHO: j = undef, k = undef
> ECHO: i = 0
> ECHO: i = 0, j = 4
> ECHO: o = 15
I can understand the strange scoping behaviour if j or k was dependent on i,
buy i is the target of the assignment, I can't see why this happens.
Bug?
-----
Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it!
http://www.ourfairdeal.org/ time is running out!
--
Sent from:
http://forum.openscad.org/_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!