• Re: Using include-file

    From Ruvim@ruvim.pinka@gmail.com to comp.lang.forth on Wed Oct 23 22:43:46 2024
    From Newsgroup: comp.lang.forth

    On 2024-09-03 23:07, Ruvim wrote:
    On 2024-09-03 10:50, Anton Ertl wrote:
    Ruvim <ruvim.pinka@gmail.com> writes:
    Do you know practical cases of using "include-file" in programs?

    One way I am thinking about is to implement INCLUDED etc.  Systems
    deal differently with relative filenames for INCLUDED, with less
    differences for OPEN-FILE.  So if I want to implement a certain
    handling of relative filenames for INCLUDED in order to get rid of
    system differences, one way to do it is to do it for OPEN-FILE and
    then perform INCLUDE-FILE.

    Yes, overriding the system's file search mechanism used by "included" is
    a very interesting idea!

    Another possible reason to not use `INCLUDED`:

    | INCLUDED may allocate memory in data space before
    | it starts interpreting the file.

    So if this effect is unacceptable (for example, if you include part of a definition), then the solution is `INCLUDE-FILE`.


    Also, `REQUIRED` does not load a file that was loaded by `INCLUDED`. `INCLUDE-FILE` is free of that too.


    --
    Ruvim

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From anton@anton@mips.complang.tuwien.ac.at (Anton Ertl) to comp.lang.forth on Thu Oct 24 06:32:33 2024
    From Newsgroup: comp.lang.forth

    Ruvim <ruvim.pinka@gmail.com> writes:
    Also, `REQUIRED` does not load a file that was loaded by `INCLUDED`. >`INCLUDE-FILE` is free of that too.

    Yes, but why would anyone use REQUIRED or REQUIRE on a file that he
    intends to include even if it has been INCLUDED before?

    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
    comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2024: https://euro.theforth.net
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Thu Oct 24 11:30:57 2024
    From Newsgroup: comp.lang.forth

    In article <2024Oct24.083233@mips.complang.tuwien.ac.at>,
    Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
    Ruvim <ruvim.pinka@gmail.com> writes:
    Also, `REQUIRED` does not load a file that was loaded by `INCLUDED`. >>`INCLUDE-FILE` is free of that too.

    Yes, but why would anyone use REQUIRED or REQUIRE on a file that he
    intends to include even if it has been INCLUDED before?

    Making use of the idempotent behaviour of REQUIRE ?


    - anton
    --
    M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html >comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
    New standard: https://forth-standard.org/
    EuroForth 2024: https://euro.theforth.net
    --
    Temu exploits Christians: (Disclaimer, only 10 apostles)
    Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
    Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
    And Gifts For Friends Family And Colleagues.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From minforth@minforth@gmx.net (minforth) to comp.lang.forth on Thu Oct 24 12:44:41 2024
    From Newsgroup: comp.lang.forth

    On Mon, 2 Sep 2024 20:11:25 +0000, Ruvim wrote:
    Do you know practical cases of using "include-file" in programs?

    I remember a script for reading csv data files with INCLUDE-FILE.
    The interpreter (parser) was slightly modified for this.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Ruvim@ruvim.pinka@gmail.com to comp.lang.forth on Sat Oct 26 09:19:03 2024
    From Newsgroup: comp.lang.forth

    On 2024-10-24 10:32, Anton Ertl wrote:
    Ruvim <ruvim.pinka@gmail.com> writes:
    Also, `REQUIRED` does not load a file that was loaded by `INCLUDED`.
    `INCLUDE-FILE` is free of that too.

    Yes, but why would anyone use REQUIRED or REQUIRE on a file that he
    intends to include even if it has been INCLUDED before?

    This can be in different modules, and one module does not know about
    details of another.

    If you include a file into a separate word list within a special
    context, you might not want to prevent that file from being loaded by `require` into another word list (and in another context).


    --
    Ruvim

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Ruvim@ruvim.pinka@gmail.com to comp.lang.forth on Sun Oct 27 21:31:00 2024
    From Newsgroup: comp.lang.forth

    On 2024-10-24 16:44, minforth wrote:
    On Mon, 2 Sep 2024 20:11:25 +0000, Ruvim wrote:
    Do you know practical cases of using "include-file" in programs?

    I remember a script for reading csv data files with INCLUDE-FILE.
    The interpreter (parser) was slightly modified for this.

    Why wasn't `INCLUDED` suitable?


    --
    Ruvim

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From minforth@minforth@gmx.net (minforth) to comp.lang.forth on Sun Oct 27 22:32:03 2024
    From Newsgroup: comp.lang.forth

    It was opened in read/write mode to read or append new sections.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From rt4all@rt4all@hetnet.nl (rt) to comp.lang.forth on Sat Nov 9 08:29:44 2024
    From Newsgroup: comp.lang.forth

    Hi Marcel, the Mac Cocoa interface for i4 uses INCLUDE-FILE to deal with
    code pasted in the OS clipboard. BTW same for VFX and VFX64. I needed a portable/standard word, 'et voila'.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From mhx@mhx@iae.nl (mhx) to comp.lang.forth on Sat Nov 9 12:06:19 2024
    From Newsgroup: comp.lang.forth

    On Sat, 9 Nov 2024 8:29:44 +0000, rt wrote:

    Hi Marcel, the Mac Cocoa interface for i4 uses INCLUDE-FILE
    to deal with code pasted in the OS clipboard. BTW same for
    VFX and VFX64. I needed a portable/standard word, 'et voila'.

    Hi Roelf: not enough information. Isn't the file-id for the clipboard
    acquired in a non-standard way then?

    iForth's console already accepts multi-line text pasted in its
    window. In SwiftForth the pasted text seems to have a fixed (small)
    length. I don't receive VFX updates anymore (I probably said something offensive), so can't try.

    There could be a few issues with a portable solution :--)

    -marcel
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Stephen Pelc@stephen@vfxforth.com to comp.lang.forth on Sat Nov 9 18:13:29 2024
    From Newsgroup: comp.lang.forth

    On 9 Nov 2024 at 13:06:19 CET, "mhx" <mhx> wrote:

    I don't receive VFX updates anymore (I probably said something
    offensive), so can't try.

    Now that all products are freely downloadable for non-commercial use,
    all you need to do is to download the latest versions from:
    https://vfxforth.com/downloads/VfxCommunity/

    Stephen
    --
    Stephen Pelc, stephen@vfxforth.com
    MicroProcessor Engineering, Ltd. - More Real, Less Time
    133 Hill Lane, Southampton SO15 5AF, England
    tel: +44 (0)78 0390 3612, +34 649 662 974
    http://www.mpeforth.com MPE website http://www.vfxforth.com/downloads/VfxCommunity/ downloads
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sun Nov 10 13:54:43 2024
    From Newsgroup: comp.lang.forth

    On 10/11/2024 5:13 am, Stephen Pelc wrote:
    On 9 Nov 2024 at 13:06:19 CET, "mhx" <mhx> wrote:

    I don't receive VFX updates anymore (I probably said something
    offensive), so can't try.

    Now that all products are freely downloadable for non-commercial use,
    all you need to do is to download the latest versions from:
    https://vfxforth.com/downloads/VfxCommunity/

    Stephen

    Any resolution to the problem of switching fp packs under Win x64
    corrupting the GUI? A rebuild of the system using the desired fp
    pack would likely work but that's a task in itself.


    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From rt4all@rt4all@hetnet.nl (rt) to comp.lang.forth on Sun Nov 10 13:47:17 2024
    From Newsgroup: comp.lang.forth

    <quote>
    There could be a few issues with a portable solution :--)
    </quote>

    :-)

    The Cocoa interface runs in CarbonMacForth(2008), iForth(2009), SwiftForth(2010) and VFX(2012).
    Kind of recall, the Cocoa, not UNIX/Darwin, clipboard interface was
    implemented in 2010, 14 years ago! At the time not seen any remarks
    about the standard INCLUDE-FILE.
    And it still works...

    --
    --- Synchronet 3.20a-Linux NewsLink 1.114