Dolphin 4.0 is terrific. Really like the new Education Centre. Great
job.
While trying out the tutorial on ODBC:
c := (DBConnection new)
dsn: 'NWind';
uid: 'Tony';
pwd: 'alpha';
connect.
rs := c query: 'select * from Orders'.
rs collect: [:x | x ShipName].
signals a <MessageNotUnderstood> exception for Array>>#addLast:.
DBResultSet >> collect: transformer
"Evaluate the <monadicValuable> argument, transformer, for
each of the receiver's elements in the order defined by the receiver's
implementation of #do:.
Answer a new collection like the receiver containing the
values returned by transformer on each evaluation.
Implementation Note: Override back to Collection
implementation because superclass implementation needs exact #size,
which can be slow against DBResultSets."
| answer |
answer := self copyEmpty.
self do: [:elem | answer addLast: (transformer value: elem)].
^answer
Either of the following works. The OrderedCollection fix is slightly
faster but the WriteStream fix answers a result of the receiver's
species.
| answer |
answer := OrderedCollection new: self approxSize.
self do: [:elem | answer addLast: (transformer value: elem)].
^answer
| ansStrm |
ansStrm := WriteStream with: (self species new).
self do: [:elem | ansStrm nextPut: (transformer value: elem)].
^ansStrm contents
--
Richard A. Harmon "The only good zombie is a dead zombie"
[hidden email] E. G. McCarthy