Common Lisp Hyperspec, Functions & Typechecking 
Author Message
 Common Lisp Hyperspec, Functions & Typechecking

I've been digging through the Common Lisp Hyperspec and "Common Lisp,
the Language, 2nd Edition" and I was wondering if someone could
clarify something for me.  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?  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?

If that information is somewhere in the Hyperspec, please point me to
it.

John Boozer



Tue, 26 Apr 2005 02:52:40 GMT  
 Common Lisp Hyperspec, Functions & Typechecking

Quote:

> 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.

Quote:
> 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.

Quote:
> 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



Tue, 26 Apr 2005 03:13:47 GMT  
 Common Lisp Hyperspec, Functions & Typechecking

Quote:
> You surely mean ``an input stream designator.  NIL is fine, for
> instance.

Hmm, really?  What do you get when you pass NIL to read?

Quote:
> 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!


Tue, 26 Apr 2005 07:39:08 GMT  
 Common Lisp Hyperspec, Functions & Typechecking

Quote:
> Hmm, really?  What do you get when you pass NIL to read?

Oh, never mind.  Found it.


Tue, 26 Apr 2005 07:46:31 GMT  
 Common Lisp Hyperspec, Functions & Typechecking

Quote:

> Hmm, really?  What do you get when you pass NIL to read?

*standard-input*.  Read the hyperspec.

Jeremy.



Tue, 26 Apr 2005 07:46:26 GMT  
 Common Lisp Hyperspec, Functions & Typechecking
On Thu, 7 Nov 2002 18:39:08 -0500, "John Boozer"

Quote:

>> 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

Quote:
> (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)



Wed, 27 Apr 2005 11:39:39 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Common Lisp HyperSpec

2. common-lisp-hyperspec-symbol-table

3. Common Lisp Hyperspec: Error loading index applet

4. Common Lisp HyperSpec(TM) now available

5. Sun Common Lisp & Foreign functions

6. Common Lisp: passing a function to a function and applying it

7. What I want from my Common Lisp vendor and the Common Lisp community

8. lucid common lisp -- C -- Common lisp intercallability

9. Lucid (Sun) Common Lisp vs Allegro (Franz) Common Lisp - the Summary

10. Lucid (Sun) Common Lisp vs Allegro (Franz) Common Lisp

11. Sun Common Lisp vs. Allegro Common Lisp

12. Function Overloading Without Typechecking

 

 
Powered by phpBB® Forum Software