2d unique arrays
Alexander Sczyrba
asczyrba@TechFak.Uni-Bielefeld.DE
Wed, 6 Nov 1996 09:01:10 +0100
> X-Authentication-Warning: sisyphus.cs.kun.nl: clean set sender to clean-request@cs.kun.nl using -f
agold@mailserv.bga.com wrote:
>
> Hey folks:
>
> In an attempt to work with unique multi-dimensional arrays, I figured I'd
> start with the 2d case...
>
> Consider the following code:
>
> ::*Matrix a :== *{Row a}
> ::*Row a :== *{#a}
>
> ::Coord :== (Int,Int)
>
> GetF::Coord (Matrix a)->(a,Matrix a) | ArrayElem a
> GetF (i,j) s = (x,s``)
> where
> (r,s`) = uselect s i
> (x,r`) = uselect_u r j
> s`` = update s` i r`
>
> It doesn't compile (if it did, I guess there would be no question
> here...:-) ) and gives the msg:
>
> Type error : conflicting uniqueness information due to argument 1 of
> uselect ({})
>
> Has anyone any insight as to what's going on???
>
> Many thanks,
>
> --Artie
>
>
> Arthur Gold Austin, Texas
> -------------------------------------------------------
> | agold@bga.com agold@cs.utexas.edu ArtieGold@aol.com |
> -------------------------------------------------------
> "If not now, when?"
>
>
Hi Arthur!
I had the same problem with multidimensional arrays. The clean support told me
that an update of a multidimensional array is not yet possible, but it will be
possible with the next version of Clean.
So I decided to solve my problem by using 1-dim. arrays using an appropriate
indexing method.
Regards,
Alexander
--
+-----------------------------------+
| Alexander Sczyrba |
| |
| e-mail: |
| asczyrba@techfak.uni-bielefeld.de |
| University of Bielefeld, Germany |
+-----------------------------------+