Bugfix and a Query question

goran at krampe.se goran at krampe.se
Fri Oct 6 10:40:49 UTC 2006


Hiya!

Ok, I stumbled on this code:

minimumSearchSpaceSizeUsing: aMaLargeCollectionManager 
	| calculateSizeBlock |
	calculateSizeBlock _ 
	[ : each | 
	each minimumSearchSpaceSizeUsing: aMaLargeCollectionManager ].
	^ self isConjunction 
		ifTrue: [ self terms detectMin: calculateSizeBlock ]
		ifFalse: [ self terms detectSum: calculateSizeBlock ]

...which wrongly assumes that detectMin: returns the size instead of the
term itself. I changed "self terms detectMin: calculateSizeBlock" to
"(self terms collect: calculateSizeBlock) min".

...which creates an intermediate collection, but whatever. :) Not sure
how come this have gone unnoticed, perhaps there is no test exercising
this as a conjunction. And yes, detectSum: and is dubiously named - it
is no "detect" IMHO - it should be called sum:.

On to my question - is it planned that where: queries could also operate
on attributes that are not indexed? Even if it is planned I can probably
not wait for that - I will have to split my code into a where: followed
by a "normal" select: I guess.

Or actually add select:upTo: to the reader that will return up to x
number of objects.

regards, Göran


More information about the Magma mailing list