MagmaCollection API

goran at krampe.se goran at krampe.se
Wed Sep 13 12:08:07 UTC 2006


Howdy all, and Chris of course!

Ok, let me show you a method in Gjallar:

findObjectById: id
	"Find any object by id. Return nil if not found."

	| reader |
	reader _ cases where: [:each | each read: #id at: id ].
	reader size > 1 ifTrue: [self error: 'Multiple objects with the same
UUID!'].
	^reader size = 1 ifTrue: [reader at: 1] ifFalse: [nil]

So "cases" is a MagmaCollection with an index #id. Now... what is the
preferred simplest way of doing the #read:at: ? Nowadays this method is
not on MagmaCollection but on the reader. So.... the above looks
needlessly complex IMHO - or is there a point I am missing?

regards, Göran

PS. I am now experimenting with a shared magma session in combination
with one per user - I drowned in too much materialization otherwise.


More information about the Magma mailing list