discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

boolean nits

J
jon
Mon, Jun 15, 2015 11:28 AM

if one attempts

if (x==1) or (x==2)

the compiler does not complain, but it does not do the obvious thing, either

if one attempts

if ((x==1) or (x==2))

one does get a compiler error message

if one attempts

if ((x==1) || (x==2))

it works.

I would advocate that the first syntax should generate an error message

Jon

if one attempts if (x==1) or (x==2) the compiler does not complain, but it does not do the obvious thing, either if one attempts if ((x==1) or (x==2)) one does get a compiler error message if one attempts if ((x==1) || (x==2)) it works. I would advocate that the first syntax should generate an error message Jon
NH
nop head
Mon, Jun 15, 2015 11:34 AM

The first one is valid syntax. It means if x is one call module "or"
passing x==2, i.e. false.

It gives WARNING: Ignoring unknown module 'or'. Unless you have a module
called or.

On 15 June 2015 at 12:28, jon jon@jonbondy.com wrote:

if one attempts

if (x==1) or (x==2)

the compiler does not complain, but it does not do the obvious thing,
either

if one attempts

if ((x==1) or (x==2))

one does get a compiler error message

if one attempts

if ((x==1) || (x==2))

it works.

I would advocate that the first syntax should generate an error message

Jon


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

The first one is valid syntax. It means if x is one call module "or" passing x==2, i.e. false. It gives WARNING: Ignoring unknown module 'or'. Unless you have a module called or. On 15 June 2015 at 12:28, jon <jon@jonbondy.com> wrote: > if one attempts > > if (x==1) or (x==2) > > the compiler does not complain, but it does not do the obvious thing, > either > > if one attempts > > if ((x==1) or (x==2)) > > one does get a compiler error message > > if one attempts > > if ((x==1) || (x==2)) > > it works. > > I would advocate that the first syntax should generate an error message > > Jon > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
J
jon
Mon, Jun 15, 2015 12:47 PM

Thank you

On 6/15/2015 7:34 AM, nop head wrote:

The first one is valid syntax. It means if x is one call module "or"
passing x==2, i.e. false.

It gives WARNING: Ignoring unknown module 'or'. Unless you have a
module called or.

On 15 June 2015 at 12:28, jon <jon@jonbondy.com
mailto:jon@jonbondy.com> wrote:

 if one attempts

 if (x==1) or (x==2)

 the compiler does not complain, but it does not do the obvious
 thing, either

 if one attempts

 if ((x==1) or (x==2))

 one does get a compiler error message

 if one attempts

 if ((x==1) || (x==2))

 it works.

 I would advocate that the first syntax should generate an error
 message

 Jon


 _______________________________________________
 OpenSCAD mailing list
 Discuss@lists.openscad.org <mailto: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

No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 2015.0.6030 / Virus Database: 4360/10017 - Release Date: 06/14/15

Thank you On 6/15/2015 7:34 AM, nop head wrote: > The first one is valid syntax. It means if x is one call module "or" > passing x==2, i.e. false. > > It gives WARNING: Ignoring unknown module 'or'. Unless you have a > module called or. > > > On 15 June 2015 at 12:28, jon <jon@jonbondy.com > <mailto:jon@jonbondy.com>> wrote: > > if one attempts > > if (x==1) or (x==2) > > the compiler does not complain, but it does not do the obvious > thing, either > > if one attempts > > if ((x==1) or (x==2)) > > one does get a compiler error message > > if one attempts > > if ((x==1) || (x==2)) > > it works. > > I would advocate that the first syntax should generate an error > message > > Jon > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org <mailto: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 > > > No virus found in this message. > Checked by AVG - www.avg.com <http://www.avg.com> > Version: 2015.0.6030 / Virus Database: 4360/10017 - Release Date: 06/14/15 >