1. equal() and =
----- Original Message -----
From: "irv mullins" <guest at RapidEuphoria.com>
To: <EUforum at topica.com>
Sent: Thursday, June 03, 2004 3:41 PM
Subject: Re: Just say 'YES' to strings (or not?)
>
>
> posted by: irv mullins <irvm at ellijay.com>
>
<snip>
>
> Where it would 'cost' (in a negative sense) would be in the 75% savings
> when storing text. To be able to process roughly 4x as much data in memory
> would be a big plus to some people.
I Agree and like this
>
> Then it would also be possible to reduce the number of functions needed to
> output stuff, resulting in a shorter learning curve, fewer errors, simpler
> programming.
I don't see this being true. Enlighten me.
>
> We'd also be able to use the = sign in a logical manner for comparing
stringsm
> and ditch that stupid equal().
> When was the last time you wanted to compare two strings and get back a
> sequence of ones and zeros? Is there any reason you could not get that
> result by writing a simple loop, in the rare event you really needed it?
bmp = load_bitmap("my.bmp")
--errors not checked
pal = bmp[1]
bmp = bmp[2]
--Swap 8's with 128's
mask8 = (bmp = 8)
mask128 = (bmp = 128)
bmp -= mask8 *8 --0's the 8's
bmp -= mask128 * 128--0's the 128's
bmp += mask8 * 128 --adds the 128's where the 8's where
bmp += mask128 * 8 --adds the 8 where the 128's where
NO, that isn't used. but how about this one. Transparency.
Let's assume that 0 is the transparent color.
bg = background_area
bmp = transparency_bmp
mask = (bmp = 0)
mask *= bg
mask += bmp
display_image({0,0}, mask)
OR maybe this.
function find_all(sequence s, object x)
sequence result, mask
integer f
mask = (s = x)
result = {}
f = find(1, mask)
while (f) do
result &= f
mask[f] = 0
f = find(1, mask)
end while
return result
end function
data = "Contents of a 2 meg file"
answer = find_all(data, 0)
-- If anyone finds this function useful.
-- Simply state it here.
-- I want your votes as PROOF of argument to keep = as it is.
PS: I don't like equal() anymore than the next guy.
But, I'm one of those what was happy enough with compare()
unkmar
2. Re: equal() and =
Lucius Hilley wrote:
> > When was the last time you wanted to compare two strings and get back a
> > sequence of ones and zeros?
> ...
> bmp = load_bitmap("my.bmp")
Thus proving that people don't really read the prior posts in a thread.
-- David Cuny
3. Re: equal() and =
Sorry, but I'm not sure what that is suppose to me. If you mean that my
response is incorrect because he states STRINGS. Then I must ask. Did you
bother do continue reading to see where I supplied the find_all() function?
unkmar
----- Original Message -----
From: "David Cuny" <dcuny at LANSET.COM>
To: <EUforum at topica.com>
Sent: Wednesday, June 03, 2015 7:27 PM
Subject: Re: equal() and =
>
>
> Lucius Hilley wrote:
>
> > > When was the last time you wanted to compare two strings and get back
a
> > > sequence of ones and zeros?
> > ...
> > bmp = load_bitmap("my.bmp")
>
> Thus proving that people don't really read the prior posts in a thread.
>
> -- David Cuny
>