]> gitweb.factorcode.org Git - factor.git/blob - core/generic/hook/hook.factor
Switch to https urls
[factor.git] / core / generic / hook / hook.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: accessors definitions generic generic.single kernel
4 kernel.private namespaces quotations sequences words ;
5 QUALIFIED-WITH: generic.single.private gsp
6 IN: generic.hook
7
8 TUPLE: hook-combination < single-combination var ;
9
10 C: <hook-combination> hook-combination
11
12 PREDICATE: hook-generic < generic
13     "combination" word-prop hook-combination? ;
14
15 M: hook-combination picker
16     combination get var>> [ get ] curry ;
17
18 M: hook-combination dispatch# drop 0 ;
19
20 M: hook-combination mega-cache-quot
21     1quotation picker [ gsp:lookup-method (execute) ] surround ;
22
23 M: hook-generic definer drop \ HOOK: f ;
24
25 M: hook-generic effective-method
26     [ "combination" word-prop var>> get ] keep method-for-object ;