Re: list, vectors, and stucts



Let's simplify the question:
Is there anyway to make-array and specify all of the initial values
without having to make any intermediate data structures like lists?

On Mar 1, 1:14 pm, "S. Robert James" <srobertja...@xxxxxxxxx> wrote:
My algorithm uses lots of (never modified) 3 element lists of small (<
2^8) pos. integers.

Originally, I implemented these as lists. I switched to defstruct to
improve speed. Looking at the dissasembly, I see that access is quick
as can be, but that creating them still involves some expensive calls
to the generic structure creation routines.

I'd like to try implementing them as short arrays. However,
(vector 3 4 2)
creates arrays of simple-vector, which performs _much_ slower - I
assume since it doesn't know that the elements are integers.

I've tried:
(make-array 3 :element-type '(unsigned-byte 8) (vector a b c))
but that doesn't seem to work right either.

What's the right way to create these structures efficiently?


.



Relevant Pages

  • GNU Gengetopt 2.22
    ... GNU Gengetopt generates a C function that uses getopt_long function ... (the user can specify those options manually) ... The following mailing lists are available: ...
    (gnu.announce)
  • Re: Factor
    ... emphasis on idiomatic programming is the greatest challenge. ... it sure is nice when a language gives you a rich and ... flexible set of data structures and algorithms that are designed so ... There is no reason to believe that my implementation of lists is ...
    (comp.lang.forth)
  • Re: averages
    ... using data structures rather the arrays. ... I am kinda struggling with binary search trees right now. ... I chose linked lists because they are simple and they are conceptualy ... similar to arrays except that they make memory management easier. ...
    (comp.lang.c)
  • Re: List/Collection/Array Selection - Memory Issues
    ... What kind of "matching" are you doing between "dimension members"? ... It's not clear what kind of searching it is you're trying to do, nor how the data structures that you've shown us enable that searching. ... you would store in a dictionary lists of individual data elements corresponding to the discrete values (used as keys for the dictionary). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Another @ Get command reference
    ... >> automatically generates the commands that create lists. ... >> FoxPro window, ... >> on the current font. ... >> If the font you specify is not available, ...
    (microsoft.public.fox.helpwanted)