error takes just a string
svn: r16071
This commit is contained in:
parent
a58389ad20
commit
4ad2d25e1d
|
@ -464,7 +464,7 @@
|
|||
("Misc"
|
||||
(identity (any -> any)
|
||||
"to return the argument unchanged")
|
||||
((beginner-error error) (symbol string -> void) "to signal an error")
|
||||
((beginner-error error) (string -> void) "to signal an error")
|
||||
((beginner-struct? struct?) (any -> boolean)
|
||||
"to determine whether some value is a structure")
|
||||
((beginner-equal? equal?) (any any -> boolean)
|
||||
|
|
|
@ -184,15 +184,13 @@ namespace.
|
|||
(apply append a b x)))
|
||||
|
||||
(define-teach beginner error
|
||||
(lambda (sym str)
|
||||
(unless (and (symbol? sym)
|
||||
(string? str))
|
||||
(lambda (str)
|
||||
(unless (string? str)
|
||||
(raise
|
||||
(make-exn:fail:contract
|
||||
(format "error: expected a symbol and a string, got ~e and ~e"
|
||||
sym str)
|
||||
(format "error: expected a string, got ~e and ~e" str)
|
||||
(current-continuation-marks))))
|
||||
(error sym "~a" str)))
|
||||
(error str)))
|
||||
|
||||
(define-teach beginner struct?
|
||||
(lambda (x)
|
||||
|
|
Loading…
Reference in New Issue
Block a user