10.6.2.1518 FIELD: field-colon FACILITY EXT

( n1 "<spaces>name" -- n2 )

Skip leading space delimiters. Parse name delimited by a space. Offset is the first cell aligned value greater than or equal to n1. n2 = offset + 1 cell.

Create a definition for name with the execution semantics given below.

name Execution:

( addr1 -- addr2 )

Add the offset calculated during the compile-time action to addr1 giving the address addr2.

See:

Rationale:

Create an aligned single-cell field in a data structure.

The various xFIELD: words provide for different alignment and size allocation.

The xFIELD: words could be defined as:

    : FIELD:    ( n1 "name" -- n2 ; addr1 -- addr2 )          ALIGNED 1 CELLS +FIELD ;
    : CFIELD:   ( n1 "name" -- n2 ; addr1 -- addr2 )          1 CHARS   +FIELD ;
   : FFIELD:   ( n1 "name" -- n2 ; addr1 -- addr2 )          FALIGNED 1 FLOATS +FIELD ;
    : SFFIELD:  ( n1 "name" -- n2 ; addr1 -- addr2 )          SFALIGNED 1 SFLOATS +FIELD ;
    : DFFIELD:  ( n1 "name" -- n2 ; addr1 -- addr2 )          DFALIGNED 1 DFLOATS +FIELD ;

ContributeContributions