Subject: Re: quick way to find an ascii value

From: [email-masked] (Gustavo Glusman)
Date: Tue, 23 Nov 1993 09:27:03 -0800

Instead of:

>letter in {"a", "b", "c", ...}

Try:

index("abcdefg.......",letter)

Or:

index($string_utils.alphabet,letter)
index($string_utils.ascii,letter)

---

From: Judy Anderson <[email-masked]>
Date: Tue, 23 Nov 1993 09:48:10 -0800

Actually you need index($string_utils.ascii,letter,1) if you want to
distinguish lower from upper.  :peers at $string_utils.ascii.  Hm,
really you should add 32 to the result if you want the true ascii
value of a character.
						yduJ

---

From: [email-masked]
Date: Tue, 23 Nov 1993 12:44:18 -0800

Thanks, [1] is marginally faster.  It's 8 ticks, 0 seconds.
Instead of 8 ticks, 1 seconds for [2] and [3].

[1] index("abcdefg.......",letter)
[2] letter in {"a", "b", "c", ...}
[3] index($string_utils.ascii,letter)

But my point is that this should be one tick--it should be a builtin.
How would I patch the server to do that?

(It may well not be worth it.  I'm curious how to do it as much as anything.)

-- Amy

---

From: Pavel Curtis <[email-masked]>
Date: Wed, 24 Nov 1993 10:39:19 -0800

> Date:	Tue, 23 Nov 1993 09:48:10 -0800
> From:	Judy Anderson <[email-masked]>
> 

Actually, you want to add 31...  :-)

---

From: Pavel Curtis <[email-masked]>
Date: Wed, 24 Nov 1993 10:40:34 -0800

> Date:	Tue, 23 Nov 1993 12:44:18 -0800
> From:	[email-masked]
> 

Take a look at the code mentioning some other simple built-in function, like
`bf_index' or `bf_length' and do likewise.

	Pavel

---

From: Jay Carlson <[email-masked]>
Date: Wed, 24 Nov 1993 11:22:59 -0800

> Actually, you want to add 31...  :-)

[looking at $string_utils.ascii]: that's not riiiiiight, there's no
tab in there.

Sigh.  This is what we get for adding non-printables to the MOO
character set.  Anyway, note that the character set is no longer
contiguous in ASCII coding.

A while back, I was considering doing ISO Latin-1 MOO, but it kinda
got put on the back burner.  Client issues got thorny.

Jay Carlson
[email-masked]    [email-masked]

Flat text is just *never* what you want.   ---stephen p spackman