Re: arrays and type variables...

From: Andreas Rossberg (rossberg@ps.uni-sb.de)
Date: Thu Nov 26 1998 - 17:03:57 MET


Date: Thu, 26 Nov 1998 17:03:57 +0100
From: Andreas Rossberg <rossberg@ps.uni-sb.de>
To: caml-list@inria.fr
Subject: Re: arrays and type variables...

Don Syme wrote:
>
> Shouldn't "[| [] |]" count as a value??
>
> # let x = [| [] |];;
> val x : '_a list array = [|[]|]
> # let x = [];;
> val x : 'a list = []
> # let x = [| |];;
> val x : 'a array = [||]

No, because you can assign to arrays:

# let x = [| [] |];;
val x : '_a list array = [|[]|]
# x.(0) <- [1];;
- : unit = ()
# x;;
- : int list array = [|[1]|]

You cannot assign anything to the empty array [| |], however.

Regards,

        - Andreas

-- 
Andreas Rossberg, rossberg@ps.uni-sb.de

:: be declarative. be functional. just be. ::



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:17 MET