pfe-core-misc-ext
Prev? | pfe Forth Wordset List | ?Next

## Name

pfe-core-misc-ext ? CORE-Misc Compatibility words

## Synopsis

`0<= ( a -- flag ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`0>= ( a -- flag ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`<= ( a b -- flag ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`>= ( a b -- flag ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`U<= ( a b -- flag ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`U>= ( a b -- flag ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`UMIN ( a b -- min ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`UMAX ( a b -- max ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`.VERSION ( -- ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`.CVERSION ( -- ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`LICENSE ( -- ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`WARRANTY ( -- ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`STRING, ( str len -- ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`PARSE, ( "chars&lt;"&gt;" -- ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`PARSE," ?=>? (` | `)`; | ?

`"FORTH"`;
?

`DEFINED ( "name" -- flag ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`[DEFINED] ( "name" -- flag ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`[UNDEFINED] ( "name" -- flag ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`(MARKER) ( str-ptr str-len -- ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

`ANEW ( 'name' -- ) ?=>? (` | `)`; | ?

`"FORTH"`;
?

## Description

0<= ( a -- flag ) => "FORTH"

      simulate    : 0&lt;= 0&gt; 0= ;

0>= ( a -- flag ) => "FORTH"

      simulate    : 0&gt;= 0&lt; 0= ;

<= ( a b -- flag ) => "FORTH"

      simulate    : &lt;= &gt; 0= ;

>= ( a b -- flag ) => "FORTH"

      simulate    : &gt;= &lt; 0= ;

U<= ( a b -- flag ) => "FORTH"

      simulate    : U&lt;= U&gt; 0= ;

U>= ( a b -- flag ) => "FORTH"

      simulate    : U&gt;= U&lt; 0= ;

UMIN ( a b -- min ) => "FORTH"

see `MIN` , `MAX` and `UMAX`

UMAX ( a b -- max ) => "FORTH"

see `MAX`

.VERSION ( -- ) => "FORTH"

show the version of the current PFE system

      : .VERSION [ ENVIRONMENT ] FORTH-NAME TYPE FORTH-VERSION TYPE ;

.CVERSION ( -- ) => "FORTH"

show the compile date of the current PFE system

      : .CVERSION [ ENVIRONMENT ] FORTH-NAME TYPE FORTH-DATE TYPE ;

LICENSE ( -- ) => "FORTH"

show a lisence info - the basic PFE system is licensed under the terms of the LGPL (Lesser GNU Public License) - binary modules loaded into the system and hooking into the system may carry another `LICENSE`

      : LICENSE [ ENVIRONMENT ] FORTH-LICENSE TYPE ;

WARRANTY ( -- ) => "FORTH"

show a warranty info - the basic PFE system is licensed under the terms of the LGPL (Lesser GNU Public License) - which exludes almost any liabilities whatsoever - however loadable binary modules may hook into the system and their functionality may have different WARRANTY infos.

STRING, ( str len -- ) => "FORTH"

Store a string in data space as a counted string.

      : STRING, HERE  OVER 1+  ALLOT  PLACE ;

PARSE, ( "chars&lt;"&gt;" -- ) => "FORTH"

Store a char-delimited string in data space as a counted string. As seen in Bawd's

      : ," [CHAR] " PARSE  STRING, ; IMMEDIATE

this implementation is much different from Bawd's

      : PARSE, PARSE STRING, ;

PARSE," - no description, sorry

DEFINED ( "name" -- flag ) => "FORTH"

Search the dictionary for _name_. If _name_ is found, return TRUE; otherwise return FALSE. Immediate for use in definitions.

This word will actually return what `FIND` returns (the NFA). does check for the word using find (so it does not throw like `'` ) and puts it on stack. As it is immediate it does work in compile-mode too, so it places its argument in the cs-stack then. This is most useful with a directly following `[IF]` clause, so that sth. like an `[IFDEF] word` can be simulated through `[DEFINED] word [IF]`

      : DEFINED BL WORD COUNT (FIND-NFA) ;

[DEFINED] ( "name" -- flag ) => "FORTH"

Search the dictionary for _name_. If _name_ is found, return TRUE; otherwise return FALSE. Immediate for use in definitions.

[DEFINED] word ( -- nfa|0 ) immediate does check for the word using find (so it does not throw like `'` ) and puts it on stack. As it is immediate it does work in compile-mode too, so it places its argument in the cs-stack then. This is most useful with a directly following `[IF]` clause, so that sth. like an `[IFDEF] word` can be simulated through `[DEFINED] word [IF]`

      : [DEFINED] BL WORD FIND NIP ; IMMEDIATE

[UNDEFINED] ( "name" -- flag ) => "FORTH"

Search the dictionary for _name_. If _name_ is found, return FALSE; otherwise return TRUE. Immediate for use in definitions.

see `[DEFINED]`

(MARKER) ( str-ptr str-len -- ) => "FORTH"

create a named marker that you can use to `FORGET` , running the created word will reset the dict/order variables to the state at the creation of this name.

      : (MARKER) (CREATE) HERE ,
              GET-ORDER DUP , 0 DO ?DUP IF , THEN LOOP 0 ,
              ...
        DOES&gt; DUP @ (FORGET)
              ...
      ;

ANEW ( 'name' -- ) => "FORTH"

creates a `MARKER` if it doesn't exist, or forgets everything after it if it does. (it just gets executed).

Note: in PFE the `ANEW` will always work on the `ENVIRONMENT-WORDLIST` which has a reason: it is never quite sure whether the same `DEFINITIONS` wordlist is in the search `ORDER` that the original `ANEW` `MARKER` was defined in. Therefore, `ANEW` would be only safe on systems that do always stick to `FORTH` `DEFINITIONS`. Instead we will `CREATE` the `ANEW` `MARKER` in the `ENVIRONMENT` and use a simple `SEARCH-WORDLIST` on the `ENVIRONMENT-WORDLIST` upon re-run.

      \ old
      : ANEW BL WORD   DUP FIND NIP IF EXECUTE THEN   (MARKER) ;
      \ new
      : ANEW
        PARSE-WORD  2DUP ENVIRONMENT-WORDLIST SEARCH-WORDLIST IF  EXECUTE  THEN
        GET-CURRENT &gt;R ENVIRONMENT-WORDLIST SET-CURRENT  (MARKER)  R&gt; SET-CURRENT ;

Prev? | Up | ?Next
pfe-core-ext? | Home | ?pfe-debug-ext