Henry, I have been getting away with #doubleAt: and #doubleAt:put:, and otherwise doing pretty much what you said, though I just use a byte array to hold the data. It seems to work; for FFI, I end up passing void pointers instead of double pointers, which I don't like doing.
Your point about using ordinary arrays makes sense to a point, though even w/o external interfacing, there is still a use for DoubleArray just as there is a use for String vs. an array of characters. Bill ________________________________________ From: [email protected] [[email protected]] On Behalf Of Henrik Sperre Johansen [[email protected]] Sent: Wednesday, September 22, 2010 5:23 PM To: [email protected] Subject: Re: [Pharo-project] DoubleArray On 22.09.2010 23:09, Schwab,Wilhelm K wrote: > Squeak, deliberately, does not have a double array class. Is that because > there is some horrible reason it can't work, or because it won't work on > certain platforms? If the goal is to pass it as a parameter to an external function, one way would be to subclass WordArray, storing(and reading) each Float in two elements, and have the endianness decided by Smalltalk endianness. Probably want a startUp method for the class to swap instances endianness if the platform has changed as well. > Put another way, should we add such a class, if only via an external heap or > whatever would be needed to make it reliable? > > Bill More likely because no one has actually had a need for one. It's definitely not _needed_ in base, where normal arrays of floats would do the same job just as well, if not better. IMHO, if someone makes one, it so should probably be part of a package related to external interfacing. Cheers, Henry _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
