boot2

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

016-cond.scm (644B)


      1 ; First-truthy clause wins; subsequent clauses are not evaluated.
      2 
      3 ; No-match-no-else: scheme1 returns UNSPEC. LISP.md does not pin this,
      4 ; so the checks below guard the current behavior -- a change should be
      5 ; deliberate. UNSPEC is a singleton, so two such results are eq?, and
      6 ; it is distinguishable from any other value via eq?.
      7 (if (eq? (cond (#f 1)) (cond (#f 2))) 0 (sys-exit 1))
      8 (if (not (eq? (cond (#f 1)) #t))      0 (sys-exit 2))
      9 (if (not (eq? (cond (#f 1)) #f))      0 (sys-exit 3))
     10 (if (not (eq? (cond (#f 1)) 0))       0 (sys-exit 4))
     11 (if (not (eq? (cond (#f 1)) '()))     0 (sys-exit 5))
     12 
     13 (sys-exit (cond (#f 1) (#t 33) (#f 2)))