<PRIVATE
Factor handbook » The language » Syntax » Parse-time word lookup » Private words

Next:PRIVATE>


Vocabulary
syntax

Syntax

<PRIVATE ... PRIVATE>



Word description
Begins a block of private word definitions. Private word definitions are placed in the current vocabulary name, suffixed with .private.

Notes
The following is an example of usage:

IN: factorial <PRIVATE : (fac) ( accum n -- n! ) dup 1 <= [ drop ] [ [ * ] keep 1 - (fac) ] if ; PRIVATE> : fac ( n -- n! ) 1 swap (fac) ;


The above is equivalent to:

IN: factorial.private : (fac) ( accum n -- n! ) dup 1 <= [ drop ] [ [ * ] keep 1 - (fac) ] if ; IN: factorial : fac ( n -- n! ) 1 swap (fac) ;



See also
PRIVATE>

Definition