Paste: cool hack

Author: slava
Mode: factor
Date: Sun, 18 Jan 2009 00:00:48
Plain Text |
FUNCTOR: define-destructor ( F -- )

F IS ${F}
F-destructor DEFINES ${F}-destructor
&F DEFINES &${F}
|F DEFINES |${F}

WHERE

TUPLE: F-destructor alien disposed ;

M: F-destructor dispose* alien>> F execute ;

: &F ( alien -- alien )
    dup f F-destructor boa &dispose drop ; inline

: |F ( alien -- alien )
    dup f F-destructor boa |dispose drop ; inline

;FUNCTOR

: DESTRUCTOR: scan define-destructor ; parsing

New Annotation

Summary:
Author:
Mode:
Body: