minor edits

This commit is contained in:
sforman 2023-10-20 22:16:21 -07:00
parent 0fcd217f2c
commit 3e72ce494a
1 changed files with 10 additions and 11 deletions

View File

@ -257,8 +257,7 @@
(if (not (eof-object? text)) (if (not (eof-object? text))
(receive (stack dict) (receive (stack dict)
(handle-exceptions exn (handle-exceptions exn
(begin (display exn) (newline) (begin (display exn) (newline) (values stack0 dict0))
(values stack0 dict0))
(joy stack0 (text->expression text) dict0)) (joy stack0 (text->expression text) dict0))
(print (joy-expression->string (reverse stack))) (print (joy-expression->string (reverse stack)))
(main-loop stack dict)) (main-loop stack dict))
@ -278,18 +277,18 @@
; Importing srfi-67 did not actually make available symbol-compare. Boo! ; Importing srfi-67 did not actually make available symbol-compare. Boo!
(define (symbol<? a b) (string<? (symbol->string a) (symbol->string b))) ;(define (symbol<? a b) (string<? (symbol->string a) (symbol->string b)))
; a BTree is a four-tuple of (name value left right) | () ; a BTree is a four-tuple of (name value left right) | ()
(define (btree-get key btree) ;(define (btree-get key btree)
(match btree ; (match btree
(() (abort "Key not found.")) ; (() (abort "Key not found."))
((k value left right) ; ((k value left right)
(if (eq? key k) ; (if (eq? key k)
value ; value
(btree-get key (if (symbol<? key k) left right)))) ; (btree-get key (if (symbol<? key k) left right))))
(_ (abort "Not a BTree.")))) ; (_ (abort "Not a BTree."))))