Re: if statement not working
On Sat, 23 Mar 2002 10:43:18 -0800, kbochert at ix.netcom.com wrote:
>
>You wrote on 3/23/02 10:17:33 AM:
>
>>Pete
>>PS if Rob completely annihilates all index bounds checking, which I
>>doubt, then fine, I have the source so I can put it back!
>>
>
>Me too! But it would be nice to be able to respond to a bounds
>violation with something other than a fatal abort.
>
Agreed, ability to catch it would be a nice plus, ignoring it
wholesale not. However, not catched, it must give a fatal abort.
I liken this argument to swatting a fly with a howitzer.
It *IS* difficult telling the dumb computer what you really want:
firstnonspace=1
while x[firstnonspace]=' ' do firstnonspace+=1 end while
while 1 do
i = match({' ',9},x[firstnonspace..length(x)])
if i then
i+=firstnonspace-1
x=x[1..i-1]&x[i+1..length(x)]
end if
...
But that is *EXACT*; put a fudge factor in there & I'm really lost.
I'll second any motion for shorthand length(X) but I have yet to see
one which passes muster.
I'll accept, if s="123" then slice operands could make sense in the
bounds -3,-2,-1,0,1,2,3 (if agreed handling worked out),
*BUT NOT* s[37789456..-327] blithely returning {}. **NONSENSE**
Oh dear, and I tried so hard to stay clear of all this
Pete
PS. I've said before: code it & get it working in euphoria,
not wait for/beg Rob to do it in C/v2.4.
If not, why not?
|
Not Categorized, Please Help
|
|