1998Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: let's call it a spellcraft -->
<!--X-From-R13: "F. Oyrknaqre Bbcvry" <cbcvryNfahtuneobe.pbz> -->
<!--X-Date: Thu, 24 Sep 1998 08:15:38 &#45;0700 -->
<!--X-Message-Id: 199809241515.IAA02072#cashew,snugharbor.com.snugharbor.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199809240523.AAA14210@dfw&#45;ix10.ix.netcom.com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Re: let's call it a spellcraft</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:popiel#snugharbor,com">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg01191.html">Previous</a>
&nbsp;|&nbsp;<a href="msg01193.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg01212.html">Previous</a>
&nbsp;|&nbsp;<a href="msg01213.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#01192">Author</A>
&nbsp;|&nbsp;<A HREF="#01192">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#01192">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: let's call it a spellcraft</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] Re: let's call it a spellcraft </LI>
<LI><em>From</em>: "T. Alexander Popiel" &lt;<A HREF="mailto:popiel#snugharbor,com">popiel#snugharbor,com</A>&gt;</LI>
<LI><em>Date</em>: Thu, 24 Sep 1998 08:15:23 -0600</LI>
<LI><em>cc</em>: <A HREF="mailto:popiel#snugharbor,com">popiel#snugharbor,com</A></LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
In message:  &lt;<A HREF="msg01177.html">199809240523.AAA14210#dfw-ix10,ix.netcom.com</A>&gt;
             "Jon A. Lambert" &lt;jlsysinc#ix,netcom.com&gt; writes:
&gt;
&gt;I agree,  we should always attempt an implementation  in terms 0, 1 
&gt;and many(unknown/infinity/X).  There are exceptions and instances 
&gt;where we must pay homage at some level to the failings of our 
&gt;silicon, but these should be rare and abstracted if possible.   
&gt;
&gt;It begs the question, "Is the fixed dimensional array evil?"

I'd tend to say that no, fixed dimensional arrays are not evil,
if properly marked.  I submit these excerpts from the string
table code I mentioned a few posts ago as my defending argument:

/* This is a string table implemented as a red-black tree.
 *
 * There are a couple of peculiarities about this implementation:
 *
 * (1) Parent pointers are not stored.  Instead, insertion and
 *     deletion remember the search path used to get to the
 *     current point in the tree, and use that path to determine
 *     parents.
 *
 * (2) A usage count is kept on items in the tree; when items
 *     have 127 concurrent uses, they become permanent, and
 *     may never be fully deleted.
 *
 * (3) The red/black coloring is stored as the low order bit
 *     in the same byte as the usage count (which takes up
 *     the other 7 bits of that byte).
 *
 * (4) The data string is stored directly in the tree node,
 *     instead of hung in a pointer off the node.  This means
 *     that the nodes are of variable size.  What fun.
 *
 * (5) The strings are stored in the table _unaligned_.  If
 *     you try to use this for anything other than strings,
 *     expect alignment problems.
 */
/* This string table is _NOT_ reentrant.  If you try to use this
 * in a multithreaded environment, you will probably get burned.
 */

/* Various constants.  Their import is either bleedingly obvious
 * or explained below. */
#define ST_MAX_DEPTH 64

/* Here we have a global for the path info, just so we don't
 * eat tons of stack space.  (This code isn't reentrant no
 * matter where we put this, so might as well save stack.)
 * The fixed size of this array puts a limit on the maximum
 * size of the string table... but with ST_MAX_DEPTH == 64,
 * the tree can hold between 4 billion and 8 quintillion
 * strings.  I don't think capacity is a problem.
 */
static StrTree *path[ST_MAX_DEPTH];

- Alex


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="01213" HREF="msg01213.html">[MUD-Dev] Let's talk about numbers.</A></strong>
<ul compact><li><em>From:</em> "Jon A. Lambert" &lt;jlsysinc#ix,netcom.com&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="01177" HREF="msg01177.html">[MUD-Dev] Re: let's call it a spellcraft</A></STRONG>
<UL><LI><EM>From:</EM> "Jon A. Lambert" &lt;jlsysinc#ix,netcom.com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg01191.html">[MUD-Dev] Re: Marian's Tailor vs. Psychopaths</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg01193.html">[MUD-Dev] Re: META: What are you looking for in this list?</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg01212.html">[MUD-Dev] Let's talk about numbers.</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg01213.html">[MUD-Dev] Let's talk about numbers.</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#01192"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#01192"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>[MUD-Dev] Re: let's call it a spellcraft</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="01185" HREF="msg01185.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Thu 24 Sep 1998, 06:24 GMT
<UL>
<LI><strong><A NAME="01216" HREF="msg01216.html">[MUD-Dev] Let's talk about numbers.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 25 Sep 1998, 06:00 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="01186" HREF="msg01186.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
Marc Hernandez <a href="mailto:marc#jb,com">marc#jb,com</a>, Thu 24 Sep 1998, 06:41 GMT
<UL>
<LI><strong><A NAME="01212" HREF="msg01212.html">[MUD-Dev] Let's talk about numbers.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 25 Sep 1998, 05:59 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="01192" HREF="msg01192.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
T. Alexander Popiel <a href="mailto:popiel#snugharbor,com">popiel#snugharbor,com</a>, Thu 24 Sep 1998, 15:15 GMT
<UL>
<LI><strong><A NAME="01213" HREF="msg01213.html">[MUD-Dev] Let's talk about numbers.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 25 Sep 1998, 05:59 GMT
<UL>
<LI><strong><A NAME="01221" HREF="msg01221.html">[MUD-Dev] Re: Let's talk about numbers.</A></strong>, 
T. Alexander Popiel <a href="mailto:popiel#snugharbor,com">popiel#snugharbor,com</a>, Fri 25 Sep 1998, 15:03 GMT
<UL>
<LI><strong><A NAME="01232" HREF="msg01232.html">[MUD-Dev] Re: Let's talk about numbers.</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Fri 25 Sep 1998, 20:30 GMT
<UL>
<LI><strong><A NAME="01235" HREF="msg01235.html">[MUD-Dev] Re: Let's talk about numbers.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 25 Sep 1998, 22:36 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</ul>
</ul>
</ul>
</ul>
</ul>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>