On Thu, Nov 17, 2011 at 12:44 PM, missingfaktor <[email protected]
> wrote:

> Factor's generic words are similar to Clojure's multimethods. However
> there are times when protocols (in Clojure speak) are more appropriate
> abstraction. Does Factor support a construct similar to protocols?
>

There is a protocol construct used by the delegation mechanism, which
groups together related generics:

GENERIC: succ ( n -- n' )
GENERIC: pred ( n -- n' )

PROTOCOL: enumerable succ pred ;

TUPLE: derived-enumerable from ;

CONSULT: derived-enumerable enumerable
    from>> ;

It's not used as extensively in the Factor library as it perhaps should be.
In particular, protocols don't function as types.

-Joe
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to