what -I- consider a bug in *cabe
Fairlight
fairlite at fairlite.com
Sun Jun 3 20:01:51 PDT 2007
The honourable and venerable Kenneth Brody spoke thus:
> strings. The "4" is not a numeric field, but rather a string that
> happens to contain a value number. How much checking should be
I would only counter to say that the only reason the 4 is not numeric
and is a string literal is because of fP's favouratism towards unquoted
numbers being interpreted as fields, not as actual numeric values. In
most languages, you would not be quoting the 4 there. That shouldn't work
correctly in C (which is strongly typed), although it would work in perl
because perl's so loosely typed--but it would not be -required- to be a
string literal, it would just compensate for the syntax and evaluate
correctly anyway.
The basic fact that a numeric value -must- be quoted as a string literal
is the only reason a stray "$" can slip in without kicking off an actual
syntax error. There's no way I can remember that mid(varname,$,2) would
be valid syntax in any language I've ever been exposed to; it'd either
be rejected for bad syntax in general, or because it began an unescaped
variable interpolation with an invalid variable-name-safe character of ","
right after the dollar sign.
The need to quote numeric values as string literals in fP is something I
highly dislike, and I'll just leave it at that. It's fP-centric, I realise
why it's there, I -still- dislike it, and any further comment from me on
the matter would not really accomplish anything. :)
I guess after that statement, I should clarify that my whole point is that
the argument against it being an "extra" check of a numeric-only string
really only holds water if you look at it from the PoV that having to quote
numerics as strings is "normal". In fact, it's very non-intuitive--perhaps
-the- most non-intuitive part of fP's language when you've coded in
pretty much anything else. I know it's the part that took the longest to
acclimatise to when I first started in fP. And array subscripts -still-
throw me for a loop. Lookup subscripts I know are unquoted. I'd actually
have to look up whether array subscripts are or aren't--I -think- they are,
but I can never remember whether they follow the "normal" numeric rule or
follow the lookup subscript syntax. It's one of those things I always have
to look up, possibly because I use arrays so rarely, as they're not dynamic
enough to be useful to me. I heard 5.6 included a REDIM command, but I'm
not sure how useful this would make them without looking at it in depth. I
don't have enough people on 5.6 that I've needed to look yet; depending on
something like REDIM or even nested CALLs is suicide for code portability.
Great new features, but unusable if you're writing generic code because you
can't mandate someone upgrade fP to 5.6. Therefore, next to useless
outside very customer-specific applications unless you control a whole
package and the version of the engine upon which it rides. Some developers
are in that position, but many of us that do tack-in work are not.
Which is another whole subject...oops.
mark->
--
No matter what your problems, modern medicine can help!
http://members.iglou.com/fairlite/fixital/
More information about the Filepro-list
mailing list