Jump to content

Constrained genericity: Difference between revisions

(entry for common lisp, with disclaimers)
Line 125:
 
=={{header|Common Lisp}}==
 
The technique used here is like that in the [[Abstract type]] task.
 
The task says that this task is only for statically typed languages, and Common Lisp is dynamically typed. However, there are many places where type declarations can be provided to the compiler, and there is user access to the type system (e.g., a user can ask whether an object is of a particular type). Via the latter mechanism, one could write a class containing a collection such that the insert method checked that the object to be inserted is of an appropriate type.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.