[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.8.1 General Operations

81F18 &COMP ( comp comp' → comp" )
Concatenates two composites.
81E96 >TCOMP ( comp ob → comp+ob )
Adds ob to tail (end) of composite.
81E8C >HCOMP ( comp ob → ob+comp )
Adds ob to head (beginning) of composite.
819A0 CARCOMP ( comp → ob_head )
( comp_null → comp_null )
Returns first object of the composite, or a null composite if the argument is a null composite.
83BEC ?CARCOMP ( comp T → ob )
( comp F → comp )
If the flag is TRUE, does CARCOMP.
81EA0 CDRCOMP ( comp → comp-ob_head )
( comp_null → comp_null )
Returns the composite minus its first object, or a null composite if the argument is a null composite.
819AA LENCOMP ( comp → #n )
Returns length of composite (number of objects).
83CA0 DUPLENCOMP ( comp → comp #n )
Does DUP then <REF>LENCOMP.
819B4 NULLCOMP? ( comp → flag )
If the composite is empty, returns TRUE.
83C8C DUPNULLCOMP? ( comp → comp flag )
Does DUP then <REF>NULLCOMP?.
819AF NTHELCOMP ( comp #i → ob T )
( comp #i → F )
Returns specified element of composite and TRUE, or just FALSE if it could not be found.
8360B NTHCOMPDROP ( comp #i → ob )
Does <REF>NTHELCOMP then DROP.
8378C NTHCOMDDUP ( comp #i → ob ob )
Does <REF>NTHCOMPDROP then DUP.
81EDC POSCOMP ( comp ob pred → #i )
( comp ob pred → #0 )
(eg: pred = ' %<)
Evaluates pred for all elements of composite and ob, and returns index of first object for which the pred is TRUE. If no one returned TRUE, returns #0. For example, the program below returns #4:
:: { %1 %2 %3 %-4 %-5 %6 %7 } %0
' %< POSCOMP ;
84A6F EQUALPOSCOMP ( comp ob → #pos )
( comp ob → #0 )
POSCOMP with EQUAL as test.
81EBE EQUALPOSCMP ( comp ob → #pos )
( comp ob → #0 )
84A88 NTHOF ( ob comp → #i )
( ob comp → #0 )
Does SWAP then <REF>EQUALPOSCOMP.
84A56 #=POSCOMP ( comp # → #i )
( comp # → #0 )
POSCOMP with #= as test.
819B9 SUBCOMP ( comp #m #n → comp' )
Returns a sub-composite. Makes all index checks first.
81392 Embedded? ( ob1 ob2 → flag )
Returns TRUE if ob2 is embedded in, or is the same as, ob1. Otherwise returns FALSE.
81EC8 Lookup ( ob test comp → nextob T )
( ob test comp → ob F )
Tests every odd element (1,3,...) in the composite. If a test returns TRUE, the object after the tested one is returned, along with TRUE. If no object tests TRUE, FALSE is returned. For example, the program below returns %6 and TRUE.
:: %0 ' %<
{ %1 %2 %3 %-4 %-5 %6 }
Lookup ;
81ED2 Lookup.1 ( ob test → nextob T )
( ob test → ob F )
Return Stack:
( comp → )
Lookup with the composite already pushed (with >R) onto the runstream. Called by Lookup.
84A9C EQLookup ( ob comp → nextob T )
( ob comp → ob F )
Lookup with EQ as test.
81B35 NEXTCOMPOB ( comp #ofs → comp #ofs' ob T )
( comp #ofs → comp F )
Returns object at specified nibble offset from start. If the object is SEMI (i.e., the end of the composite has been reached) returns FALSE. To get the first element, use FIVE as offset value (to skip the prolog). ZERO works as well.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Carsten Dominik on May, 30 2005 using texi2html