Re: Evil type coercion
From: Russ Holsclaw (russ_at_holsclaw.nyet)
Date: 11/02/04
- Next message: Bob O`Bob: "Re: Evil type coercion"
- Previous message: Bob Butler: "Re: Evil type coercion"
- In reply to: Tony Proctor: "Re: Evil type coercion"
- Next in thread: Bob O`Bob: "Re: Evil type coercion"
- Reply: Bob O`Bob: "Re: Evil type coercion"
- Reply: Tony Proctor: "Re: Evil type coercion"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Nov 2004 12:01:19 -0700
> Try reading the original posts Russ, especially my reply to Bob!
>
> This code has to "fly blind" as it's servicing an evaluation stack, and
> has
> no intimate knowledge of what the original expression was trying to
> achieve.
>
> Your contribution doesn't help one iota as I believe everything in this
> thread *has* read the manual, many times
Sorry, but in your original post, nor in the replies, was there any mention
of the special rule concerning comparing strings and numerics contained in
variants. Instead there was speculation about the possiblility that some
sort of coerced conversion was done that converted the numeric to a string
with a leading space.
The help text I quoted points out that no coerced conversion is involved at
all, but that there is a simple rule that says that when variants
containing strings and numerics are compared, the numeric is ALWAYS
considered to be the lesser.
The "leading space/STR$()-like" theory wouldn't explain, for example why a
variant containing a zero-length string still comes out as > all numeric
types, regardless of sign or magnitude.
I think it's pretty obvious that none of you were aware of the rule I
quoted until I posted it, indignant denials notwithstanding. Even the
subject-line says that you considered it to be a type coercion, when
actually you were the unwitting victim of a rule in which no type coercion
is involved.
To be sure, your confusion is understandable. After all, the rule I found
doesn't make a lot of intuitive sense, and came as much of a surprise to me
as anyone else. Part of my surprise comes from the fact that Microsoft
actually spelled out the rules in such detail, rather than relying on
programmers to guess at them via trial-and-error, as they seem accustomed
to do these days.
Sorry to have tweaked your nose so tactlessly, but I still maintain that
your nose was tweakable on the basis of the discussion up to that point.
- Next message: Bob O`Bob: "Re: Evil type coercion"
- Previous message: Bob Butler: "Re: Evil type coercion"
- In reply to: Tony Proctor: "Re: Evil type coercion"
- Next in thread: Bob O`Bob: "Re: Evil type coercion"
- Reply: Bob O`Bob: "Re: Evil type coercion"
- Reply: Tony Proctor: "Re: Evil type coercion"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|