2005-08-26 23:06:56 -04:00
|
|
|
! Copyright (C) 2004, 2005 Slava Pestov.
|
|
|
|
! See http://factor.sf.net/license.txt for BSD license.
|
|
|
|
IN: generic
|
2005-09-05 03:06:47 -04:00
|
|
|
USING: errors kernel kernel-internals ;
|
2005-08-26 23:06:56 -04:00
|
|
|
|
|
|
|
DEFER: standard-combination
|
|
|
|
|
|
|
|
DEFER: math-combination
|
|
|
|
|
|
|
|
: delegate ( object -- delegate )
|
2005-09-24 15:21:17 -04:00
|
|
|
dup tuple? [ 3 slot ] [ drop f ] if ;
|
2005-08-26 23:06:56 -04:00
|
|
|
|
|
|
|
: set-delegate ( delegate tuple -- )
|
2005-09-05 03:06:47 -04:00
|
|
|
dup tuple? [
|
|
|
|
3 set-slot
|
|
|
|
] [
|
|
|
|
"Only tuples can have delegates" throw
|
2005-09-24 15:21:17 -04:00
|
|
|
] if ;
|