Re: [colorforth] Unused character encodings available in Colorforth
- Subject: Re: [colorforth] Unused character encodings available in Colorforth
- From: Mark Slicker <maslicke@xxxxxxxxxxx>
- Date: Sun, 22 Feb 2004 15:19:41 -0500 (EST)
On Sun, 22 Feb 2004, Bill Parker wrote:
> I'm an old-time Forther who just bumped into
> Colorforth about three months ago and think it is
> marvelous. One thing has me wondering about the
> Hoffman encoding scheme being used. Please excuse me
> if I am missing something basic or if this topic was
> already dealt with years ago.
>
> It seems like the 'space' encoding of 0 000 is only
> used to fill out the unused portion of packed words.
> If that is true, it seems like 'space' should be an
> inefficient 7 bit character rather than one of the
> premium 4 bit characters.
>
> The, newly freed, 0 000 encoding could then be used to
> introduce another octet of characters. The net gain
> would be seven characters because one of these eight
> new encodings would replace the character displaced
> when 'space' was moved.
>
> Probably the easiest example is to move 'space' to the
> encoding currently held by '?' (1111 111). The unused
> portion of the 28 bit field could therefore be padded
> with '1's (rather than '0's) to be recognized as
> unused. Then you could add a new octet something
> like:
>
> 0000 000 >
> 0000 001 <
> 0000 010 ~
> 0000 011 &
> 0000 100 |
> 0000 101 ^
> 0000 110 #
> 0000 111 ?
>
> The '?' still packs as a 7-bit character so there is
> no loss of efficiency from traditional Colorforth but
> you have now increased the character set from 48 to 55
> available elements. I don't believe this would affect
> run-time but there is some increased complexity at
> edit time to pack/unpack the new octet.
>
> Does this idea have any value or am I missing
> something basic?
I think assigning space to longer code might have value. However I would
still give it a code of zero since it makes it simple to detect the end of
the string. Maybe the prefix classes would be:
1
01
0000
0001
0010
0011
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com