12345678910111213141516171819 |
- -- This example illustrates how to program TAIL and HEAD
- -- functions in RIGAL.
- #MAIN
- $E:=(. ALFA BETA GAMMA DELTA .);
- OPEN S ' '; -- Opens file S for output to the screen
- S<<$E;
- S<<'HEAD=' #HEAD($E);
- S<<'TAIL=' #TAIL($E);
- $W:=<. SEL1 : $E,
- SEL2 : #HEAD($E),
- SEL3 : #TAIL($E) .>;
- PRINT $W;
- ##
- #HEAD
- (. $E (* $A *) .) / RETURN $E / ##
- #TAIL
- (. $A (* $L!.:=$E *) .) /RETURN $L /##
|