> I'm trying to figure out what type-checking is required in the
> standard Lisp functions. + and * say "might signal type-error if
> some argument is not a number". Functions like read give no
> clarification on type-checking the arguments. What is required of a
> conforming implementation if read is passed an object that isn't a
> stream as its first parameter?
You surely mean ``an input stream designator´´. NIL is fine, for
instance.
> In general, what is required of a conforming implementation if a
> function seems to be expecting a particular type, but the
> specification doesn't mention signaling a type-error?
It can do anything it likes, including crashing the system or making
demons fly out of your nose.
> If that information is somewhere in the Hyperspec, please point me
> to it.
Read 1.4.4.3 The ``Arguments and Values'' Section of a Dictionary
Entry.
In general, the behavior of an implementation will depend on the
speed, safety and debug settings you use in your declarations.
You might also be interested in
1.4.2 Error Terminology
Regards,
--
Nils Gösche
"Don't ask for whom the <CTRL-G> tolls."
PGP key ID 0x0655CFA0
Hmm, really? What do you get when you pass NIL to read?
> Read 1.4.4.3 The ``Arguments and Values'' Section of a Dictionary
> Entry.
Oh yippee, that's just what I was looking for. Thanks!
Oh, never mind. Found it.
*standard-input*. Read the hyperspec.
Jeremy.
>> You surely mean ``an input stream designator创. NIL is fine, for
>> instance.
>
>Hmm, really? What do you get when you pass NIL to read?
>
;;; Using Allegro
> (read nil)
6
6
>
;;; Using Corman
(read nil)
;;; An error occurred in function READ-EXPRESSION:
;;; Error: Expected an input character stream, got NIL
(Which is, presumably, a bug)