MOO-cows Mailing List Archive


Re: Dynamic variable typing?

> Actually, a "binary string" is better handled as a byte vector -- the
> current version of binary strings is a kluge (partially, I suspect,
> because the MOO server could not easily be adapted for new data types
> until 1.8.0beta1; I and Pavel had quite a brainstorming session to
> figure out how to do FLOAT's.)
> A byte vector is *not* a typed string (nor do I believe it is
> warranted to do this in MOO); it is a fundamentally different data
> type, which I believe it is warranted to add to the language.

This is the point of view that Coldmud and LPMOO take.  (Well, after a
lot of argument.)  In both systems strings are the building blocks for
text abstractions, and have important roles in the language itself.  I
think the distinction is important.

On the other hand, as at least two people have pointed out to me,
given frobs, you can wrap Pavel's quoted binary strings up without a
server-level datatype associated.  Really, the only two things you lose

1) O(1) index operations.  In order to find the 27th octet described
by a quoted string, you may have to examine a good number of characters.
Sure, you can do fancy stuff with index(target, "~"), but it's not
cheap at all.

2) Cheap storage.  Quoted strings are gonna eat up to three times the
storage of regular strings.  Depending on your application, this may
not hurt that much.

...well, and you get to write wrappers for all the functions that
could return binary strings and make them return your frob class
instead, but you knew that.

Jay Carlson

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


Home | Subject Index | Thread Index