caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Matt Gushee <mgushee@havenrock.com>
To: caml-list@pauillac.inria.fr
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Really confused - repost
Date: Thu, 3 Apr 2003 19:27:30 -0700	[thread overview]
Message-ID: <20030404022730.GA17836@swordfish> (raw)
In-Reply-To: <3e8cd864.72ae.19774@gis.net>

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 students.ml, 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:

    [|"Phred","Sue"|]

with

    { 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
mgushee@havenrock.com           its fields;
http://www.havenrock.com/   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                                
                            --Lao Tzu (Peter Merel, trans.)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2003-04-04  2:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-04  0:57 Ryan Bastic
2003-04-04  2:27 ` Matt Gushee [this message]
2003-04-04  3:21 ` Karl Zilles
2003-04-04  3:28   ` Karl Zilles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030404022730.GA17836@swordfish \
    --to=mgushee@havenrock.com \
    --cc=caml-list@inria.fr \
    --cc=caml-list@pauillac.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).