Version française
Home     About     Download     Resources     Contact us    
Browse thread
how can I express empty element?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Rajchenbach-Teller <David.Teller@e...>
Subject: Re: [Caml-list] how can I express empty element?
No, that's not possible. :: is an algebraic constructor, which means,
among other things, that it accepts no neutral element (well, except
when the list is infinite, but that's probably not what you're looking
for).

Cheers,
 David

On Sun, 2009-03-08 at 22:59 -0500, Su Zhang wrote:
> Hi all,
>  
> I have a question on ocaml, is there a way to write a empty element
> say a which can make a::ax=ax ? I tried to find out in library, yet I
> didn't get the right way out, and it doesn't work if I make a=[], so
> do you know whether there is a technique can realize this function?
> I've got stuck on this point for a very long time.
>  
> thanks
> 
> -- 
> Su Zhang
> PHD Student 
> Computer Information and Science
> Kansas State University 
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
-- 
David Teller-Rajchenbach
 Security of Distributed Systems
  http://www.univ-orleans.fr/lifo/Members/David.Teller
   « Ce matin Un crétin A tué un chercheur. » (air connu)
   Latest News of French Research: System being liquidated. Researchers angry.