Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"Ninety percent of baseball is half mental." -- Yogi Berra


devel / comp.lang.forth / Re: Help me to save progress or source management in SwiftForth

SubjectAuthor
o Re: Help me to save progress or source management in SwiftForthHugh Aguilar

1
Re: Help me to save progress or source management in SwiftForth

<0a4fcf94-ff0d-46e7-90e1-f9f2de81f3fan@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=24180&group=comp.lang.forth#24180

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:4e82:0:b0:635:ef76:6448 with SMTP id dy2-20020ad44e82000000b00635ef766448mr27859qvb.6.1691377004144;
Sun, 06 Aug 2023 19:56:44 -0700 (PDT)
X-Received: by 2002:a67:ca19:0:b0:443:6601:d8f4 with SMTP id
z25-20020a67ca19000000b004436601d8f4mr62627vsk.1.1691377003887; Sun, 06 Aug
2023 19:56:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sun, 6 Aug 2023 19:56:43 -0700 (PDT)
In-Reply-To: <ac636c33-606e-4f0c-a081-9e23a1d24c72n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=63.158.165.131; posting-account=OxDKOgoAAADW0cxAqHqpN1zqeCoSsDap
NNTP-Posting-Host: 63.158.165.131
References: <ac636c33-606e-4f0c-a081-9e23a1d24c72n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0a4fcf94-ff0d-46e7-90e1-f9f2de81f3fan@googlegroups.com>
Subject: Re: Help me to save progress or source management in SwiftForth
From: hughaguilar96@gmail.com (Hugh Aguilar)
Injection-Date: Mon, 07 Aug 2023 02:56:44 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Hugh Aguilar - Mon, 7 Aug 2023 02:56 UTC

On Tuesday, March 14, 2023 at 9:25:50 AM UTC-7, Yaroslav Veremenko wrote:
> For example yesterday I installed SwiftForth, I read the documentation
> and it has few pages on source management. The only word that seem to matter
> to me in this case is INCLUDE. But it doesn't seem to go deep into how to actually use it.

In my novice package I have this:

only forth definitions \ start from a known configuration

marker novice.4th \ don't use TRY on this
\ this is provided primarily for Gforth that lacks EMPTY

: try ( -- ) \ stream: marker-name
bl word
dup find if execute else drop then \ execute the marker to get rid of the file's code
count included ; \ include the file (marker name must be file name)

\ The marker-name is required to be the same as the file-name.
\ TRY will then remove the file's code if it has already been compiled, then compile the file.
\ TRY can't be used on NOVICE.4TH because removing the file's code removes TRY
\ and TRY will then go haywire.

: require ( -- ) \ stream: marker-name
bl word
find if drop else count included then ;
\ include the file if it is not already there (marker name must be file name)

\ REQUIRE is used to make sure a needed file is compiled.

I've been using the novice package since 2010 and this works fine.
Occasionally I will crash SwiftForth and have to reload it,
and reload the floating-point support that for reasons unknown is
not automatically loaded, then reload NOVICE.4TH etc..

> SwiftForth doesn't seem to have ...
> a way to reset the state of a interpreter.

This is a bug in the ANS-Forth design. If your compilation or your program
aborts, the system doesn't restart in a known state. If you have word-lists
changed, BASE changed, etc., this doesn't get reset. The solution is to have
code at the beginning of your file that sets everything to a known state.
TRY is in the FORTH word-list so it should be available, then your initialization
code fixes any other lingering problems.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor