From: jh
Subject: variant records
Date: 
Message-ID: <8be10$44fb448e$50db56aa$1010@news.hispeed.ch>
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
--

From: Pascal Costanza
Subject: Re: variant records
Date: 
Message-ID: <4m13nsF3sshtU1@individual.net>
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/
From: HL
Subject: Re: variant records
Date: 
Message-ID: <868xkwb4c0.fsf@agora.my.domain>
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.