Slava Pestov wrote:
>> but as 'my 2 cents' idea, it could be nice to be able to write the 
>> first.
>> We may have something like:
>> PREDICATE: special-something ... ;
>> without inheritance symbol < in this case.
>>     
>
> The reason predicates have to be guarded by a superclass is to speed
> up dispatch. If you have
>
> PREDICATE: even < integer 2 mod 0 = ;
>
> GENERIC: blah ( x -- y )
> M: string blah reverse ;
> M: even blah 1 + ;
>
> Then calling blah on a string does not require the predicate even? to 
> be tested.
>   
Yes! But it wasn't what I mean by 'without inheritance symbol..'. What I 
meant was the superclass may be guessed according to a syntax 
convention: probably a stupid idea like:
PREDICATE: even-integer < integer 2 mod 0 = ;
may be written as:
PREDICATE: even-integer 2 mod 0 = ;
because there's "-integer" in the name. I thought that by seeing your 
'underweight-pig' example. So when I try this code in a listener, I 
tought it may expand in 'underweight-pig < pig' like some Common Lisp 
shortcuts or automagic constructors. Forget it!
> Slava
>   
-- 
Martial



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to