[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Current practice:argument types in function declarations
- To: masinter.PA@Xerox.COM
- Subject: Re: Current practice:argument types in function declarations
- From: Brad Miller <miller@ACORN.CS.ROCHESTER.EDU>
- Date: Thu, 17 Dec 87 03:05 EST
- Cc: firstname.lastname@example.org
- In-reply-to: <871216-013219-2778@Xerox>
- Organization: University of Rochester, Department of Computer Science
- Phone: 716-275-1118
- Postal-address: 401A CS Building, Computer Science Department, University of Rochester, Rochester NY 14627
- Reply-to: email@example.com
- Sender: firstname.lastname@example.org
Date: 16 Dec 87 1:32:02 PST
Does anyone *have* any Common Lisp code which contains such declarations? What
is the intent of the declarations, other than as documentation?
All the code I write has such delcarations, including for the types of all
returned values. The immediate purpose is documentation since it's ignored on
the machine I happen to work on (a symbolics) but it's my hope that in future
the compiler/interpreter would complain about calls to the function that pass
the wrong type of argument at compile time, if it can tell. (runtime would
depend on OPTIMIZE SAFETY or some such, and probably local declarations inside
the defun or whatever).
Also, it could be used as a note to the debugger, since it could flag that an
argument was of an unexpected type if some other problem arises and it gets
invoked. (this would help track down the error).
But I'm a user, not an implementor: this is just what I hope to eventually get
out of it. As I said, right now it's just documentation so the next guy knows
what I expected the function to handle when I wrote it.
University of Rochester Computer Science Department