home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!att!allegra!alice!ark
- From: ark@alice.att.com (Andrew Koenig)
- Newsgroups: comp.lang.functional
- Subject: Re: Length of Arrays in SML
- Message-ID: <24561@alice.att.com>
- Date: 6 Jan 93 09:28:50 GMT
- Article-I.D.: alice.24561
- References: <C0ECE1.Ju@cs.dal.ca>
- Reply-To: ark@alice.UUCP ()
- Organization: AT&T Bell Laboratories, Murray Hill NJ
- Lines: 16
-
- In article <C0ECE1.Ju@cs.dal.ca> ssmith@ug.cs.dal.ca (Susan E Smith) writes:
-
- > PROBLEM: I am using Standard ML (New Jersey), Version 0.66 and I am trying
- > to use the Array function "length" to get the length of an array.
-
- The problem is that the built-in function "length" takes a list,
- as you found out. What you want is the "length" in the Array
- structure, which is therefore called Array.length:
-
- val My_Array = arrayoflist ["Hi","My","Name","Is","Bob"];
- Array.length My_Array;
-
- should print 5.
- --
- --Andrew Koenig
- ark@europa.att.com
-