add some error checking for custom set type constructors

This commit is contained in:
Robby Findler 2015-12-28 16:58:35 -06:00
parent 50405a2ca9
commit ff31b01505

View File

@ -866,6 +866,8 @@
(define (immutable-custom-set-maker spec name)
(define (proc [st '()])
(unless (stream? st)
(raise-argument-error name "stream?" st))
(dprintf "~a\n" name)
(define table
(for/fold ([table (make-immutable-hash)]) ([x (in-stream st)])
@ -876,6 +878,8 @@
(define (imperative-custom-set-maker spec name make-table make-set)
(define (proc [st '()])
(unless (stream? st)
(raise-argument-error name "stream?" st))
(dprintf "~a\n" name)
(define table (make-table))
(for ([x (in-stream st)])