"Environment related definitions"

environ FORTH ENVIRONMENT-WORDLIST

[] no special info, see general notes

FORTH/FORTH environ loader code P4_DVaL

* ENVIRONMENT? ( a1 n1 -- false | ?? true )

check the environment for a property, usually
a condition like questioning the existance of
specified wordset, but it can also return some
implementation properties like "WORDLISTS"
(the length of the search-order) or "#LOCALS"
(the maximum number of locals)
Here it implements the environment queries as a SEARCH-WORDLIST 

in a user-visible vocabulary called ENVIRONMENT
 : ENVIRONMENT?
   ['] ENVIRONMENT >WORDLIST SEARCH-WORDLIST
   IF  EXECUTE TRUE ELSE  FALSE THEN ;

FORTH/FORTH environ (dpANS.6.1.1345) ordinary primitive

* REQUIRED ( ... str-ptr str-len -- ??? )

the filename argument is loaded via INCLUDED as
an extension package to the current system. The filename
is registered in the current ENVIRONMENT so that it is
only INCLUDED once (!!) if called multiple times via
REQUIRED or REQUIRES

FORTH/FORTH environ ordinary primitive

* REQUIRES ( ... "name" -- ??? )

parses the next WORD and passes it to REQUIRED
this is the self-parsing version of REQUIRED and
it does parrallel INCLUDE w.r.t. INCLUDED

FORTH/FORTH environ ordinary primitive

* NEEDS ( name -- )


A self-parsing variant of an environment-query check. It is similar
to a simulation like
 : NEEDS PARSE-WORD 2DUP ENVIRONMENT? 
   IF DROP ( extra value ) 2DROP ( success - be silent )
   ELSE TYPE ." not available " CR THEN ;

however that would only match those worset-envqueries which return a
single extra item under the uppermost TRUE flag in the success case.
Instead it works more like
 : NEEDS PARSE-WORD 2DUP ENVIRONMENT-WORDLIST SEARCH-WORDLIST
   IF 2DROP ( success - be silent and just drop the parsed word )
   ELSE TYPE ." not available " CR THEN ;

however we add the same extension as in ENVIRONMENT? as that
it can automatically load a wordset module to fullfil a query
that looks like "[wordsetname]-ext". Therefore, the following
two lines are pretty much identical:
 LOADM floating
 NEEDS floating-ext

the difference between the two: if somebody did provide a forth
level implementation of floating-ext then that implementation might
have registered a hint "floating-ext" in the environment-wordlist.
This extra-hint will inhibit loading of the binary module even if
it exists and not been loaded so far. The LOADM however will
not check the ENVIRONMENT-WORDLIST and only check its loadlist
of binary wordset modules in the system.

It is therefore recommended to use NEEDS instead of LOADM
unless you know you want the binary module, quickly and uncondtionally.

FORTH/FORTH environ ordinary primitive

ENVIRONMENT ENVIRONMENT ENVIRON-EXT

[] no special info, see general notes

ENVIRONMENT environ ordinary constant

* ENVIRONMENT HOST-SYSTEM ( -- str len )

returns the HOST-SYTEM type, can be used to distinguish
different runtime environments. (see .STATUS)

ENVIRONMENT environ ordinary primitive

ENVIRONMENT FORTH-LICENSE

[] no special info, see general notes

ENVIRONMENT environ ordinary primitive

* ENVIRONMENT CASE-SENSITIVE? ( -- flag )

Classifying Forth systems 7
by J Thomas on comp.lang.forth, 06.Feb.2001
-------------------------------------------
Thomas' spec did not reveal whether to return the
system-wide LOWER_CASE or the wordlist-local NOCASE-state.
For now, it returns the wordlist-local state.

ENVIRONMENT environ ordinary primitive

* ENVIRONMENT FORTH-NAME ( -- caddr len )

Classifying Forth systems 6
by J Thomas on comp.lang.forth, 03.Feb.2001
-------------------------------------------

The string should be a name, like ProForth or SwiftForth

-------------------------------------------
Thomas' spec did not reveal whether to return a
longname or shortname.
For now, it returns the short name.

ENVIRONMENT environ ordinary primitive

* ENVIRONMENT FORTH-VERSION ( -- caddr len )

Classifying Forth systems 6
by J Thomas on comp.lang.forth, 03.Feb.2001
-------------------------------------------

The string will give a version number, whatever the
implementor chooses.

-------------------------------------------
Thomas' spec did not reveal whether to return a
compact or talkative version spec.
For now, it returns the long version-string.

ENVIRONMENT environ ordinary primitive

* ENVIRONMENT FORTH-CONTACT ( -- caddr len )

Classifying Forth systems 6
by J Thomas on comp.lang.forth, 03.Feb.2001
-------------------------------------------

The string will give a name-and-address or website etc.

-------------------------------------------
Thomas' spec did not reveal whether to return a
URL-form and a readable free-form.
For now, it returns the URL-form of the sourceforge project.

ENVIRONMENT environ ordinary primitive