• toad (figforth) ipc demo

    From sjack@sjack@dontemail.me (sjack) to comp.lang.forth on Sat Dec 20 18:37:13 2025
    From Newsgroup: comp.lang.forth

    mc:) cat /tmp/foo
    :) toad -q go

    XYZZY WORK TOAD FORTH Working disk
    fload f/ipc.f OK
    "ipc" /demo
    ..
    CURRENT and CONTEXT are WRK PREVOC is WRK BASE: 10
    Latest: DEMOJOB HERE : 134591928 UNUSED : 12952
    S?: empty
    ---

    Demo IPC

    [r] Support

    \ : IPC_PRINT 3 hi( CR I. TYPE ) ;
    : IPC_PUSH_GSTRING SS .G@ ;
    : IPC_PUT_MM '= SPLIT MMV .PUT ;

    IPC_PRINT is a default action already defined in the
    IPC vocabulary. The two above actions are intentionally
    defined in the current WRK vocabulary to be disposed of
    when new jobs are run; IPC_PRINT remains with the IPC
    vocabulary.


    [r] Start IPC

    FCB1
    FCB .H @ 0= [IF]
    "IPC0" IPC .OPEN
    [THEN]

    IPC
    ' IPC_PRINT .IS_ACTION
    .SND echo IPC channel up and running
    .GET
    IPC channel up and running


    [r] Fetch directory from system

    s( (ls -BC|tr "\t" " ") ) ./TRX
    app d f h job Makefile README s_old u
    b demo fb IPC0 lib pad s t vault


    [r] Push IPC lines to string stack

    SS .CLEAR
    IPC ' IPC_PUSH_GSTRING .IS_ACTION
    s( (grep -i brown /etc/X11/rgb.txt|tr "\t" " ") ) ./TRX
    SS .?
    0: 139 35 35 brown4
    1: 205 51 51 brown3
    2: 238 59 59 brown2
    3: 255 64 64 brown1
    4: 139 105 105 RosyBrown4
    5: 205 155 155 RosyBrown3
    6: 238 180 180 RosyBrown2
    7: 255 193 193 RosyBrown1
    8: 165 42 42 brown
    9: 244 164 96 SandyBrown
    10: 244 164 96 sandy brown
    11: 139 69 19 SaddleBrown
    12: 139 69 19 saddle brown
    13: 188 143 143 RosyBrown
    14: 188 143 143 rosy brown

    i. .P@ TELL --> 139 35 35 brown4
    i. .S1 TELL --> 205 51 51 brown3
    i. .S2 TELL --> 238 59 59 brown2
    i. 3 .SN TELL --> 255 64 64 brown1


    [r] Put IPC lines in local macro map

    IPC ' IPC_PUT_MM .IS_ACTION
    OP SMPAD '( +C
    "grep -i brown /etc/X11/rgb.txt" +S
    "|sed -e 's/\(^.*\)\(\t\)\([[:alnum:]].*$\)/\3=\1/' " +S
    "-e 's/\([[:alnum:]]\) \([[:alnum:]]\)/\1_\2/'" +S
    '|tr "\t" " "' +S
    ') +C
    OP SM MPAD C!
    --
    -- === FYI
    i. MPAD COUNT d2. --> 138359809 140
    i. CR MPAD TELL -->
    (grep -i brown /etc/X11/rgb.txt|sed -e 's/\(^.*\)\(\t\)\([[:alnum:]].*$\) /\3=\1/' -e 's/\([[:alnum:]]\) \([[:alnum:]]\)/\1_\2/'|tr "\t" " ")
    -- ===
    --
    MMV .CLEAR
    MPAD DUP COUNT + MPADV .SET \ fence string
    IPC ./TRX
    MM?
    brown4=139 35 35
    brown3=205 51 51
    brown2=238 59 59
    brown1=255 64 64
    RosyBrown4=139_105 105
    RosyBrown3=205_155 155
    RosyBrown2=238_180 180
    RosyBrown1=255_193 193
    brown=165 42 42
    SandyBrown=244_164 96
    sandy_brown=244 164 96
    SaddleBrown=139 69 19
    saddle_brown=139 69 19
    RosyBrown=188_143 143
    rosy_brown=188 143 143

    i. mm sandy_brown swap rot . . . --> 244 164 96

    -fin-
    Vocabulary list:
    134589928 SS
    134589212 IPC
    134588044 FCB
    134574756 RTC
    134573048 VOC_SET
    134569532 SCRKEY
    134568500 DIRV
    134565184 DECOMP
    134557796 MPADV
    134557092 FILES
    134555596 MMV
    134552668 FIO
    134539232 WRK
    134539204 OP
    134539176 COMMON
    134539120 TOAD
    134537440 SYSTEM
    134534812 BUFS
    134533884 BUF
    134529728 EDITOR
    134521100 FORTH OK
    --
    me
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Sun Dec 21 13:13:51 2025
    From Newsgroup: comp.lang.forth

    In article <10i6qco$26cuc$1@dont-email.me>, sjack <sdwjack69@gmail.com> wrote: >mc:) cat /tmp/foo
    :) toad -q go

    XYZZY WORK TOAD FORTH Working disk
    fload f/ipc.f OK
    "ipc" /demo
    This makes no sense

    <SNIP>
    me

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From sjack@sjack@dontemail.me (sjack) to comp.lang.forth on Sun Dec 21 19:07:06 2025
    From Newsgroup: comp.lang.forth

    albert@spenarnc.xs4all.nl wrote:
    In article <10i6qco$26cuc$1@dont-email.me>, sjack <sdwjack69@gmail.com> wrote:
    mc:) cat /tmp/foo
    :) toad -q go

    XYZZY WORK TOAD FORTH Working disk
    fload f/ipc.f OK
    "ipc" /demo
    This makes no sense

    :) : ":" is bash command to do nothing so can act as comment
    :)
    :) : ":)" is bash prompt with indication last command was successful
    :) : Examples
    :) false
    :( true
    :)
    :) : A simple TOAD invocation
    :) toad

    Fig-Forth 1.0.c
    bye :)
    :)
    :) : TOAD invocation with word "go" to run extension setup
    :) toad go
    END ISN'T UNIQUE
    LOOP ISN'T UNIQUE
    +LOOP ISN'T UNIQUE
    ( ISN'T UNIQUE
    ?LOADING ISN'T UNIQUE
    ;NEXT ISN'T UNIQUE
    #S ISN'T UNIQUE
    TAB ISN'T UNIQUE
    .. ISN'T UNIQUE
    BACK ISN'T UNIQUE
    SV! ISN'T UNIQUE
    SVAR: ISN'T UNIQUE
    CREATE ISN'T UNIQUE
    REFILL ISN'T UNIQUE

    XYZZY WORK TOAD FORTH Working disk
    --
    -- The above line is printout of the title line, line#0 SCR#0,
    -- of disk in current use after completion of the "go" setup.
    --
    cr i. 0 0 (line) type
    XYZZY WORK TOAD FORTH Working disk OK
    --
    -- The "XYZZY" is magic to indicate this disk has meta information
    -- in SCR#1 and SCR#2 as to its content layout, e.g. if error
    -- text exist on disk or not and if so, where?
    -- "WORK" is a key that can be searched for; text which follows
    -- is the title. Demo scripts usually can run with the "WORK"
    -- disk; Test scripts usually need "MAIN", a library disk. Either
    -- can test and switch disks as needed (disks aren't physical).
    --
    bye :)
    :)
    :) : Invocation with quite option '-q' to suppress printouts
    :) : of "ISN'T UNIQUE" warnings.
    :) toad -q go

    XYZZY WORK TOAD FORTH Working disk
    bye :)
    :)
    :) : 'fload' loads a file
    :) : 'f/ipc.f' is pathname of file with ipc code
    :) : '"ipc" /demo' loads (runs) script file 'demo/demo_ipc.f',
    :) : the demo of interest.
    :) : '..' is quick status printout of BASE , data stack, LATEST ,
    :) : HERE , UNUSED , CONTEXT , CURRENT and PREVOC (saved CURRENT ,
    :) : a helpful word in managing many vocabularies).
    :)
    --
    me
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Mon Dec 22 12:07:41 2025
    From Newsgroup: comp.lang.forth

    In article <10i9ggp$2v4nn$1@dont-email.me>, sjack <sjack@dontemail.me> wrote: >albert@spenarnc.xs4all.nl wrote:
    In article <10i6qco$26cuc$1@dont-email.me>, sjack <sdwjack69@gmail.com> wrote:
    mc:) cat /tmp/foo
    :) toad -q go

    XYZZY WORK TOAD FORTH Working disk
    fload f/ipc.f OK
    "ipc" /demo
    This makes no sense

    :) : ":" is bash command to do nothing so can act as comment

    This still makes no sense.

    <SNIP>

    --
    me

    Groetjes Albert
    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From tTh@tth@none.invalid to comp.lang.forth on Mon Dec 22 13:25:30 2025
    From Newsgroup: comp.lang.forth

    On 12/21/25 20:07, sjack wrote:

    :) : ":" is bash command to do nothing so can act as comment

    No. The command ':' is the same as the 'true' command.
    ':' have an exit status, so a comment who change an exit
    status is just evil.

    tth@linda:~/ $ false ; echo $?
    1
    tth@linda:~/ $ true ; echo $?
    0
    tth@linda:~/ $ false ; : foo ; echo $?
    0
    --
    ** **
    * tTh des Bourtoulots *
    * http://maison.tth.netlib.re/ *
    ** **
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From sjack@sjack@dontemail.me (sjack) to comp.lang.forth on Mon Dec 22 18:08:17 2025
    From Newsgroup: comp.lang.forth

    tTh <tth@none.invalid> wrote:
    On 12/21/25 20:07, sjack wrote:

    :) : ":" is bash command to do nothing so can act as comment

    No. The command ':' is the same as the 'true' command.

    Technically correct but it served well enough as comment in the
    followup post as Bash ignored following text.
    And such comments didn't appear in the original post; however,
    ":)" did appear and the followup post explained that it was a
    a Bash prompt with last command status.
    --
    me
    --- Synchronet 3.21a-Linux NewsLink 1.2