filePro "eq" (was Re: Question about checks for min and max values)

Jay R. Ashworth jra at baylink.com
Thu Jul 28 14:36:13 PDT 2005


On Thu, Jul 28, 2005 at 10:32:20AM -0400, Kenneth Brody wrote:
> > We got off onto how eq behaves numerically, I believe, when you
> > mentioned 0.0 != 0.00.  The original topic that drew me (and, I think,
> > Mark) into the thread, was the behavior of eq with strings, and
> > specifically that strings are 'eq' if they match to the length of the
> > shorter variable.
> 
> Well, the start of the thread concerned an empty numeric field comparing
> equal to "0".  I don't recall when the strings topic got added.

I came in late.

> > *This* was the behavior which I asserted was counter to that of
> > equivalent operators (or functions, when that's necessary for
> > comparison) in other languages, some of which already existed when
> > filePro's design was being taken.
> 
> Yes, I know your stand on filePro's comparison on two strings of
> differing lengths.

:-)

> > As for "a number with [no] value", I much prefer the phrasing "a numeric
> > variable to which no value has been assigned".
> 
> But that's *not* the same thing.
> 
> "A numeric variable to which no value has been assigned" simply means
> "uninitialized".  Some programming languages will implicitly set such
> a variable to zero.  Others will leave the variable in an undetermined
> state.  Some will do both, depending on the variable.  (eg: in C, an
> uninitialized variable outside of a function will be initialized to
> zero, but an uninitialized non-static variable within a function will
> not be initialized to anything and will remain in an undetermined
> state until explicitly set.)  There is nothing you can to do an
> existing variable with a value to make it "no value has been assigned".

Well, I think in Perl you might be able to assing undef to a variable,
but maybe I'm wrong.

> "A number with no value" is one which has been set to a "no value"
> value.  For example, you can explicitly set a numeric variable in
> filePro to "".

Yes, but "" does not live within the set of "numbers".

So, effectively, you *are* assigning (filePro's syntax for) 'undef' to
that variable.

> Since this state (an empty numeric field) is what started this thread,
> and your argument (or was it Mark's) was that filePro was breaking all
> of these "long established rules" of mathematics and other programming
> languages, such a claim couldn't go unchallenged.  Since neither math
> nor these other languages have the concept of a numeric field with no
> value, how can filePro's logic break their rules?

I wasn't claiming that about that.  I was, at that point in the thread,
talking about strings.

> > How such a variable
> > should be expected to behave is, in fact, implementation-dependent, and
> > is the sole item I do *not* take issue with filePro on, here, oddly
> > enough: you can do anything you like with them.
> 
> Then I guess it was Mark's point that filePro broke all of those rules?
> 
> Hold on...
> 
> Wasn't it you who said in <20050726181534.L1248 at cgi.jachomes.com>:
> 
>    Alas, they defined "equals" to mean something other than what every
>    other programming language (as well as common mathematics) defines it
>    to mean, which is the sole point that Mark and I are debating.
> 
> and
> 
>    Nope.  But I'm not going to repeat myself.  How filepro's 'eq'
>    differs from the algebraic and string equals operator in other
>    languages is something I've explained about 5 times on this thread
>    so far.
> 
> Sounds like you disagree with numeric compares as well.

Honestly, by that deep in the thread, I may have slid off the curve.  :-)

Or I really did think you meant that 0.0 != 0.00, with which I would
have disagreed, as noted.

Cheers,
-- jra
-- 
Jay R. Ashworth                                                jra at baylink.com
Designer                          Baylink                             RFC 2100
Ashworth & Associates        The Things I Think                        '87 e24
St Petersburg FL USA      http://baylink.pitas.com             +1 727 647 1274

      "...the rough cannot be mean and the love cannot be true, and that's
      as wise as I can get at 10 o'clock in the morning."
      	-- Bill Shatner, on being an anti-hero.


More information about the Filepro-list mailing list