core_misc wordset

description

-- miscellaneous useful extra words for CORE-EXT

Copyright (C) Tektronix, Inc. 1998 - 2001. All rights reserved.

description: Compatiblity with former standards, miscellaneous useful words. ... for CORE-EXT

FORTH

0 ( .. )();
as:"zero";

( 0 )  constant 0

an ordinary constant (no special usage info)

FORTH

1 ( .. )();
as:"one";

( 1 )  constant 1

an ordinary constant (no special usage info)

FORTH

2 ( .. )();
as:"two";

( 2 )  constant 2

an ordinary constant (no special usage info)

FORTH

3 ( .. )();
as:"three";

( 3 )  constant 3

an ordinary constant (no special usage info)

FORTH

0<= ( a -- flag )();
p4:"zero-less-equal";

 simulate    : 0<= 0> 0= ;
 
FORTH
0>= ( a -- flag )(); 
 ;
 simulate    : 0>= 0< 0= ;
 
FORTH

<= ( a b -- flag )();
p4:"less-equal";

 simulate    : <= > 0= ;
 
FORTH

>= ( a b -- flag )();
p4:"greater-equal";

 simulate    : >= < 0= ;
 
FORTH

U<= ( a b -- flag )();
p4:"u-less-equal";

 simulate    : U<= U> 0= ;
 
FORTH

U>= ( a b -- flag )();
p4:"u-greater-equal";

 simulate    : U>= U< 0= ;
 
FORTH

UMIN ( a b -- min )();
p4:"u-min";

see MIN , MAX and UMAX

FORTH

UMAX ( a b -- max )();
p4:"u-max";

see MAX

FORTH

.VERSION ( -- )();
p4:"dot-version";

show the version of the current PFE system

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

.CVERSION ( -- )();
p4:"dot-date";

show the compile date of the current PFE system

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

.PFE-DATE ( .. )();
as:"dot-pfe-minus-date";

forthword synonym .PFE-DATE

is doing the same as .CVERSION

this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.

FORTH

LICENSE ( -- )();
p4:"license";

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 ;
 
FORTH

WARRANTY ( -- )();
p4:"warranty";

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.

FORTH

STRING, ( str len -- )();
p4:"string-comma";

Store a string in data space as a counted string.

 : STRING, HERE  OVER 1+  ALLOT  PLACE ;
 
FORTH
PARSE, ( "chars<">" -- )(); 
 ;

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, ;
 
FORTH
PARSE," ( "chars<">" -- )(); 
 ;

Store a quote-delimited string in data space as a counted string.

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

implemented here as

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

[VOID] ( .. )();
as:"bracket-void";

( 0 )  constant [VOID]

an immediate constant (no special usage info)

FORTH

DEFINED ( .. )();
as:"defined";

ordinary primitive DEFINED

an executable word (no special usage info)

or wrapper call around p4_defined

FORTH
[DEFINED] ( [name] -- flag )(); 
 ;

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] DEFINED ; IMMEDIATE
 : [DEFINED] BL WORD COUNT (FIND-NFA) ; IMMEDIATE
 
FORTH
[UNDEFINED] ( [name] -- flag )(); 
 ;

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

see [DEFINED]

 : [UNDEFINED] DEFINED 0= ; IMMEDIATE