SAVE-INPUT ... 
Author Message
 SAVE-INPUT ...

I've always thought that SAVE-INPUT ... RESTORE-INPUT was of dubious
worth and could be replaced by colon-definitions with several
S" <filename>" INCLUDED in them.

I have considered using it to put commonly required functions after
the new stuff.

    VARIABLE PREREQUISITE  PREREQUISITE OFF


    CR ." New Definitions " CR

    [ELSE]

    CR ." Prerequisites " CR

    PREREQUISITE ON  RESTORE-INPUT

    [THEN]

This yields:

    Prerequisites

    New Definitions

--



Mon, 11 Apr 2005 13:46:09 GMT  
 SAVE-INPUT ...

Looking at SAVE-INPUT, I see how it can solve several long-term
problems of mine.

I want:

  Shared source files to be complete, i.e. to contain all
  required definitions.  This is not always practical.

  Shared source loaded for my own use without modification.

  Favorite tools not redundantly compiled.

  Favorite tools out of the way of the main attraction.

For this, define in working tools a persistent variable TOOLS with a
positive value.

    CREATE  TOOLS  1 ,

The value may be incremented as tool modules are written.

Use the following in source files.

    [UNDEFINED] TOOLS [IF]  CREATE TOOLS  0 ,  [THEN]   \  TOOLS

    .( New Definitions )

    ...


    .( Prerequisites )

    ...

    TOOLS ON  RESTORE-INPUT  [THEN]                     \  TOOLS

If TOOLS has not been defined, or its value is 0, Prerequisites
will be interpreted before New Definitions.  If the value of
TOOLS is positive, New Definitions will be interpreted and
Prerequisites skipped.

In the unfortunate case that TOOLS has a conflicting definition
and prerequisites are undefined or conflicting, New Definitions
will not be successfully interpreted.

Quote:
> --




Wed, 13 Apr 2005 09:43:39 GMT  
 SAVE-INPUT ...


Quote:
>I've always thought that SAVE-INPUT ... RESTORE-INPUT was of dubious
>worth and could be replaced by colon-definitions with several
>S" <filename>" INCLUDED in them.

>I have considered using it to put commonly required functions after
>the new stuff.

>    VARIABLE PREREQUISITE  PREREQUISITE OFF


>    CR ." New Definitions " CR

>    [ELSE]

>    CR ." Prerequisites " CR

>    PREREQUISITE ON  RESTORE-INPUT

>    [THEN]

>This yields:

>    Prerequisites

>    New Definitions

>--


What is the difference with ?

VARIABLE PREREQUISITE  PREREQUISITE OFF

CR ." New Definitions " CR
THEN]
CR ." Prerequisites " CR
PREREQUISITE ON

Or even leaving PREREQUISITE altogether?

Groetjes Albert
--
Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS
To suffer is the prerogative of the strong. The weak -- perish.



Tue, 12 Apr 2005 18:11:24 GMT  
 SAVE-INPUT ...
On Sat, 26 Oct 2002 01:43:39 GMT

Quote:



> Looking at SAVE-INPUT, I see how it can solve several long-term
> problems of mine.

> I want:

>   Shared source files to be complete, i.e. to contain all
>   required definitions.  This is not always practical.

>   Shared source loaded for my own use without modification.

>   Favorite tools not redundantly compiled.

>   Favorite tools out of the way of the main attraction.

F4 ">INPUT" and "INPUT>", L4 "SAVE-INPUT", "RESTORE-INPUT":

I have an "lload" word, which loads from a high-level forth library-like
(block-)file the requested word, and may be nested w.o. limits. for this
purpose I find it very convenient to preserving the actual i/o and some
system state related data - vocabularies, base, etc - across those calls.

another, which I've named "FOUND?" before I knew of 'DEFINED?' &c (which,
strictly seen, would not be the same, thus I prefer FOUND?), can then be
used to filter whether a word was already loaded.

best,
        hp

--
   >>> pse, reply to : clf -at- lxhp -dot- in-berlin -dot- de <<<
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de



Fri, 15 Apr 2005 23:47:00 GMT  
 SAVE-INPUT ...

Quote:

> I have an "lload" word, which loads from a high-level forth library-like
> (block-)file the requested word, and may be nested w.o. limits.

Thank you for your response. I have not made myself clear.

My first requirement is:

Quote:
> >   Shared source files to be complete, i.e. to contain all
> >   required definitions.

This means that in shared source files, definitions for all non-Standard
words should be given.  I trust that anyone with a Standard Forth can
use the file without modification.

It also means no use of INCLUDED or any of its relatives. There is no
common way of naming files and directories.

I believe that it is a mistake to use INCLUDE even in your own source
files. The best way to manage source files is a file of INCLUDEs with
no source.  Typically the first line in the file is EMPTY.

The weak spot in this scheme is TOOLS.  This is no problem if you do not
have some definition for TOOLS or your definition is compatible with
mine.  I hope that the following warning will be good enough.

    \  If TOOLS has not been defined, or its value is 0, Prerequisites
    \  will be interpreted before New Definitions.  If the value of
    \  TOOLS is positive, New Definitions will be interpreted and
    \  Prerequisites skipped.

    [UNDEFINED] TOOLS [IF]  CREATE TOOLS  0 ,  [THEN]   \  TOOLS

    \           New Definitions

    ...


    \           Prerequisites.

    \  Comment out redundant definitions.

    ...

    TOOLS ON  RESTORE-INPUT  [THEN]                     \  TOOLS

    \  In the unfortunate case that TOOLS has a conflicting definition
    \  and prerequisites are undefined or conflicting, New Definitions
    \  will not be successfully interpreted.

--



Sun, 17 Apr 2005 01:13:05 GMT  
 SAVE-INPUT ...

Quote:

> This means that in shared source files, definitions for
> all non-Standard words should be given.  I trust that
> anyone with a Standard Forth can
> use the file without modification.




in the thread or in response to my question.  I can

might use it.

Quote:
> It also means no use of INCLUDED or any of its relatives.
> There is no common way of naming files and directories.

Yes, it is one of those perpetual problems.

Quote:
> I believe that it is a mistake to use INCLUDE even in
> your own source files. The best way to manage source
> files is a file of INCLUDEs with no source.  
> Typically the first line in the file is EMPTY.

Here here. I think this is an important point that
seems to escape most people.  Without this one gets
spaghetti files.  I would like to see this point
expanded.  I have been thinking of writing a web
page about this point for the last couple of
weeks.

Quote:
> The weak spot in this scheme is TOOLS.

I think that was my biggest problem in reading your
code for many years.  I would encounter a word in
the first line of code that was part of the TOOLS
words but which I was unfamiliar with.  There would
be no definition presented as if the TOOLS words
were part of the standard and that everyone should
be as familiar with them as DUP or DROP.

To be able to read the first line of code I would
have to go to your web site and search around to
find the definition which makes for very slow
reading.

best wishes,
Jeff Fox



Sun, 17 Apr 2005 01:49:27 GMT  
 SAVE-INPUT ...

Quote:

>On Sat, 26 Oct 2002 01:43:39 GMT


 <SNIP>

>>   Favorite tools out of the way of the main attraction.

>F4 ">INPUT" and "INPUT>", L4 "SAVE-INPUT", "RESTORE-INPUT":

>I have an "lload" word, which loads from a high-level forth library-like
>(block-)file the requested word, and may be nested w.o. limits. for this
>purpose I find it very convenient to preserving the actual i/o and some
>system state related data - vocabularies, base, etc - across those calls.

>another, which I've named "FOUND?" before I knew of 'DEFINED?' &c (which,
>strictly seen, would not be the same, thus I prefer FOUND?), can then be
>used to filter whether a word was already loaded.

I have a similar facility (in ciforth with yet different names :-( )
But the blocks are loaded by THRU just fine, so I don't see where an
explicit SAVE-INPUT comes in. (SAVE-INPUT may be used by THRU but I
would call that implicit, because THRU is probably supplied by the
base system.)

Groetjes Albert
--
Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS
To suffer is the prerogative of the strong. The weak -- perish.



Sat, 16 Apr 2005 20:51:37 GMT  
 SAVE-INPUT ...


Quote:

>> This means that in shared source files, definitions for
>> all non-Standard words should be given.  I trust that
>> anyone with a Standard Forth can
>> use the file without modification.




>in the thread or in response to my question.  I can

>might use it.

>> It also means no use of INCLUDED or any of its relatives.
>> There is no common way of naming files and directories.

>Yes, it is one of those perpetual problems.

See below.

Quote:
>> I believe that it is a mistake to use INCLUDE even in
>> your own source files. The best way to manage source
>> files is a file of INCLUDEs with no source.
>> Typically the first line in the file is EMPTY.

>Here here. I think this is an important point that
>seems to escape most people.  Without this one gets
>spaghetti files.  I would like to see this point
>expanded.  I have been thinking of writing a web
>page about this point for the last couple of
>weeks.

This is not without its problems.
I have a single block-library file accross 16/32 , msdos/windows/linux
pentium/386/xt. With some automatic searching, see below.
With the "don't nest includes" approach you may have to build a
combinatorial explosion of master build files for each of the
2*3*3*4*2 possibilities, getting worse each time you add a facility
that is solved differently for different hardware.
Unless you are satisfied with running the program on
exactly one computer, your own. ("Solving the concrete
problem" that is how you call it, Jeff?).
Now look at where Wil started. We want to share our
programs.

The best solution seems then a master include that is
a rats nest of [IF] [THEN] [DEFINED] .

But I like REQUIRED better
( sc -- ) Make the word with name `sc' available,
if possible.

No reference to files. Just mention the Forth word
you want to have. Gets rid of one of the main
problems with INCLUDED .

I have
a single block-library file accross 16/32 , msdos/windows/linux
pentium/386/xt.
And using its facilities is painless over a wide range
of hardware.

<SNIP>

Quote:
>best wishes,
>Jeff Fox

Groetjes Albert
--
Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS
To suffer is the prerogative of the strong. The weak -- perish.



Sun, 17 Apr 2005 22:35:04 GMT  
 SAVE-INPUT ...

Quote:

> The best solution seems then a master include that is
> a rats nest of [IF] [THEN] [DEFINED] .

My choice is a single master INCLUDE file for each platform - no
rats' nest, few conditionals.

The purpose of Tool Belt is to reduce the number of required
non-Standard definitions.

Quote:
> But I like REQUIRED better
> ( sc -- ) Make the word with name `sc' available,
> if possible.

Not portable.

--




Mon, 18 Apr 2005 09:30:31 GMT  
 SAVE-INPUT ...

Quote:

> My choice is a single master INCLUDE file for each platform - no
> rats' nest, few conditionals.

> The purpose of Tool Belt is to reduce the number of required
> non-Standard definitions.

Here is my master INCLUDE file for Power MacForth Version 6.044:

  \ +PMF6-Includes    Working Electives for PMF.  WB  2002-09-13
  POSSIBLY  --Late-Additions--
  SETCD" HD:Custom"

      INCLUDE  00-Late-Additions.pmf  \  --Late-Additions--

  \ WARNING ON  VERBOSE

      INCLUDE  01-TOOLBELT.pmf        \  --TOOLBELT--
      INCLUDE  02-CKQUOTE             \  --CKQUOTE--

      INCLUDE  03-CHARCASE.mac        \  --CHARCASE--
      INCLUDE  04-SKIPSCAN            \  --SKIPSCAN--
      INCLUDE  05-NUMBER              \  --NUMBER--
      INCLUDE  06-COMMON              \  --COMMON--

      INCLUDE  07-Dataspace-Output    \  --Dataspace-Output--
      INCLUDE  08-Input-File          \  --Input-File--
      INCLUDE  09-ALPHLIST.pmf        \  --ALPHLIST--

  WARNING ON  VERBOSE
  \ WARNING OFF

  MARKER --EMPTY--

  \  Current Project:

  INCLUDE Phillips-Definitions  \  --Phillips-Definitions--

  \ INCLUDE Phillips-Coding     \  --Phillips-Coding--

  CR TIME&DATE . . . . . .

Double-clicking on the file name in the directory launches PMF6
and this file.

The INCLUDE file for Power MacForth Version 5 is the same but
launches PMF5.

In MacForth, selecting a --anew-name-- in this file and
pressing command R will open the file.



Mon, 18 Apr 2005 10:22:26 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. SAVE-INPUT RESTORE-INPUT

2. SAVE-INPUT and RESTORE-INPUT

3. Saving input into mother-file

4. SAVE-INPUT

5. Saving a file -> Save as type

6. F90: to SAVE or not to SAVE?

7. Save/Save As Problem

8. Saved / Not saved variable?

9. A "Saving" box during saving

10. SAVE doesn't save PC

11. XF is has problems saving and save as'ing

12. save and save as in xf

 

 
Powered by phpBB® Forum Software