[Grok-dev] view predicates in Grok?

Martijn Faassen faassen at startifact.com
Sat Jan 2 14:29:20 EST 2010


Hey Paul,

Thanks for doing this analysis!

Could you sketch out some brief "science fiction" documentation (or at 
least code samples) where Grok uses predicates? If you can't come up 
with a good spelling, please just show the alternatives so we can talk 
it over.

Paul Wilson wrote:
[snip]
> So, when a request comes in, the component registry resolves to a
> multiview (rather than directly to a view). This indirection allows
> the system to interrogate the predicates to find a matching view. The
> order in which the views are evaluated depends on a pre-computed score
> that is determined by the relative importance of the predicates that
> it defines. I'm a bit vague on this at the moment though.

Is the predicate system internal to BFG or is there an external library 
that's used? I recall something vaguely about using predicates with the 
security system - is the same system in use?

> So a multi-view class would need to be defined, the view grokker
> revised, and some strategy for communicating predicates (for which the
> obvious choice would be martian directives).

It depends on the power of the predicate language. Is it a subset of Python?

Regards,

Martijn



More information about the Grok-dev mailing list