minor edits
This commit is contained in:
parent
0fcd217f2c
commit
3e72ce494a
|
|
@ -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."))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue