Plan 9 from Bell Labs’s /usr/web/sources/contrib/fgb/root/sys/src/cmd/4th/lib/pickroll.4th

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


\ 4tH library - ROLL/PICK (CORE EXT) - Copyright 2003,2004 J.L. Bezemer
\ You can redistribute this file and/or modify it under
\ the terms of the GNU General Public License

[UNDEFINED] ROLL [IF]
DEFER TURN

: (ROLL) ;
: (PICK) OVER SWAP ;

: DIG
  IS TURN
  DUP BEGIN DUP WHILE ROT >R 1- REPEAT DROP TURN 
      BEGIN DUP WHILE R> -ROT 1- REPEAT DROP
;

: ROLL ['] (ROLL) DIG ; ( nx n2 n1 n0 x -- n2 n1 n0 nx)
: PICK ['] (PICK) DIG ; ( nx n2 n1 n0 x -- nx n2 n1 n0 nx)

[DEFINED] 4TH# [IF]
hide TURN
hide (ROLL)
hide (PICK)
hide DIG
[THEN]
[THEN]

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.