1. RE: boolean error?

> -----Original Message-----
> From: Kat [mailto:gertie at PELL.NET]

> This has me puzzled, i see no reason in this:
> 
> >From ex.err:
> n = {0}
> 
> so why doesn't this line execute?
> if equal(n,"0") or equal(n,0) then

Because they're not equal.  Your line is equivalent to:

if equal(n,{48}) or equal(n,0) then

Perhaps change it to:

if equal(n,"0") or equal(n,0) or equal(n,{0}) then

or...

if find(n, { "0", 0, {0} } ) then

Matt Lewis

new topic     » topic index » view message » categorize

2. RE: boolean error?

On 5 Aug 2002, at 9:20, Matthew Lewis wrote:

> 
> > -----Original Message-----
> > From: Kat [mailto:gertie at PELL.NET]
> 
> > This has me puzzled, i see no reason in this:
> > 
> > >From ex.err:
> > n = {0}
> > 
> > so why doesn't this line execute?
> > if equal(n,"0") or equal(n,0) then
> 
> Because they're not equal.  Your line is equivalent to:
> 
> if equal(n,{48}) or equal(n,0) then

Yes, so? n = {0}, meaning {48}, no?

> Perhaps change it to:
> 
> if equal(n,"0") or equal(n,0) or equal(n,{0}) then
> 
> or...
> 
> if find(n, { "0", 0, {0} } ) then

I did all those, but settled on:

if sequence(n) and (length(n) =1) then
 n= n[1] -- convert to atom
end if
if equal(n,0) then

Kat

new topic     » goto parent     » topic index » view message » categorize

3. RE: boolean error?

----- Original Message -----
From: Kat <gertie at PELL.NET>
Subject: RE: boolean error?


>
> On 5 Aug 2002, at 9:20, Matthew Lewis wrote:
>
> >
> > > -----Original Message-----
> > > From: Kat [mailto:gertie at PELL.NET]
> >
> > > This has me puzzled, i see no reason in this:
> > >
> > > >From ex.err:
> > > n = {0}
> > >
> > > so why doesn't this line execute?
> > > if equal(n,"0") or equal(n,0) then
> >
> > Because they're not equal.  Your line is equivalent to:
> >
> > if equal(n,{48}) or equal(n,0) then
>
> Yes, so? n = {0}, meaning {48}, no?
>
No. n = {'0'} means {48}, because '0' is 48, and "0" is also {48}. {0} is,
of course, {0}. {"0"} is {{48}}.
> > Perhaps change it to:
> >
> > if equal(n,"0") or equal(n,0) or equal(n,{0}) then
> >
> > or...
> >
> > if find(n, { "0", 0, {0} } ) then
>
> I did all those, but settled on:
>
> if sequence(n) and (length(n) =1) then
>  n= n[1] -- convert to atom
> end if
> if equal(n,0) then
>
> Kat
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu