Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
592B

  1. ( Words useful for complex comparison operations )
  2. : >= < NOT ;
  3. : <= > NOT ;
  4. ( n1 -- n1 true )
  5. : <>{ 1 ;
  6. ( n1 f -- f )
  7. : <>} SWAP DROP ;
  8. : _|&
  9. ( n1 n2 cell )
  10. >R >R DUP R> R> ( n1 n1 n2 cell )
  11. @ EXECUTE ( n1 f )
  12. ;
  13. ( n1 f n2 -- n1 f )
  14. : _|
  15. CREATE , DOES>
  16. ( n1 f n2 cell )
  17. ROT IF 2DROP 1 EXIT THEN ( n1 true )
  18. _|&
  19. ;
  20. : _&
  21. CREATE , DOES>
  22. ( n1 f n2 cell )
  23. ROT NOT IF 2DROP 0 EXIT THEN ( n1 true )
  24. _|&
  25. ;
  26. ( All words below have this signature:
  27. n1 f n2 -- n1 f )
  28. ' = _| |=
  29. ' = _& &=
  30. ' > _| |>
  31. ' > _& &>
  32. ' < _| |<
  33. ' < _& &<