From: Raffael Cavallaro on
On 2009-12-22 20:06:52 -0500, Pascal Costanza <pc(a)p-cos.net> said:

> These parties may not even know of each other. So how do they agree
> what ranking to use?

Clearly any such declarative programming sytem would have to define a
ranking scale for rules with sensible defaults. Since end users may
want to change the relative priorities of libraries of rules, there
would need to be a means of modifying the priority of an existing (i.e.
library) rule.

Two parties (i.e. library writers) may not be aware of each other, but
the end user must be aware of both (this is true of simple clos
libraries and filtered functions as well) in order for things to work
together properly. I don't see a declarative, rule-based system being
any different in this regard.

--
Raffael Cavallaro

From: Raffael Cavallaro on
On 2009-12-22 11:09:02 -0500, Pascal Costanza <pc(a)p-cos.net> said:

> Sure, but at least you need an agreement on the range of possible
> values. Now, what happens if there is a method provided by party A with
> priority 2, and a method provided by party B with priority 3, and you
> are party C that wants to add a method exactly in between?

Well pretty clearly you wouldn't use integers :^)

Seriously, simple floating point values between 0.0d0 and 1000.0d0 for
example would give users plenty of room to adjust rule ranking in the
examples you give.

By default, each rule would call call-next-rule (which would be
translated to call-next-method of course) but this could be overridden
if a user wants a particular rule to run last.

--
Raffael Cavallaro

From: Pascal Costanza on
On 23/12/2009 01:44, Raffael Cavallaro wrote:
> On 2009-12-22 11:09:02 -0500, Pascal Costanza <pc(a)p-cos.net> said:
>
>> Sure, but at least you need an agreement on the range of possible
>> values. Now, what happens if there is a method provided by party A
>> with priority 2, and a method provided by party B with priority 3, and
>> you are party C that wants to add a method exactly in between?
>
> Well pretty clearly you wouldn't use integers :^)
>
> Seriously, simple floating point values between 0.0d0 and 1000.0d0 for
> example would give users plenty of room to adjust rule ranking in the
> examples you give.

This doesn't really help. An important use case is integrating
separately developed methods, including methods implemented by third
parties. These parties may not even know of each other. So how do they
agree what ranking to use?

This is an essential point in object systems. If you don't care about
integrating separately developed code, OOP doesn't buy you that much...

> By default, each rule would call call-next-rule (which would be
> translated to call-next-method of course) but this could be overridden
> if a user wants a particular rule to run last.


Pascal

--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
From: Pascal Costanza on
On 23/12/2009 05:07, Raffael Cavallaro wrote:
> On 2009-12-22 20:06:52 -0500, Pascal Costanza <pc(a)p-cos.net> said:
>
>> These parties may not even know of each other. So how do they agree
>> what ranking to use?
>
> Clearly any such declarative programming sytem would have to define a
> ranking scale for rules with sensible defaults. Since end users may want
> to change the relative priorities of libraries of rules, there would
> need to be a means of modifying the priority of an existing (i.e.
> library) rule.
>
> Two parties (i.e. library writers) may not be aware of each other, but
> the end user must be aware of both (this is true of simple clos
> libraries and filtered functions as well) in order for things to work
> together properly. I don't see a declarative, rule-based system being
> any different in this regard.

Ok, then we agree. ;)


Pascal

--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
From: Kenneth Tilton on
Pascal Costanza wrote:
> Hi,
>
> I am very excited that I can finally annouce a public release of
> 'filtered functions', an extension of generic functions that Charlotte
> Herzeel, Jorge Vallejos, and myself have developed some time ago and
> that we are very excited about because it seems to be quite powerful in
> a number of very different scenarios.


This is puzzling. It sounds as if it has been used quite heavily yet
both examples provided are trivial and more easily done other ways.
C'mon, give up the beef!

Other thought: in the paper I did not like the hand-waving about
performance probably not being too bad. You have guessed wrong before
about CLOS performance. If you don't know, just say so. I imagine any
intense use would be a lot faster done without involving CLOS, leaving
as always the question of whether programming with f/fn is so much more
powerful as to be worth the hit.

Also: you said more than one filter could be used. I did not see an
example, nor did I know if you meant on two different parameters or
methods or what.

The syntax feels like exposed wiring. I'd get a macro in there so one
could just say (n 1) instead of (n (eql 1)).

Anyway, that's not why I am writing. I was looking at my Algebra code
where I used deftype a couple of places and got to wondering if you
could make CLOS dispatch off deftypes. That could be fun.

kt
First  |  Prev  | 
Pages: 5 6 7 8 9 10 11 12 13 14 15
Prev: [ANN] Filtered functions
Next: Filtered functions.