discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Useless warning....

RW
Rogier Wolff
Sat, Aug 8, 2020 6:23 AM

Hi,

My current(*)  design generates the following warning:

DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.

This doesn't help me find where this happens. (no line number)

(Ceterum autem censeo Carthaginem esse delendam)

I also want to say that I don't agree with this: Often the 0...0 case
means: one copy and 0...-1 means zero copies. Simple.

Say I want to make n fenceposts:

for (i=[0:n-1])
translate ([pitch*i,0,0]) onepost ();

That works, even for one fencepost.

But now the first fencepost needs to be a bit different:

onepost (first=true);
for (i=[1:n-1])
translate ([pitch*i,0,0]) onepost (first=false);

Now the one-fence-post case will trigger the warning. To prevent the
warning I need to special case the "regular posts" to the condition
that there ARE regular posts.

Roger. 

(*) I created the design a while ago, I'm mostly a "user" of the
design now. Last time I built some object-A this time I'm building
object-b and somewhere in there there this warning is triggered.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

Hi, My current(*) design generates the following warning: DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated. This doesn't help me find where this happens. (no line number) (Ceterum autem censeo Carthaginem esse delendam) I also want to say that I don't agree with this: Often the 0...0 case means: one copy and 0...-1 means zero copies. Simple. Say I want to make n fenceposts: for (i=[0:n-1]) translate ([pitch*i,0,0]) onepost (); That works, even for one fencepost. But now the first fencepost needs to be a bit different: onepost (first=true); for (i=[1:n-1]) translate ([pitch*i,0,0]) onepost (first=false); Now the one-fence-post case will trigger the warning. To prevent the warning I need to special case the "regular posts" to the condition that there ARE regular posts. Roger. (*) I created the design a while ago, I'm mostly a "user" of the design now. Last time I built some object-A this time I'm building object-b and somewhere in there there this warning is triggered. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** The plan was simple, like my brother-in-law Phil. But unlike Phil, this plan just might work.
NH
nop head
Sat, Aug 8, 2020 8:13 AM

Add a step size to get rid of the warming. E.g.  for (i=[1 : 1 : n-1])

On Sat, 8 Aug 2020 at 07:24, Rogier Wolff R.E.Wolff@bitwizard.nl wrote:

Hi,

My current(*)  design generates the following warning:

DEPRECATED: Using ranges of the form [begin:end] with begin value

greater than the end value is deprecated.

This doesn't help me find where this happens. (no line number)

(Ceterum autem censeo Carthaginem esse delendam)

I also want to say that I don't agree with this: Often the 0...0 case
means: one copy and 0...-1 means zero copies. Simple.

Say I want to make n fenceposts:

for (i=[0:n-1])
translate ([pitch*i,0,0]) onepost ();

That works, even for one fencepost.

But now the first fencepost needs to be a bit different:

onepost (first=true);
for (i=[1:n-1])
translate ([pitch*i,0,0]) onepost (first=false);

Now the one-fence-post case will trigger the warning. To prevent the
warning I need to special case the "regular posts" to the condition
that there ARE regular posts.

     Roger.

(*) I created the design a while ago, I'm mostly a "user" of the
design now. Last time I built some object-A this time I'm building
object-b and somewhere in there there this warning is triggered.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.


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

Add a step size to get rid of the warming. E.g. for (i=[1 : 1 : n-1]) On Sat, 8 Aug 2020 at 07:24, Rogier Wolff <R.E.Wolff@bitwizard.nl> wrote: > > Hi, > > My current(*) design generates the following warning: > > DEPRECATED: Using ranges of the form [begin:end] with begin value > greater than the end value is deprecated. > > This doesn't help me find where this happens. (no line number) > > (Ceterum autem censeo Carthaginem esse delendam) > > I also want to say that I don't agree with this: Often the 0...0 case > means: one copy and 0...-1 means zero copies. Simple. > > Say I want to make n fenceposts: > > for (i=[0:n-1]) > translate ([pitch*i,0,0]) onepost (); > > That works, even for one fencepost. > > But now the first fencepost needs to be a bit different: > > onepost (first=true); > for (i=[1:n-1]) > translate ([pitch*i,0,0]) onepost (first=false); > > Now the one-fence-post case will trigger the warning. To prevent the > warning I need to special case the "regular posts" to the condition > that there ARE regular posts. > > Roger. > > (*) I created the design a while ago, I'm mostly a "user" of the > design now. Last time I built some object-A this time I'm building > object-b and somewhere in there there this warning is triggered. > > -- > ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 > ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > The plan was simple, like my brother-in-law Phil. But unlike > Phil, this plan just might work. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
RW
Rogier Wolff
Sat, Aug 8, 2020 8:36 AM

On Sat, Aug 08, 2020 at 09:13:46AM +0100, nop head wrote:

Add a step size to get rid of the warming. E.g.  for (i=[1 : 1 : n-1])

OK! Thanks for the tip. Where in the code?

Actually, its relatively easy: The code is only 282 lines long.
And there are only three for loops:

240:  for (i=[0:nx-1]) {
241:    for (j=[0:ny-1]) {
257:  for (i=[0:180:180])

nx and ny are both "2" today.

Roger. 

P.S. I just tried adding the implicit :1 and it makes the whole thing
stop working. Without the :1 I get the 4 modules, with the added :1 I
get nothing.

Here is my code:

module m4 (nx=2, ny=2, model=0)
{
p=75;

for (i=[0:nx-1]) {  // this is line 240.
for (j=[0:ny-1]) {
translate ([ip,jp,0]) mymodule (model);
}
}
}
...

m4 (nx=2, ny=2, 0);

Note: The m4 module started out doing 2x2 or 4 modules as I'm
rendering/printing today, but since then I added the parameters but
have not changed the name.

On Sat, 8 Aug 2020 at 07:24, Rogier Wolff R.E.Wolff@bitwizard.nl wrote:

Hi,

My current(*)  design generates the following warning:

DEPRECATED: Using ranges of the form [begin:end] with begin value

greater than the end value is deprecated.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

On Sat, Aug 08, 2020 at 09:13:46AM +0100, nop head wrote: > Add a step size to get rid of the warming. E.g. for (i=[1 : 1 : n-1]) OK! Thanks for the tip. Where in the code? Actually, its relatively easy: The code is only 282 lines long. And there are only three for loops: 240: for (i=[0:nx-1]) { 241: for (j=[0:ny-1]) { 257: for (i=[0:180:180]) nx and ny are both "2" today. Roger. P.S. I just tried adding the implicit :1 and it makes the whole thing stop working. Without the :1 I get the 4 modules, with the added :1 I get nothing. Here is my code: module m4 (nx=2, ny=2, model=0) { p=75; for (i=[0:nx-1]) { // this is line 240. for (j=[0:ny-1]) { translate ([i*p,j*p,0]) mymodule (model); } } } ... m4 (nx=2, ny=2, 0); Note: The m4 module started out doing 2x2 or 4 modules as I'm rendering/printing today, but since then I added the parameters but have not changed the name. > On Sat, 8 Aug 2020 at 07:24, Rogier Wolff <R.E.Wolff@bitwizard.nl> wrote: > > > > > Hi, > > > > My current(*) design generates the following warning: > > > > DEPRECATED: Using ranges of the form [begin:end] with begin value > > greater than the end value is deprecated. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** The plan was simple, like my brother-in-law Phil. But unlike Phil, this plan just might work.
RW
Rogier Wolff
Sat, Aug 8, 2020 8:42 AM

On Sat, Aug 08, 2020 at 10:36:55AM +0200, Rogier Wolff wrote:

nx and ny are both "2" today.

Roger. 

P.S. I just tried adding the implicit :1 and it makes the whole thing
stop working. Without the :1 I get the 4 modules, with the added :1 I
get nothing.

I just implemented a "full program" that shows this problem.
Below is the code, no warning, not working, remove the :1 and
it does what I expect of it.

module mymodule (model)
{
cylinder (d=65,h=10);
}

module m4 (nx=2, ny=2, model=0)
{
p=75;

for (i=[0:1:nx-1]) {  // this is line 240.
for (j=[0:ny-1]) {
translate ([ip,jp,0]) mymodule (model);
}
}
}

m4 (nx=2, ny=2, 0);

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

On Sat, Aug 08, 2020 at 10:36:55AM +0200, Rogier Wolff wrote: > nx and ny are both "2" today. > > Roger. > > P.S. I just tried adding the implicit :1 and it makes the whole thing > stop working. Without the :1 I get the 4 modules, with the added :1 I > get nothing. I just implemented a "full program" that shows this problem. Below is the code, no warning, not working, remove the :1 and it does what I expect of it. module mymodule (model) { cylinder (d=65,h=10); } module m4 (nx=2, ny=2, model=0) { p=75; for (i=[0:1:nx-1]) { // this is line 240. for (j=[0:ny-1]) { translate ([i*p,j*p,0]) mymodule (model); } } } m4 (nx=2, ny=2, 0); -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** The plan was simple, like my brother-in-law Phil. But unlike Phil, this plan just might work.
NH
nop head
Sat, Aug 8, 2020 8:59 AM

Sorry, in your case nx is zero so it is looping from 0 to -1, so a negative
step would get rid of the warning.

I think you meant to set model to 0 but it is actually setting nx to zeo.

On Sat, 8 Aug 2020 at 09:43, Rogier Wolff R.E.Wolff@bitwizard.nl wrote:

On Sat, Aug 08, 2020 at 10:36:55AM +0200, Rogier Wolff wrote:

nx and ny are both "2" today.

   Roger.

P.S. I just tried adding the implicit :1 and it makes the whole thing
stop working. Without the :1 I get the 4 modules, with the added :1 I
get nothing.

I just implemented a "full program" that shows this problem.
Below is the code, no warning, not working, remove the :1 and
it does what I expect of it.

module mymodule (model)
{
cylinder (d=65,h=10);
}

module m4 (nx=2, ny=2, model=0)
{
p=75;

for (i=[0:1:nx-1]) {  // this is line 240.
for (j=[0:ny-1]) {
translate ([ip,jp,0]) mymodule (model);
}
}
}

m4 (nx=2, ny=2, 0);

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.


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

Sorry, in your case nx is zero so it is looping from 0 to -1, so a negative step would get rid of the warning. I think you meant to set model to 0 but it is actually setting nx to zeo. On Sat, 8 Aug 2020 at 09:43, Rogier Wolff <R.E.Wolff@bitwizard.nl> wrote: > On Sat, Aug 08, 2020 at 10:36:55AM +0200, Rogier Wolff wrote: > > nx and ny are both "2" today. > > > > Roger. > > > > P.S. I just tried adding the implicit :1 and it makes the whole thing > > stop working. Without the :1 I get the 4 modules, with the added :1 I > > get nothing. > > I just implemented a "full program" that shows this problem. > Below is the code, no warning, not working, remove the :1 and > it does what I expect of it. > > > module mymodule (model) > { > cylinder (d=65,h=10); > } > > module m4 (nx=2, ny=2, model=0) > { > p=75; > > for (i=[0:1:nx-1]) { // this is line 240. > for (j=[0:ny-1]) { > translate ([i*p,j*p,0]) mymodule (model); > } > } > } > > m4 (nx=2, ny=2, 0); > > > > -- > ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 > ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > The plan was simple, like my brother-in-law Phil. But unlike > Phil, this plan just might work. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
RW
Rogier Wolff
Sat, Aug 8, 2020 11:25 AM

On Sat, Aug 08, 2020 at 09:59:01AM +0100, nop head wrote:

Sorry, in your case nx is zero so it is looping from 0 to -1, so a negative
step would get rid of the warning.

I think you meant to set model to 0 but it is actually setting nx to zeo.

So me redundantly specifying the name of the first and second
parameter causes the third parameter (of the call) to overwrite the
just explicitly specified-by-name first parameter (of the called
module)?????? You're shitting me, right?

Now that's something what might warrant a warning if not a rewrite to
change that behaviour....

Roger.

module m4 (nx=2, ny=2, model=0)

...

m4 (nx=2, ny=2, 0);

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

On Sat, Aug 08, 2020 at 09:59:01AM +0100, nop head wrote: > Sorry, in your case nx is zero so it is looping from 0 to -1, so a negative > step would get rid of the warning. > > I think you meant to set model to 0 but it is actually setting nx to zeo. So me redundantly specifying the name of the first and second parameter causes the third parameter (of the call) to overwrite the just explicitly specified-by-name first parameter (of the called module)?????? You're shitting me, right? Now that's something what might warrant a warning if not a rewrite to change that behaviour.... Roger. > > module m4 (nx=2, ny=2, model=0) ... > > m4 (nx=2, ny=2, 0); -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** The plan was simple, like my brother-in-law Phil. But unlike Phil, this plan just might work.
NH
nop head
Sat, Aug 8, 2020 11:42 AM

Yes the first unnamed parameter is assigned to position 1 and so on. In
Python you get "SyntaxError: positional argument follows keyword argument"

On Sat, 8 Aug 2020 at 12:25, Rogier Wolff R.E.Wolff@bitwizard.nl wrote:

On Sat, Aug 08, 2020 at 09:59:01AM +0100, nop head wrote:

Sorry, in your case nx is zero so it is looping from 0 to -1, so a

negative

step would get rid of the warning.

I think you meant to set model to 0 but it is actually setting nx to zeo.

So me redundantly specifying the name of the first and second
parameter causes the third parameter (of the call) to overwrite the
just explicitly specified-by-name first parameter (of the called
module)?????? You're shitting me, right?

Now that's something what might warrant a warning if not a rewrite to
change that behaviour....

     Roger.

module m4 (nx=2, ny=2, model=0)

...

m4 (nx=2, ny=2, 0);

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.


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

Yes the first unnamed parameter is assigned to position 1 and so on. In Python you get "SyntaxError: positional argument follows keyword argument" On Sat, 8 Aug 2020 at 12:25, Rogier Wolff <R.E.Wolff@bitwizard.nl> wrote: > On Sat, Aug 08, 2020 at 09:59:01AM +0100, nop head wrote: > > Sorry, in your case nx is zero so it is looping from 0 to -1, so a > negative > > step would get rid of the warning. > > > > I think you meant to set model to 0 but it is actually setting nx to zeo. > > So me redundantly specifying the name of the first and second > parameter causes the third parameter (of the call) to overwrite the > just explicitly specified-by-name first parameter (of the called > module)?????? You're shitting me, right? > > Now that's something what might warrant a warning if not a rewrite to > change that behaviour.... > > Roger. > > > > module m4 (nx=2, ny=2, model=0) > ... > > > m4 (nx=2, ny=2, 0); > > -- > ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 > ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > The plan was simple, like my brother-in-law Phil. But unlike > Phil, this plan just might work. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
JB
Jordan Brown
Sun, Aug 9, 2020 3:20 AM

On 8/7/2020 11:23 PM, Rogier Wolff wrote:

DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.

This doesn't help me find where this happens. (no line number)

(Ceterum autem censeo Carthaginem esse delendam)

I also want to say that I don't agree with this: Often the 0...0 case
means: one copy and 0...-1 means zero copies. Simple.

That would be good.  But the historical behavior is that it just
reverses the two endpoints.  Pretty much everybody agrees that's not
desirable, hence the warning.

for (i=[3:1]) echo(i);

DEPRECATED: Using ranges of the form [begin:end] with begin value
greater than the end value is deprecated.

ECHO: 1

ECHO: 2

ECHO: 3

On 8/7/2020 11:23 PM, Rogier Wolff wrote: > DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated. > > This doesn't help me find where this happens. (no line number) > > (Ceterum autem censeo Carthaginem esse delendam) > > I also want to say that I don't agree with this: Often the 0...0 case > means: one copy and 0...-1 means zero copies. Simple. That would be good.  But the historical behavior is that it just reverses the two endpoints.  Pretty much everybody agrees that's not desirable, hence the warning. for (i=[3:1]) echo(i); DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated. ECHO: 1 ECHO: 2 ECHO: 3
O
OzAtMichael
Sun, Aug 9, 2020 6:39 AM

(test - pls ignore)


From: Discuss [mailto:discuss-bounces@lists.openscad.org] On Behalf Of Jordan Brown
Sent: Sun, 9 Aug 2020 13:20
To: OpenSCAD general discussion; Rogier Wolff
Subject: Re: [OpenSCAD] Useless warning....

On 8/7/2020 11:23 PM, Rogier Wolff wrote:

DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is
deprecated.

This doesn't help me find where this happens. (no line number)

(Ceterum autem censeo Carthaginem esse delendam)

I also want to say that I don't agree with this: Often the 0...0 case
means: one copy and 0...-1 means zero copies. Simple.

That would be good.  But the historical behavior is that it just reverses the two endpoints.
Pretty much everybody agrees that's not desirable, hence the warning.

for (i=[3:1]) echo(i);

DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is
deprecated.

ECHO: 1

ECHO: 2

ECHO: 3

--
This email has been checked for viruses by AVG.
https://www.avg.com

(test - pls ignore) _____ From: Discuss [mailto:discuss-bounces@lists.openscad.org] On Behalf Of Jordan Brown Sent: Sun, 9 Aug 2020 13:20 To: OpenSCAD general discussion; Rogier Wolff Subject: Re: [OpenSCAD] Useless warning.... On 8/7/2020 11:23 PM, Rogier Wolff wrote: DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated. This doesn't help me find where this happens. (no line number) (Ceterum autem censeo Carthaginem esse delendam) I also want to say that I don't agree with this: Often the 0...0 case means: one copy and 0...-1 means zero copies. Simple. That would be good. But the historical behavior is that it just reverses the two endpoints. Pretty much everybody agrees that's not desirable, hence the warning. for (i=[3:1]) echo(i); DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated. ECHO: 1 ECHO: 2 ECHO: 3 -- This email has been checked for viruses by AVG. https://www.avg.com
NH
nop head
Sun, Aug 9, 2020 7:08 AM

Yes, the new behaviour makes more sense as I can't remember a writing a
loop where I wanted to go in both directions. And now we don't need an if
to test for the empty case.

I.e.
if(n) for(i = [0 : n - 1]) ...

becomes

for(i = [0 : 1 : n - 1]) ...

and in Rogier's case the warning found another bug, because the loop was
actually running 0, -1 instead of 0, 1

On Sun, 9 Aug 2020 at 07:40, OzAtMichael oz.at.michael@gmail.com wrote:

(test - pls ignore)


From: Discuss [mailto:discuss-bounces@lists.openscad.org] *On Behalf Of
*Jordan Brown
Sent: Sun, 9 Aug 2020 13:20
To: OpenSCAD general discussion; Rogier Wolff
Subject: Re: [OpenSCAD] Useless warning....

On 8/7/2020 11:23 PM, Rogier Wolff wrote:

DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.

This doesn't help me find where this happens. (no line number)

(Ceterum autem censeo Carthaginem esse delendam)

I also want to say that I don't agree with this: Often the 0...0 case

means: one copy and 0...-1 means zero copies. Simple.

That would be good.  But the historical behavior is that it just reverses
the two endpoints.  Pretty much everybody agrees that's not desirable,
hence the warning.

for (i=[3:1]) echo(i);

DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.

ECHO: 1

ECHO: 2

ECHO: 3

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient
<#m_-8701791307388534068_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


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

Yes, the new behaviour makes more sense as I can't remember a writing a loop where I wanted to go in both directions. And now we don't need an if to test for the empty case. I.e. if(n) for(i = [0 : n - 1]) ... becomes for(i = [0 : 1 : n - 1]) ... and in Rogier's case the warning found another bug, because the loop was actually running 0, -1 instead of 0, 1 On Sun, 9 Aug 2020 at 07:40, OzAtMichael <oz.at.michael@gmail.com> wrote: > (test - pls ignore) > > > ------------------------------ > > *From:* Discuss [mailto:discuss-bounces@lists.openscad.org] *On Behalf Of > *Jordan Brown > *Sent:* Sun, 9 Aug 2020 13:20 > *To:* OpenSCAD general discussion; Rogier Wolff > *Subject:* Re: [OpenSCAD] Useless warning.... > > > > On 8/7/2020 11:23 PM, Rogier Wolff wrote: > > DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated. > > > > This doesn't help me find where this happens. (no line number) > > > > (Ceterum autem censeo Carthaginem esse delendam) > > > > I also want to say that I don't agree with this: Often the 0...0 case > > means: one copy and 0...-1 means zero copies. Simple. > > > That would be good. But the historical behavior is that it just reverses > the two endpoints. Pretty much everybody agrees that's not desirable, > hence the warning. > > for (i=[3:1]) echo(i); > > > > DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated. > > ECHO: 1 > > ECHO: 2 > > ECHO: 3 > > > > > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free. > www.avg.com > <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> > <#m_-8701791307388534068_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >