Reading multiple indices on MagmaCollections - first code

Chris Muller chris at funkyobjects.org
Fri Apr 7 02:15:15 UTC 2006


Brilliant work!  I really appreciate how you never had to introduce any
"precedence operators" into this, instead relying simply on the order
of execution of the boolean operators (per Smalltalks own precedence
rules) to assure the tree is built in "reverse" order that you end up
with the "root" expression at the top (having replaced the
sub-expression in the reader with the final root expression).  Simply
excellent.

And wonderfully terse too, BUT, how about we trade a naughty Smalltalk
trick for even greater terseness.  Consider:

  LavaTestResource current people where:
	[ : each |
	(each familyName equals: 'Man') |
	((each familyName equals: 'Pinkney') & (each age between: 0 and: 60))
].

Sweet!!  I simply implemented #doesNotUnderstand: on MaExpressionReader
to construnct the MaClause with whatever aMessage selector as the index
name.  Isn't this about as gorgeous as we could ask for?  I think so,
so I think its worth it.  

We're off to a fantastic start.  I posted an idea for the backend work,
how about suggesting your thoughts on some 'enumerating' API on
MaExpression that I can use to determine the most-restricting index so
I can do the backend work (#nodesDo: ?  #expressionsDo: ? 
terminatorsDo: ?).

I still need to consider is the best way to represent the result.

This is turning fun!
 Chris


--- Brent Pinkney <brent.pinkney at aircom.co.za> wrote:

> Hi,
> 
> Attached is my first stab at the client api:
> 
> 1. Get a clean 3.8 image
> 2. Load Magma1.0
> 3. Load Lava (28) and Lava testing (23) from SqueakMap
> 4. Load Magma research-brp.2.mcz.
> 
> In a workspace execute:
> 	LavaTestResource current
> 
> This creates the test Magma/Lava database.
> 
> Inspect this Lava query:
> 
> 	LavaTestResource current session execute: '
> 		select * from people
> 		where (familyName = ''Man'')
> 		or ( (familyName = ''Pinkney'') and (age <= 60) )'.
> 
> 
> 
> My proposed Magma client API to create a reader which can query
> multiple
> indices is:
> 
> LavaTestResource current people where: [ :r |
> 	(r read: #familyName at: 'Man') |
> 		( (r read: #familyName at: 'Pinkney') & (r read: #age to: 60) )
> ].
> 
> Inspecting this returns a MagmaExpression reader with a correctly
> populated
> 'expression' tree.
> 
> I think this interface is acceptably elegant and can be used to
> construct the
> MaBitmapIndex for this query.
> 
> Comments welcomed
> 
> Brent
> > _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Magma research-cmm.3.mcz
Type: application/octet-stream
Size: 4465 bytes
Desc: 3110625560-Magma research-cmm.3.mcz
Url : http://lists.squeakfoundation.org/pipermail/magma/attachments/20060406/0bc4f2f5/Magmaresearch-cmm.3.obj


More information about the Magma mailing list