📄 goop.htm
字号:
An exception is thrown if <kbd>DATA-TYPE</kbd> is not a class.</p>
<hr><p><pre><b>?STRUCTURE ( DATA-TYPE -- ADDRESS )</b></pre></p>
<p><kbd>ADDRESS</kbd> is the address of a cell that contains the size in
address units of structures with data type <kbd>DATA-TYPE</kbd>.
An exception is thrown if <kbd>DATA-TYPE</kbd> is not a structure.</p>
<hr><p><pre><b>@ ( BADDRESS -> SINGLE -- 2ND )</b></pre></p>
<p><kbd>2ND</kbd> is the content of the bit field stored at
address <kbd>BADDRESS -> SINGLE</kbd>. If the length of the bit field is
lower than the size of a cell, its value is extended with leading zero
bits.</p>
<hr><p><pre><b>@ ( BADDRESS -> SIGNED -- 2ND )</b></pre></p>
<p><kbd>2ND</kbd> is the content of the bit field stored at
address <kbd>BADDRESS -> SIGNED</kbd>. If the length of the bit field is
lower than the size of a cell, its value is sign extended.</p>
<hr><p><pre><b>@ ( BADDRESS -> FLAG -- 2ND )</b></pre></p>
<p><kbd>2ND</kbd> is the content of the bit field stored at
address <kbd>BADDRESS -> FLAG</kbd>. If the length of the bit field is
lower than the size of a cell, its value is extended to either
<kbd>FALSE</kbd> or <kbd>TRUE</kbd>.</p>
<hr><p><pre><b>ACCESS ( OBJ-SIZE "<spaces><em>name</em>" -- 1ST )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a space.
Find <em>name</em>. Replace the first word list in the search order with
the word list that combines the <kbd>PRIVATE</kbd> and <kbd>PROTECTED</kbd>
word lists of the class <em>name</em>. An exception is thrown
if <em>name</em> is not the name of a class <kbd>THIS-CLASS</kbd> is a
friend to.</p>
<hr><p><pre><b>ALIGNED ( STRUCT-SIZE -- 1ST )</b></pre></p>
<p><kbd>1ST</kbd> is the lowest value greater than or equal
to <kbd>STRUCT-SIZE</kbd> that can be divided by the number of
bits in a single cell.</p>
<p>Using <kbd>ALIGNED</kbd> in a class or structure definition causes
the next data member to be cell aligned.</p>
<hr><p><pre><b>APPEND-WORDLIST ( WID -- )</b></pre></p>
<p>Append the word list identified by <kbd>WID</kbd> to the end of
the search order. An exception is thrown if there are too many word
lists in the search order.</p>
<hr><p><pre><b>AND ( STRUCT-SIZE STRUCT-SIZE STRUCT-SIZE -- 1ST 2ND 3RD )</b></pre></p>
<p>Terminate a block of a union of data members within a structure or
class definition, and start a new one. <kbd>1ST</kbd> and <kbd>3RD</kbd>
are equal to the first <kbd>STRUCT-SIZE</kbd>. <kbd>2ND</kbd> is the
maximum of the second and the third <kbd>STRUCT-SIZE</kbd>.</p>
<hr><p><pre><b>AUTOTHIS ( "<spaces><em>name</em>" -- "<spaces><em>name</em>" )</b></pre></p>
<p>Save the input source specification.
Skip leading space delimiters.
Parse <em>name</em> delimited by a space.
Find <em>name</em> in the <kbd>AUTOTHIS</kbd> word list.
Restore the input source specification.
If <em>name</em> is not found, create a definition with this name and
the semantics given below in the <kbd>AUTOTHIS</kbd> word list.</p>
<p><em>name</em> Execution: <b><kbd>( -- )</kbd></b>
<br>Evaluate <kbd>THIS</kbd>. Remove the <kbd>AUTOTHIS</kbd> word list
from the search order, evaluate <em>name</em> and reappend
the <kbd>AUTOTHIS</kbd> word list to the search order.</p>
<hr><p><pre><b>AUTOTHIS ( -- )</b></pre></p>
<p>Replace the first word list in the search order with the
<kbd>AUTOTHIS</kbd> word list. An ambiguous condition exists if the
<kbd>AUTOTHIS</kbd> word list is used outside of a class definition.</p>
<p><kbd>AUTOTHIS</kbd> is a vocabulary.</p>
<p>Note: <kbd>AUTOTHIS</kbd> cannot be found by an ordinary dictionary
search, because it is hidden by a word with the same name and stack
diagram.</p>
<hr><p><pre><b>AUTOTHIS-LAST ( -- ADDRESS -> ADDRESS )</b></pre></p>
<p><kbd>ADDRESS -> ADDRESS</kbd> is the address of a cell that contains the
name field address of the most recent definition in the <kbd>AUTOTHIS</kbd>
word list.</p>
<hr><p><pre><b>AUTOTHIS-WORDLIST ( -- WID )</b></pre></p>
<p><kbd>WID</kbd> is the identifier of the word list that contains the
<kbd>AUTOTHIS</kbd> definitions of all classes.</p>
<hr><p><pre><b>BADDRESS ( STACK-DIAGRAM -- 1ST )</b></pre></p>
<p>When used in a stack diagram, specifies an input or output parameter
with data type <kbd>BADDRESS</kbd>.</p>
<hr><p><pre><b>BIT-FIELD ( ADDRESS -> SINGLE UNSIGNED UNSIGNED -- BADDRESS -> 2ND )</b></pre></p>
<p><kbd>BADDRESS -> 2ND</kbd> is the address of a bit field starting at the
bit position specified by the first <kbd>UNSIGNED</kbd>, of memory
address <kbd>ADDRESS -> SINGLE</kbd>. The length of the bit field is
specified by the second <kbd>UNSIGNED</kbd>.</p>
<hr><p><pre><b>BITS/AU ( -- UNSIGNED )</b></pre></p>
<p><kbd>UNSIGNED</kbd> is the number of bits in one address unit.</p>
<hr><p><pre><b>BMEMBER ( STRUCT-SIZE SINGLE UNSIGNED "<spaces><em>name</em>" -- 1ST )</b></pre></p>
<p>Perform the semantics of <kbd>AUTOTHIS</kbd> if <kbd>THIS-CLASS</kbd>
is a class.</p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a
space. Create a new definition for <em>name</em> with the execution semantics
defined below, and make it the latest definition. <kbd>1ST</kbd> is equal
to <kbd>STRUCT-SIZE</kbd> plus <kbd>UNSIGNED</kbd>.</p>
<p><em>name</em> is referred to as a <em>data member</em>. <kbd>BMEMBER</kbd>
allocates a bit field of data type <kbd>SINGLE</kbd> with <kbd>UNSIGNED</kbd>
bits in the structure or class <kbd>THIS-CLASS</kbd>.</p>
Execution: <b><kbd>( x -- BADDRESS -> SINGLE )</kbd></b>
<br><kbd>BADDRESS -> SINGLE</kbd> is the address of the bit field
of the structure or object <kbd>x</kbd>, that was allocated at
the time <em>name</em> was created.</p>
<hr><p><pre><b>BMEMBERS ( STRUCT-SIZE SINGLE UNSIGNED UNSIGNED "<spaces><em>name</em>" -- 1ST )</b></pre></p>
<p>Perform the semantics of <kbd>AUTOTHIS</kbd> if <kbd>THIS-CLASS</kbd>
is a class.</p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a
space. Create a new definition for <em>name</em> with the execution semantics
defined below, and make it the latest definition. <kbd>1ST</kbd> is equal
to <kbd>STRUCT-SIZE</kbd> plus the product of the first <kbd>UNSIGNED</kbd>
and the second <kbd>UNSIGNED</kbd>.</p>
<p><em>name</em> is referred to as a <em>data member</em>. <kbd>BMEMBERS</kbd>
allocates <kbd>UNSIGNED</kbd> (second <kbd>UNSIGNED</kbd>) bit fields of data
type <kbd>SINGLE</kbd> with <kbd>UNSIGNED</kbd> (first <kbd>UNSIGNED</kbd>)
bits in the structure or class <kbd>THIS-CLASS</kbd>.</p>
Execution: <b><kbd>( x -- BADDRESS -> SINGLE )</kbd></b>
<br><kbd>BADDRESS -> SINGLE</kbd> is the address of the first of
<kbd>UNSIGNED</kbd> (second <kbd>UNSIGNED</kbd>) bit fields of the
structure or object <kbd>x</kbd>, that were allocated at the time
<em>name</em> was created.</p>
<hr><p><pre><b>BODY ( VTABLE-SIZE -- OBJ-SIZE )</b></pre></p>
<p>Create a virtual member table with a size of <kbd>VTABLE-SIZE</kbd>
address units for the class <kbd>THIS-CLASS</kbd>.
Copy the tokens of the virtual members from the virtual member table
of the parent of <kbd>THIS-CLASS</kbd>, and initialize all additional
virtual members with the token of the dummy word <kbd>PURE-VIRTUAL</kbd>.
<kbd>OBJ-SIZE</kbd> is the size in bits of objects of the parent of
<kbd>THIS-CLASS</kbd>.</p>
<p><kbd>BODY</kbd> is used in the form
<kbd>CLASS <em>name</em> ... BODY ... ENDCLASS</kbd> to mark the beginning
of the body of a class definition. The body of a class definition starts
after the definition of the virtual members.</p>
<hr><p><pre><b>CALIGNED ( STRUCT-SIZE -- 1ST )</b></pre></p>
<p><kbd>1ST</kbd> is the lowest value greater than or equal
to <kbd>STRUCT-SIZE</kbd> that can be divided by the number of
bits in a character.</p>
<p>Using <kbd>CALIGNED</kbd> in a class or structure definition causes
the next data member to be character aligned.</p>
<hr><p><pre><b>CLASS ( "<spaces><em>name</em>" -- WID TUPLE -> WID VTABLE-SIZE )</b></pre></p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a space.
Find <em>name</em> and assign the data type with the name <em>name</em> to
<kbd>THIS-CLASS</kbd>. An exception is thrown if <em>name</em> is not a
class, or if the parent of <em>name</em> has not yet been defined.
Initialize the <kbd>AUTOTHIS</kbd> and the <kbd>PROTECTED</kbd> word lists
to their status at the end of the class definition of the parent of
<em>name</em>, and empty the <kbd>PRIVATE</kbd> word list. Append the
<kbd>AUTOTHIS</kbd> word list to the end of the search order.
<kbd>WID</kbd> is the identifier of the compilation word list.
<kbd>TUPLE -> WID</kbd> is a tuple containing the identifiers of the
word lists in the search order before <kbd>AUTOTHIS</kbd> was appended.
<kbd>VTABLE-SIZE</kbd> is the size in address units of the virtual member
table of the parent of <em>name</em>.</p>
<p><kbd>CLASS</kbd> is used in the form
<kbd>CLASS <em>name</em> ... BODY ... ENDCLASS</kbd> to start a class
definition.</p>
<hr><p><pre><b>CMEMBER ( STRUCT-SIZE SINGLE "<spaces><em>name</em>" -- 1ST )</b></pre></p>
<p>Perform the semantics of <kbd>AUTOTHIS</kbd> if <kbd>THIS-CLASS</kbd>
is a class.</p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a
space. Create a new definition for <em>name</em> with the execution semantics
defined below, and make it the latest definition. <kbd>1ST</kbd> is equal
to <kbd>STRUCT-SIZE</kbd> aligned to cell size, plus the number of bits
in one cell.</p>
<p><em>name</em> is referred to as a <em>data member</em>. <kbd>CMEMBER</kbd>
allocates one character for a data member of data type <kbd>SINGLE</kbd> in the
structure or class <kbd>THIS-CLASS</kbd>.</p>
Execution: <b><kbd>( x -- CADDRESS -> SINGLE )</kbd></b>
<br><kbd>CADDRESS -> SINGLE</kbd> is the address of the character size
data member of the structure or object <kbd>x</kbd>, that was allocated at
the time <em>name</em> was created.</p>
<hr><p><pre><b>CMEMBERS ( STRUCT-SIZE SINGLE UNSIGNED "<spaces><em>name</em>" -- 1ST )</b></pre></p>
<p>Perform the semantics of <kbd>AUTOTHIS</kbd> if <kbd>THIS-CLASS</kbd>
is a class.</p>
<p>Skip leading space delimiters. Parse <em>name</em> delimited by a
space. Create a new definition for <em>name</em> with the execution semantics
defined below, and make it the latest definition. <kbd>1ST</kbd> is equal
to <kbd>STRUCT-SIZE</kbd> aligned to character size, plus <kbd>UNSIGNED</kbd>
times the number of bits in one character.</p>
<p><em>name</em> is referred to as a <em>data member</em>. <kbd>CMEMBERS</kbd>
allocates <kbd>UNSIGNED</kbd> consecutive characters for data members of data
type <kbd>SINGLE</kbd> in the structure or class <kbd>THIS-CLASS</kbd>.</p>
Execution: <b><kbd>( x -- CADDRESS -> SINGLE )</kbd></b>
<br><kbd>CADDRESS -> SINGLE</kbd> is the address of the first of <kbd>UNSIGNED</kbd>
character size data members of the structure or object <kbd>x</kbd>, that
were allocated at the time <em>name</em> was created.</p>
<hr><p><pre><b>COPY ( OBJECT 1ST -- )</b></pre></p>
<p>Copy the contents of all data members of <kbd>OBJECT</kbd> to the data
members of <kbd>1ST</kbd>.</p>
<hr><p><pre><b>DELETE ( -- )</b></pre></p>
<p>Execution: <b><kbd>( OBJECT -- )</kbd></b>
<br>Execute the destructor of <kbd>OBJECT</kbd>. Return the chunk of contiguous
memory space occupied by <kbd>OBJECT</kbd> to the system for later allocation.
An ambiguous condition exists if <kbd>OBJECT</kbd> was not previously created
by <kbd>(NEW)</kbd>.
An exception is thrown if the memory space canot be returned.</p>
<p><kbd>DELETE</kbd> is an immediate word.</p>
<hr><p><pre><b>DELETE ( STRUCTURE -- )</b></pre></p>
<p>Return the chunk of contiguous memory space occupied by the structure
<kbd>STRUCTURE</kbd> to the system for later allocation. An ambiguous
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -