discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

This code used to work but doesn't now.

NH
nop head
Mon, Feb 11, 2019 10:20 PM

for(i = [0 : 3], $colour = ["royalblue", "springgreen", "red",
"yellow"][i], $value = ["120","330","500","120"][i]) echo($colour, $value);

This used to work, giving colours and three digit strings but now it does
this:

ECHO: "r", "1"

ECHO: "r", "2"

ECHO: "r", "0"

ECHO: "o", "1"

ECHO: "o", "2"

ECHO: "o", "0"

ECHO: "y", "1"

ECHO: "y", "2"

ECHO: "y", "0"

ECHO: "a", "1"

ECHO: "a", "2"

ECHO: "a", "0"

ECHO: "l", "1"

ECHO: "l", "2"

ECHO: "l", "0"

ECHO: "b", "1"

ECHO: "b", "2"

ECHO: "b", "0"

ECHO: "l", "1"

ECHO: "l", "2"

ECHO: "l", "0"

ECHO: "u", "1"

ECHO: "u", "2"

ECHO: "u", "0"

ECHO: "e", "1"

ECHO: "e", "2"

ECHO: "e", "0"

ECHO: "s", "3"

ECHO: "s", "3"

ECHO: "s", "0"

ECHO: "p", "3"

ECHO: "p", "3"

ECHO: "p", "0"

ECHO: "r", "3"

ECHO: "r", "3"

ECHO: "r", "0"

ECHO: "i", "3"

ECHO: "i", "3"

ECHO: "i", "0"

ECHO: "n", "3"

ECHO: "n", "3"

ECHO: "n", "0"

ECHO: "g", "3"

ECHO: "g", "3"

ECHO: "g", "0"

ECHO: "g", "3"

ECHO: "g", "3"

ECHO: "g", "0"

ECHO: "r", "3"

ECHO: "r", "3"

ECHO: "r", "0"

ECHO: "e", "3"

ECHO: "e", "3"

ECHO: "e", "0"

ECHO: "e", "3"

ECHO: "e", "3"

ECHO: "e", "0"

ECHO: "n", "3"

ECHO: "n", "3"

ECHO: "n", "0"

ECHO: "r", "5"

ECHO: "r", "0"

ECHO: "r", "0"

ECHO: "e", "5"

ECHO: "e", "0"

ECHO: "e", "0"

ECHO: "d", "5"

ECHO: "d", "0"

ECHO: "d", "0"

ECHO: "y", "1"

ECHO: "y", "2"

ECHO: "y", "0"

ECHO: "e", "1"

ECHO: "e", "2"

ECHO: "e", "0"

ECHO: "l", "1"

ECHO: "l", "2"

ECHO: "l", "0"

ECHO: "l", "1"

ECHO: "l", "2"

ECHO: "l", "0"

ECHO: "o", "1"

ECHO: "o", "2"

ECHO: "o", "0"

ECHO: "w", "1"

ECHO: "w", "2"

ECHO: "w", "0"

I fixed it by using let but what changed?

for(i = [0 : 3], $colour = ["royalblue", "springgreen", "red",
"yellow"][i], $value = ["120","330","500","120"][i]) echo($colour, $value);

ECHO: "royalblue", "120"

ECHO: "springgreen", "330"

ECHO: "red", "500"

ECHO: "yellow", "120"

for(i = [0 : 3], $colour = ["royalblue", "springgreen", "red", "yellow"][i], $value = ["120","330","500","120"][i]) echo($colour, $value); This used to work, giving colours and three digit strings but now it does this: ECHO: "r", "1" ECHO: "r", "2" ECHO: "r", "0" ECHO: "o", "1" ECHO: "o", "2" ECHO: "o", "0" ECHO: "y", "1" ECHO: "y", "2" ECHO: "y", "0" ECHO: "a", "1" ECHO: "a", "2" ECHO: "a", "0" ECHO: "l", "1" ECHO: "l", "2" ECHO: "l", "0" ECHO: "b", "1" ECHO: "b", "2" ECHO: "b", "0" ECHO: "l", "1" ECHO: "l", "2" ECHO: "l", "0" ECHO: "u", "1" ECHO: "u", "2" ECHO: "u", "0" ECHO: "e", "1" ECHO: "e", "2" ECHO: "e", "0" ECHO: "s", "3" ECHO: "s", "3" ECHO: "s", "0" ECHO: "p", "3" ECHO: "p", "3" ECHO: "p", "0" ECHO: "r", "3" ECHO: "r", "3" ECHO: "r", "0" ECHO: "i", "3" ECHO: "i", "3" ECHO: "i", "0" ECHO: "n", "3" ECHO: "n", "3" ECHO: "n", "0" ECHO: "g", "3" ECHO: "g", "3" ECHO: "g", "0" ECHO: "g", "3" ECHO: "g", "3" ECHO: "g", "0" ECHO: "r", "3" ECHO: "r", "3" ECHO: "r", "0" ECHO: "e", "3" ECHO: "e", "3" ECHO: "e", "0" ECHO: "e", "3" ECHO: "e", "3" ECHO: "e", "0" ECHO: "n", "3" ECHO: "n", "3" ECHO: "n", "0" ECHO: "r", "5" ECHO: "r", "0" ECHO: "r", "0" ECHO: "e", "5" ECHO: "e", "0" ECHO: "e", "0" ECHO: "d", "5" ECHO: "d", "0" ECHO: "d", "0" ECHO: "y", "1" ECHO: "y", "2" ECHO: "y", "0" ECHO: "e", "1" ECHO: "e", "2" ECHO: "e", "0" ECHO: "l", "1" ECHO: "l", "2" ECHO: "l", "0" ECHO: "l", "1" ECHO: "l", "2" ECHO: "l", "0" ECHO: "o", "1" ECHO: "o", "2" ECHO: "o", "0" ECHO: "w", "1" ECHO: "w", "2" ECHO: "w", "0" I fixed it by using let but what changed? for(i = [0 : 3], $colour = ["royalblue", "springgreen", "red", "yellow"][i], $value = ["120","330","500","120"][i]) echo($colour, $value); ECHO: "royalblue", "120" ECHO: "springgreen", "330" ECHO: "red", "500" ECHO: "yellow", "120"
TP
Torsten Paul
Mon, Feb 11, 2019 10:38 PM

On 11.02.19 23:20, nop head wrote:

I fixed it by using let but what changed?

That is due to https://github.com/openscad/openscad/pull/2509

ciao,
Torsten.

On 11.02.19 23:20, nop head wrote: > I fixed it by using let but what changed? That is due to https://github.com/openscad/openscad/pull/2509 ciao, Torsten.
P
Parkinbot
Mon, Feb 11, 2019 10:43 PM

looks like you need to write now:
for(i = [0 : 3], $colour = [["royalblue", "springgreen", "red",
"yellow"][i]], $value = [["120","330","500","120"][i]]) echo($colour,
$value);

--
Sent from: http://forum.openscad.org/

looks like you need to write now: for(i = [0 : 3], $colour = [["royalblue", "springgreen", "red", "yellow"][i]], $value = [["120","330","500","120"][i]]) echo($colour, $value); -- Sent from: http://forum.openscad.org/
NH
nop head
Mon, Feb 11, 2019 10:45 PM

I see. It is is becoming a full time job to keep my projects working with
OpenSCAD these days. Good job I am retired and have nothing better to do.

On Mon, 11 Feb 2019 at 22:39, Torsten Paul Torsten.Paul@gmx.de wrote:

On 11.02.19 23:20, nop head wrote:

I fixed it by using let but what changed?

I see. It is is becoming a full time job to keep my projects working with OpenSCAD these days. Good job I am retired and have nothing better to do. On Mon, 11 Feb 2019 at 22:39, Torsten Paul <Torsten.Paul@gmx.de> wrote: > On 11.02.19 23:20, nop head wrote: > > I fixed it by using let but what changed? > > That is due to https://github.com/openscad/openscad/pull/2509 > > ciao, > Torsten. > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
MK
Marius Kintel
Tue, Feb 12, 2019 2:21 AM

On Feb 11, 2019, at 17:45, nop head nop.head@gmail.com wrote:

I see. It is is becoming a full time job to keep my projects working with OpenSCAD these days. Good job I am retired and have nothing better to do.

Heh, we try really hard to maintain old behavior, but sometimes we decide that the intended use-case was too narrow.
I guess you're the one person with the largest OpenSCAD codebase out there. I'm sorry you have to suffer, but it's for the greater good :)

-Marius

> On Feb 11, 2019, at 17:45, nop head <nop.head@gmail.com> wrote: > > I see. It is is becoming a full time job to keep my projects working with OpenSCAD these days. Good job I am retired and have nothing better to do. > Heh, we try really hard to maintain old behavior, but sometimes we decide that the intended use-case was too narrow. I guess you're the one person with the largest OpenSCAD codebase out there. I'm sorry you have to suffer, but it's for the greater good :) -Marius
NH
nop head
Tue, Feb 12, 2019 8:53 AM

Yes that works around it but the cleanest solutions is with let. I.e.
for(i = [0 : 3])
let($colour = ["royalblue", "springgreen", "red", "yellow"][i], $value
= ["120","330","500","120"][i])
echo($colour, $value);

[image: image.png]

On Mon, 11 Feb 2019 at 22:46, Parkinbot rudolf@digitaldocument.de wrote:

looks like you need to write now:
for(i = [0 : 3], $colour = [["royalblue", "springgreen", "red",
"yellow"][i]], $value = [["120","330","500","120"][i]]) echo($colour,
$value);

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Yes that works around it but the cleanest solutions is with let. I.e. for(i = [0 : 3]) let($colour = ["royalblue", "springgreen", "red", "yellow"][i], $value = ["120","330","500","120"][i]) echo($colour, $value); [image: image.png] On Mon, 11 Feb 2019 at 22:46, Parkinbot <rudolf@digitaldocument.de> wrote: > looks like you need to write now: > for(i = [0 : 3], $colour = [["royalblue", "springgreen", "red", > "yellow"][i]], $value = [["120","330","500","120"][i]]) echo($colour, > $value); > > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
Øystein E. Krog
Tue, Feb 12, 2019 9:17 AM

I actually also ran in this problem, and I predict many others will in the
future.
I am not opposed to all these changes, but I do think it would be great if
there was a public list of such "breaking changes" with examples and
workarounds.
The changes required to silence all warnings in my project are significant,
but the majority of them are actual bugs in my code, so I'm really happy to
finally have a good way to detect and fix such bugs :)

On Tue, Feb 12, 2019 at 3:21 AM Marius Kintel marius@kintel.net wrote:

On Feb 11, 2019, at 17:45, nop head nop.head@gmail.com wrote:

I see. It is is becoming a full time job to keep my projects working

with OpenSCAD these days. Good job I am retired and have nothing better to
do.

Heh, we try really hard to maintain old behavior, but sometimes we decide
that the intended use-case was too narrow.
I guess you're the one person with the largest OpenSCAD codebase out
there. I'm sorry you have to suffer, but it's for the greater good :)

-Marius


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I actually also ran in this problem, and I predict many others will in the future. I am not opposed to all these changes, but I do think it would be great if there was a public list of such "breaking changes" with examples and workarounds. The changes required to silence all warnings in my project are significant, but the majority of them are actual bugs in my code, so I'm really happy to finally have a good way to detect and fix such bugs :) On Tue, Feb 12, 2019 at 3:21 AM Marius Kintel <marius@kintel.net> wrote: > > > On Feb 11, 2019, at 17:45, nop head <nop.head@gmail.com> wrote: > > > > I see. It is is becoming a full time job to keep my projects working > with OpenSCAD these days. Good job I am retired and have nothing better to > do. > > > Heh, we try really hard to maintain old behavior, but sometimes we decide > that the intended use-case was too narrow. > I guess you're the one person with the largest OpenSCAD codebase out > there. I'm sorry you have to suffer, but it's for the greater good :) > > -Marius > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
NH
nop head
Tue, Feb 12, 2019 9:33 AM

Yes when warnings first started to be added it found many bugs in my code,
nearly all of which were inconsequential but nevertheless mistakes. But
latterly I am fixing things I don't regard as bugs such as len(scalar) and
shapes with zero size. These were accepted practice and fixing the warnings
makes my code longer.

This change makes sense for consistency though.

On Tue, 12 Feb 2019 at 09:19, Øystein E. Krog oystein.krog@gmail.com
wrote:

I actually also ran in this problem, and I predict many others will in the
future.
I am not opposed to all these changes, but I do think it would be great if
there was a public list of such "breaking changes" with examples and
workarounds.
The changes required to silence all warnings in my project are
significant, but the majority of them are actual bugs in my code, so I'm
really happy to finally have a good way to detect and fix such bugs :)

On Tue, Feb 12, 2019 at 3:21 AM Marius Kintel marius@kintel.net wrote:

On Feb 11, 2019, at 17:45, nop head nop.head@gmail.com wrote:

I see. It is is becoming a full time job to keep my projects working

with OpenSCAD these days. Good job I am retired and have nothing better to
do.

Heh, we try really hard to maintain old behavior, but sometimes we decide
that the intended use-case was too narrow.
I guess you're the one person with the largest OpenSCAD codebase out
there. I'm sorry you have to suffer, but it's for the greater good :)

-Marius


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Yes when warnings first started to be added it found many bugs in my code, nearly all of which were inconsequential but nevertheless mistakes. But latterly I am fixing things I don't regard as bugs such as len(scalar) and shapes with zero size. These were accepted practice and fixing the warnings makes my code longer. This change makes sense for consistency though. On Tue, 12 Feb 2019 at 09:19, Øystein E. Krog <oystein.krog@gmail.com> wrote: > I actually also ran in this problem, and I predict many others will in the > future. > I am not opposed to all these changes, but I do think it would be great if > there was a public list of such "breaking changes" with examples and > workarounds. > The changes required to silence all warnings in my project are > significant, but the majority of them are actual bugs in my code, so I'm > really happy to finally have a good way to detect and fix such bugs :) > > On Tue, Feb 12, 2019 at 3:21 AM Marius Kintel <marius@kintel.net> wrote: > >> >> > On Feb 11, 2019, at 17:45, nop head <nop.head@gmail.com> wrote: >> > >> > I see. It is is becoming a full time job to keep my projects working >> with OpenSCAD these days. Good job I am retired and have nothing better to >> do. >> > >> Heh, we try really hard to maintain old behavior, but sometimes we decide >> that the intended use-case was too narrow. >> I guess you're the one person with the largest OpenSCAD codebase out >> there. I'm sorry you have to suffer, but it's for the greater good :) >> >> -Marius >> >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
MK
Marius Kintel
Tue, Feb 12, 2019 2:45 PM

On Feb 12, 2019, at 04:17, Øystein E. Krog oystein.krog@gmail.com wrote:

I am not opposed to all these changes, but I do think it would be great if there was a public list of such "breaking changes" with examples and workarounds.

Yes, we'll definitely add a "breaking changes" section to the release notes!

-Marius

> On Feb 12, 2019, at 04:17, Øystein E. Krog <oystein.krog@gmail.com> wrote: > > I am not opposed to all these changes, but I do think it would be great if there was a public list of such "breaking changes" with examples and workarounds. Yes, we'll definitely add a "breaking changes" section to the release notes! -Marius