Is there a lib for common lisp which provides ML like variant types?
I've only found one for chicken scheme
http://www.call-with-current-continuation.org/eggs/datatype.html
thanks
jonathan
--
jh wrote:
> Is there a lib for common lisp which provides ML like variant types?
>
> I've only found one for chicken scheme
> http://www.call-with-current-continuation.org/eggs/datatype.html
Use CLOS classes and subclassing, or structs and structure inclusion
(both pretty much the same concept), and then use TYPECASE to
distinguish between different types of objects. Defining some
convenience macros to make this look closer to variant records should be
straightforward. (In a dynamically typed language, it's not so important
to guarantee a closed sum type...)
And before Kenny shoots me again: Think about removing the TYPECASE
statements and switching to generic functions instead. ;)
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
jh <······@nospamdrugphish.ch> writes:
> Is there a lib for common lisp which provides ML like variant types?
>
> I've only found one for chicken scheme
> http://www.call-with-current-continuation.org/eggs/datatype.html
>
> thanks
> jonathan
> --
Hi Jonathan --
If you want ML + Lisp, try the Qi programming language. It's
written in Common Lisp and implements an "ML-type type system."
HTH.
H.