boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

11-compare.scm (564B)


      1 ;; Step-10c numeric comparison primitives: = < > <= >=.
      2 ;;
      3 ;; All binary; result is #t or #f (step-10c singletons). The ladder
      4 ;; nests #t-guards and witnesses the #f-side by inverting with a `0`
      5 ;; tail, so a primitive that returns the wrong singleton short-circuits.
      6 (if (= 5 5)
      7   (if (< 3 5)
      8     (if (> 5 3)
      9       (if (<= 5 5)
     10         (if (<= 4 5)
     11           (if (>= 5 5)
     12             (if (>= 6 5)
     13               (if (if (= 5 6) 0 1)
     14                 (if (if (< 5 3) 0 1)
     15                   (if (if (>= 3 5) 0 1)
     16                     42 0) 0) 0) 0) 0) 0) 0) 0) 0) 0)