Re: An Observation
- From: "J Thomas" <jethomas5@xxxxxxxxx>
- Date: 19 Mar 2007 19:17:24 -0700
On Mar 19, 6:21 pm, John Doty <j...@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
J Thomas wrote:
The original issue was whether LSE64 could be implemented portably in
Standard Forth. It cannot, because of the sloppiness of the standard.
Why can't it? Maybe the result can't be completely portable because it
might depend on behaviors that aren't completely portable. But even in
that case there might be a version that's largely portable, and other
versions that work for other Forths. I haven't seen anything yet that
I'm sure says it's impossible.
How many Standard Forths have just one cell size? It's allowed, but I
suspect very few go that route.
Not impossible. All I need is to redefine all the words that use chars
to use cell-size chars. I'd probably start with ACCEPT and READ-LINE
and have them put characters into cells with ! . Redefine CHARS and
CHAR+ . Redefine MOVE and FILL and ERASE . COUNT . FIND . I might have
a 32-byte buffer to pack with byte-size chars for FIND since otherwise
I'd be mucking around with things I can't do in standard Forth that
would be specific to particular systems.
It looks like a significant amount of work.
<# # #S #> HOLD SIGN ' ( ." : >NUMBER ABORT"ACCEPT C! C, C@ CHAR CHAR+
CHARS CONSTANT COUNT CREATE ENVIRONMENT? EVALUATE FILL FIND HOLD MOVE
POSTPONE S" SOURCE TYPE VARIABLE WORD ['] [CHAR]
Fix those and I'd have the core wordset handled. It might take fewer
because some of them are parsing words, for each dictionary word I
have to compact the strings since I can't rewrite them from scratch
short of setting up an entirely new dictionary structure. If I compact
a line at a time anyway, that's handled for those words.
So with COMPACT-STRING I get ' ( ." : ABORT" CHAR CONSTANT CREATE
EVALUATE POSTPONE S" VARIABLE WORD ['] [CHAR] all for free.
That leaves
<# # #S #> HOLD SIGN >NUMBER ACCEPT C! C, C@ CHAR+ CHARS COUNT
ENVIRONMENT? FILL FIND MOVE SOURCE TYPE
COMPACT-STRING also gives me a simple way to do >NUMBER ENVIRONMENT?
FIND TYPE . Just compact the string into a private buffer and do the
command against that buffer.
EXPAND-STRING can be used with #> to give <# # #S HOLD SIGN for free.
ACCEPT turns easy.
C! C, C@ CHAR+ CHARS COUNT FILL MOVE SOURCE are left. I seen no big
difficulty, it just looks like work.
It would be possible to redefine all the character-oriented words to
use cell-size characters, starting with any standard Forth. There
would be more work since the other wordsets would have things to
change too. I don't see any gotchas here, only some tedious coding.
.
- Follow-Ups:
- Re: An Observation
- From: Bruce McFarling
- Re: An Observation
- References:
- Re: An Observation
- From: John Doty
- Re: An Observation
- From: Stephen J. Bevan
- Re: An Observation
- From: John Doty
- Re: An Observation
- From: Stephen J. Bevan
- Re: An Observation
- From: J Thomas
- Re: An Observation
- From: John Doty
- Re: An Observation
- From: J Thomas
- Re: An Observation
- From: John Doty
- Re: An Observation
- From: J Thomas
- Re: An Observation
- From: John Doty
- Re: An Observation
- From: Elizabeth D Rather
- Re: An Observation
- From: John Doty
- Re: An Observation
- From: Elizabeth D Rather
- Re: An Observation
- From: John Doty
- Re: An Observation
- From: Elizabeth D Rather
- Re: An Observation
- From: John Doty
- Re: An Observation
- From: J Thomas
- Re: An Observation
- From: John Doty
- Re: An Observation
- Prev by Date: Re: Rules for factoring definitions??
- Next by Date: Re: An Observation
- Previous by thread: Re: An Observation
- Next by thread: Re: An Observation
- Index(es):
Relevant Pages
|