EX1.RIG 437 B

12345678910111213141516171819
  1. -- This example illustrates how to program TAIL and HEAD
  2. -- functions in RIGAL.
  3. #MAIN
  4. $E:=(. ALFA BETA GAMMA DELTA .);
  5. OPEN S ' '; -- Opens file S for output to the screen
  6. S<<$E;
  7. S<<'HEAD=' #HEAD($E);
  8. S<<'TAIL=' #TAIL($E);
  9. $W:=<. SEL1 : $E,
  10. SEL2 : #HEAD($E),
  11. SEL3 : #TAIL($E) .>;
  12. PRINT $W;
  13. ##
  14. #HEAD
  15. (. $E (* $A *) .) / RETURN $E / ##
  16. #TAIL
  17. (. $A (* $L!.:=$E *) .) /RETURN $L /##