Re: Fetch string from comment

Liste des GroupesRevenir à cl forth 
Sujet : Re: Fetch string from comment
De : sjack (at) *nospam* dontemail.me (sjack)
Groupes : comp.lang.forth
Date : 04. Mar 2025, 22:02:49
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vq7ppp$21q9f$1@dont-email.me>
References : 1 2
User-Agent : tin/2.6.4-20240224 ("Banff") (Linux/6.8.0-54-generic (x86_64))
minforth <minforth@gmx.net> wrote:

Buddha said, om is boundless wisdom.  ;-)
 
It's my favorite Forth word. When I type it, I become at peace.

For us poor novices, could you please share some Forth code
to show how you have implemented your novel nestable comments?

Having a nested comment is nothing new; Forthers been doing it
long back:
 : (
  ONE BEGIN
   INC@ CASE
       ZERO  OF DROP ZERO ENDOF
       ASC ( OF 1+        ENDOF
       ASC ) OF 1-        ENDOF
     ENDCASE
  DUP ONE < UNTIL
  DROP ; IMMEDIATE

What may be new is the idea that if one has it then fetch it
from the input buffer and use it for string operations.

: @( PARSE_AREA [COMPILE] ( PARSE_AREA 1- OM ;

: .( @( TYPE ;     \ print it

: S( @( SIB! ;     \ stores in ring buffer

Didn't bother to generalize the next two:

Compile single line of text
: ,(
 ONE BEGIN INC@ TUCK CASE
 ZERO  OF 2DROP EXIT ENDOF
 ASC ( OF 1+ ENDOF
 ASC ) OF 1- ENDOF
ENDCASE DUP WHILE SWAP C, REPEAT 2DROP ;

-- Compile multiple lines of text
: ,M(
  ONE BEGIN INC@ TUCK CASE
      ZERO  OF SWAP DROP \N SWAP CR REFILL 0= IF ABORT THEN ENDOF
      ASC ( OF 1+ ENDOF
      ASC ) OF 1- ENDOF
    ENDCASE DUP WHILE SWAP C, REPEAT 2DROP ;


Date Sujet#  Auteur
3 Mar 25 * Fetch string from comment28sjack
3 Mar 25 +* Re: Fetch string from comment2minforth
4 Mar 25 i`- Re: Fetch string from comment1sjack
4 Mar 25 +* Re: Fetch string from comment10dxf
4 Mar 25 i`* Re: Fetch string from comment9sjack
4 Mar 25 i `* Re: Fetch string from comment8dxf
5 Mar 25 i  +* Re: Fetch string from comment4mhx
5 Mar 25 i  i+- Re: Fetch string from comment1Anton Ertl
5 Mar 25 i  i`* Re: Fetch string from comment2dxf
6 Mar 25 i  i `- Re: Fetch string from comment1dxf
5 Mar 25 i  `* Re: Fetch string from comment3sjack
5 Mar 25 i   `* Re: Fetch string from comment2sjack
5 Mar 25 i    `- Re: Fetch string from comment1minforth
4 Mar 25 +* Re: Fetch string from comment13mhx
5 Mar 25 i`* Re: Fetch string from comment12Gerry Jackson
5 Mar 25 i `* Re: Fetch string from comment11Anton Ertl
5 Mar 25 i  +* Re: Fetch string from comment9mhx
5 Mar 25 i  i`* Re: Fetch string from comment8Anton Ertl
6 Mar 25 i  i `* Re: Fetch string from comment7mhx
6 Mar 25 i  i  `* Re: Fetch string from comment6Anton Ertl
7 Mar 25 i  i   +- Re: Fetch string from comment1mhx
7 Mar 25 i  i   `* Efficient implementation of Finite State Machines (FSM)4Gerry Jackson
9 Mar 25 i  i    `* Re: Efficient implementation of Finite State Machines (FSM)3Anton Ertl
10 Mar 25 i  i     +- Re: Efficient implementation of Finite State Machines (FSM)1Gerry Jackson
11 Mar 25 i  i     `- Re: Efficient implementation of Finite State Machines (FSM)1Anton Ertl
5 Mar 25 i  `- Re: Fetch string from comment1Gerry Jackson
4 Mar 25 +- Re: Fetch string from comment1sjack
7 Mar 25 `- Re: Fetch string from comment1sjack

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal