Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Really confused - repost
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-04-04 (02:27)
From: Matt Gushee <mgushee@h...>
Subject: Re: [Caml-list] Really confused - repost
On Thu, Apr 03, 2003 at 07:57:08PM -0500, Ryan Bastic wrote:
>   it should be fairly clear what i'm trying to do... i want to split up
> the vector
> of student names into varying-sized groups, preferably using arrays of
> arrays, but any other data structure will do :-) 
> if you try executing, you'll see on line 68 there is a
> problem...
> can anyone point me in the direction as to what's going on??

Sure. What you are doing here

    !groups.(!q) := ar;

is trying to assign an array ref as the *value* of a ref. In other
words, you're trying to replace something like:



    { contents = [|"Karla","Hans"|] }

which is obviously a different type ( string array ref instead of string
array). I think what you want to do is
    !groups.(!q) <- ar;

The revised version is replacing an array element (which is a ref) with
a new ref.

Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through           its fields;   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                            --Lao Tzu (Peter Merel, trans.)

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: