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


Groups > comp.lang.forth > #132080

Re: Using include-file

From mhx@iae.nl (mhx)
Newsgroups comp.lang.forth
Subject Re: Using include-file
Date 2024-09-02 21:22 +0000
Organization novaBBS
Message-ID <acb9c2da96f73f53b88ecc583e95cf55@www.novabbs.com> (permalink)
References <vb565d$2vcqf$1@dont-email.me>

Show all headers | View raw


On Mon, 2 Sep 2024 20:11:25 +0000, Ruvim wrote:

> Do you know practical cases of using "include-file" in programs?
>
[..]
> Using other system-specific means, this word can probably be used to
> organize inter-process communication: when a file descriptor (e.g. a
> pipe) is passed from one process to another and used as the input
> source.  But why do you need to load Forth code this way?

My SPICE simulator INCLUDE's pre-processed netlists.
A pre-processor takes (again, INCLUDE's) the industrial-standard
netlist and rewrites it to Forth.
One can also write the netlist directly using Forth, but not
every engineer is able or willing to do that.

Debugging is easy: the original netlist runs on standard SPICE
programs and its results can be compared directly to iSPICE's
output when it uses the pre-processed netlist.

The principle works for other applications too. Here some
examples from my dfwforth/include directory:

FORTH> grep "INCLUDE" /mnt/d/dfwforth/include/*.frt
/assemble.frt:319:               =ASM-NAME COUNT  INCLUDED
/backtrac.frt:132:       ['] INCLUDE-FILE OF
/dialogs.frt:116:        R> COUNT INCLUDED
/eplot.frt:777:          SWAP @ ?DUP IF COUNT INCLUDED ( header) ENDIF
/eplot.frt:796:          SWAP @ ?DUP IF COUNT INCLUDED ( header) ENDIF
/eplot.frt:819:          SWAP @ ?DUP IF COUNT INCLUDED ( header) ENDIF
/eplot.frt:838:          SWAP @+ SWAP >S  ?DUP IF COUNT INCLUDED ( head
/eplot.frt:882:          :headname @ ?DUP IF COUNT INCLUDED
/eplot.frt:895:          :dataname @ COUNT INCLUDED ;
/graphbench.frt:261:#63 #check [IF]      INCLUDE gtk3/benchmarks.frt [T
/iwords1.frt:4:CR .( FORTH.LOG : edit out garbage first, then INCLUDE i
/lprof.frt:357:\ Instead of INCLUDE name , IN name , S" name" INCLUDED
/lprof.frt:367:            S" !!!!!!!!.$$$" INCLUDED
/lprofile.frt:198:\ Instead of INCLUDE name , IN name , S" name" INCLUD
/lprofile.frt:207:               S" !!!!!!!!.$$$" INCLUDED ;
/playwav.frt:17:[IF]     INCLUDE pwavlinu.frt
/playwav.frt:21:[IF]     INCLUDE pwavlinu.frt
/playwav.frt:25:[IF]     INCLUDE pwavewin.frt
/runsteady.frt:620:             inpbuf #11 cnt MIN S" *| INCLUDE " COMP
/syssim.frt:772: EVAL" ANEW __syssim__" S" spf_model.frt" INCLUDED ;
/syssim.frt:812: CR ." SPF-INCLUDE   -- load spf_model.frt control/simu

-marcel

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


Thread

Using include-file Ruvim <ruvim.pinka@gmail.com> - 2024-09-03 00:11 +0400
  Re: Using include-file mhx@iae.nl (mhx) - 2024-09-02 21:22 +0000
    Re: Using include-file mhx@iae.nl (mhx) - 2024-09-03 05:38 +0000
      Re: Using include-file rt4all@hetnet.nl (rt) - 2024-11-09 08:29 +0000
        Re: Using include-file mhx@iae.nl (mhx) - 2024-11-09 12:06 +0000
          Re: Using include-file Stephen Pelc <stephen@vfxforth.com> - 2024-11-09 18:13 +0000
            Re: Using include-file dxf <dxforth@gmail.com> - 2024-11-10 13:54 +1100
          Re: Using include-file rt4all@hetnet.nl (rt) - 2024-11-10 13:47 +0000
  Re: Using include-file anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2024-09-03 06:50 +0000
    Re: Using include-file albert@spenarnc.xs4all.nl - 2024-09-03 10:23 +0200
      Re: Using include-file mhx@iae.nl (mhx) - 2024-09-03 11:54 +0000
        Re: Using include-file sjack@dontemail.me (sjack) - 2024-09-03 15:28 +0000
          Re: Using include-file dxf <dxforth@gmail.com> - 2024-09-04 11:36 +1000
      Re: Using include-file dxf <dxforth@gmail.com> - 2024-09-04 16:44 +1000
    Re: Using include-file Ruvim <ruvim.pinka@gmail.com> - 2024-09-03 23:07 +0400
      Re: Using include-file Ruvim <ruvim.pinka@gmail.com> - 2024-10-23 22:43 +0400
        Re: Using include-file anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2024-10-24 06:32 +0000
          Re: Using include-file albert@spenarnc.xs4all.nl - 2024-10-24 11:30 +0200
          Re: Using include-file Ruvim <ruvim.pinka@gmail.com> - 2024-10-26 09:19 +0400
  Re: Using include-file Gerry Jackson <do-not-use@swldwa.uk> - 2024-09-04 10:54 +0100
    Re: Using include-file Gerry Jackson <do-not-use@swldwa.uk> - 2024-09-04 11:09 +0100
  Re: Using include-file dxf <dxforth@gmail.com> - 2024-09-04 21:13 +1000
    Re: Using include-file Ruvim <ruvim.pinka@gmail.com> - 2024-09-17 18:33 +0400
  Re: Using include-file minforth@gmx.net (minforth) - 2024-10-24 12:44 +0000
    Re: Using include-file Ruvim <ruvim.pinka@gmail.com> - 2024-10-27 21:31 +0400
      Re: Using include-file minforth@gmx.net (minforth) - 2024-10-27 22:32 +0000

csiph-web