Re: Arrays

From: David Sletten (david_at_slytobias.com)
Date: 11/28/04


Date: Sun, 28 Nov 2004 22:36:26 GMT

Steven M. Haflich wrote:

> Not at all, but there was also a newbie motivation for my post.
>
> Arrays are very rich objects in CL. When a question is posed about
> copying some sort of object, or testing one for equality, there are
> unstated assumptions about the putpose of the copyu or the purpose
> of the test. The important thing for a newbie to learn is to make
> those assumptions explicit -- not only to c.l.l, but also to himself
> -- so the appropriate solution can be found.
>
> The copy-array solution in your link is sophisticated and elegant,
> but _not_ general. No single solution sould be general, at least,
> not without a zillion keyword arguments.
>
> There are lots of circumstances in which one might want to copy an
> array in CL, but one of the most common occurs when an adjustable
> fill-pointer vector (often a string) is used to collect an
> undetermined number of elements, and then when an entire entity has
> been collected, a copy is made into a fixed-length, simple vector.
> The Lisp reader does a lot of this when reading strings and symbols.
>
> Now, the cited copy-array wouldn't be the appropriate kind of copy
> for this application. When one selects machinery to copy comething,
> one needs to make explicit these sorts of possibilities in case they
> matter.

Fair enough. I see your point now. You're helping the newbie (and me)
understand there are questions he maybe didn't even realize needed to be
asked.

Thanks,
David Sletten



Relevant Pages

  • Re: Help with Array(s)
    ... I would think XML would return in something with an XML schema and you could ... Array.Sort sorts one-dimentional arrays, but don't think it will 2dim arrays ... to sort list by second int value and display. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: does C# have any collection objects that support sort functionality so that I dont have to writ
    ... the IComparable interface. ... Also, since arrays are strongly typed, you know that all elements are of the ... for ArrayLists. ... The Sort() method will utilize each object's IComparable ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: IsAnagram
    ... Sort both words and compare both arrays. ... So I am looking for the most efficient algorithm. ... Sort both sounds like the most efficient. ... array first. ...
    (comp.lang.c)
  • Re: Generic In-Place Sort
    ... > There is a bug in that you get an Access Violation if you sort an empty ... So with an empty array, ... specializations for sorting arrays of Integers and arrays of strings. ...
    (comp.lang.pascal.delphi.misc)