Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #15127

Re: Implementing ." in forth

From "Rod Pemberton" <do_not_have@notemailnot.cmm>
Newsgroups comp.lang.forth
Subject Re: Implementing ." in forth
Date 2012-08-23 19:37 -0400
Organization Aioe.org NNTP Server
Message-ID <k16emj$ca$1@speranza.aioe.org> (permalink)
References <k15dp4$kag$1@dont-email.me>

Show all headers | View raw


"Arnold Doray" <invalid@invalid.com> wrote in message
news:k15dp4$kag$1@dont-email.me...
> I am trying to write a small compatability harness for Mini (mini.terra-
> weather.com) and am stumbling over ." (Mini has built-in strings, and
> uses . instead of ." )
>
> Anyway, I see it needs:
>
> 1) a PARSE to run immediately (because ." may be used inside a word),
> 2) then it needs to compile the string as a literal if in compilation
> mode.
> 3) It needs to display the string, but not immediately.
>
> My problem is that there are some things that need to be done
> immediately, and others delayed. And there is a need to know if ." is
> being executed while in compilation mode.
>
> I am sure I am missing something. It surely can't be this complicated. I
> would greatly appreciate any help.
>

FYI, it's probably wrong somehow (i.e., STATE aware), but ...

I implemented ." as POSTPONEd S" followed by a STATE aware IF
to either TYPE or POSTPONE TYPE.

So, do you have S" implemented already?  You should.  In addition to ." it
can be used for C" too...


I implemented S" to do [CHAR] " WORD COUNT  (Is that PARSE ... ?), followed
by a STATE aware IF, i.e., STATE @ IF ... THEN.  This STATE aware IF is for
compiled strings.  It does two things: 1) POSTPONEs a word (S") and 2) has a
routine to CMOVE and ALLOT the string, i.e., compile it into the definition.
(S") get's the string's address using the interpreter's IP address from the
return stack, uses COUNT to get it's length, then and adjusts the
interpreter's IP address to skip over the stored string, instead of
interpreting it.


Rod Pemberton


Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Implementing ." in forth Arnold Doray <invalid@invalid.com> - 2012-08-23 14:12 +0000
  Re: Implementing ." in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-23 14:45 +0000
    Re: Implementing ." in forth Arnold Doray <invalid@invalid.com> - 2012-08-24 11:30 +0000
      Re: Implementing ." in forth Josh Grams <josh@qualdan.com> - 2012-08-24 12:56 +0000
      Re: Implementing ." in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-24 14:41 +0000
        Re: Implementing ." in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-24 16:45 +0000
        Re: Implementing ." in forth Arnold Doray <invalid@invalid.com> - 2012-08-25 03:41 +0000
          Re: Implementing ." in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-25 09:05 +0000
            Re: Implementing ." in forth Arnold Doray <invalid@invalid.com> - 2012-08-29 15:48 +0000
              Re: Implementing ." in forth Coos Haak <chforth@hccnet.nl> - 2012-08-29 21:19 +0200
              Re: Implementing ." in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-08-30 13:00 +0000
  Re: Implementing ." in forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-08-23 12:00 -0500
  Re: Implementing ." in forth Spam@ControlQ.com - 2012-08-23 14:16 -0400
  Re: Implementing ." in forth Mark Wills <markrobertwills@yahoo.co.uk> - 2012-08-23 14:37 -0700
  Re: Implementing ." in forth "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-08-23 19:37 -0400
  Re: Implementing ." in forth hughaguilar96@yahoo.com - 2012-08-24 00:06 -0700
    Re: Implementing ." in forth Arnold Doray <invalid@invalid.com> - 2012-08-24 11:32 +0000
      Re: Implementing ." in forth Doug Hoffman <glidedog@gmail.com> - 2012-08-24 08:33 -0400
  Re: Implementing ." in forth jim@rainbarrel.com - 2012-08-24 09:15 -0700
  Re: Implementing ." in forth Chris Hinsley <chris.hinsley@gmail.com> - 2012-08-25 15:15 +0100

csiph-web