mysql+seaside squeak beginners question

Ragnar Hojland Espinosa ragnar at linalco.com
Fri Jul 19 09:19:16 UTC 2002


On Thu, Jul 18, 2002 at 10:13:08AM -0400, Bob Arning wrote:
> On Thu, 18 Jul 2002 15:44:02 +0200 Ragnar Hojland Espinosa <ragnar at linalco.com> wrote:
> >smalltalk it took me a bit to figure out how to do this, but my solution
> >looks extremelly wasteful.

> What, in particular, strikes you as wasteful?

What you described below.. having to create a dictionary for each row.  But
at least the data stays atomically meaningful.

> Here are a few thoughts:
> ==========
>         c collect: [ :col |
>                 "value _ r valuedName: col."
>                 d at: col put: (r valueNamed: col).
>         ].
> 
> in addition to doing what you want it to do is also building a new
collection (that's what #collect: does). Since you make no use of the value
returned from #collect:, #do: would be a bit more efficient.

Right, thanks.

> ==========
> One thought that has occurred to me in the past when doing this kind of
thing is that repeating the Dictionary of name->value mappings for each row
is a bit wasteful. It might be nice instead to have some sort of

I ended up creating a collect method for the resultset and still returning
the data as I was.  It hadn't occured to me to use a TwoDimensionalResult
object, and although its not very useful for my current situation, it might
be nice to change the database driver to use this..

-- 
____/|  Ragnar Højland      Freedom - Linux - OpenGL |    Brainbench MVP
\ o.O|  PGP94C4B2F0D27DE025BE2302C104B78C56 B72F0822 | for Unix Programming
 =(_)=  "Thou shalt not follow the NULL pointer for  |  www.brainbench.com
   U     chaos and madness await thee at its end."             CCNA




More information about the Squeak-dev mailing list