[OpenSCAD] DEPRECATED: Using ranges of the form [begin:end] with begin value greater than the end value is deprecated.
A. Craig West
acraigwest at gmail.com
Wed May 22 08:07:13 EDT 2019
I usually got this when I try to do a for loop over an empty list. I really
don't know why this case wasn't implemented properly in the first place, I
have to write every list iteration with a check for zero length first, when
that should just work...
On Wed, 22 May 2019, 07:46 adrianv, <avm4 at cornell.edu> wrote:
> Every so often I get this warning message.
> DEPRECATED: Using ranges of the form [begin:end] with begin value greater
> than the end value is deprecated.
> It means my code has a bug, because I *never* write [5:0] to mean [0:5]---I
> don't understand why anybody thought that was a good idea---so it means I'm
> potentially getting some non-empty list when I should be getting the empty
> list as a result.
> The fix is easy: rewrite [a:b] as [a:1:b]. And I guess I should try to get
> in the habit of never writing [a:b] and just always writing [a:1:b] to
> prevent this problem in the future. But I get no hint as to where in my
> code the problem is, which makes it kind of troublesome to track down. Is
> there any way to get more information?
> Sent from: http://forum.openscad.org/
> OpenSCAD mailing list
> Discuss at lists.openscad.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Discuss