! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: math assocs kernel sequences byte-arrays strings hashtables alien destructors core-foundation.numbers core-foundation.strings core-foundation.arrays core-foundation.dictionaries core-foundation.data core-foundation ; IN: core-foundation.utilities GENERIC: (>cf) ( obj -- cf ) M: number (>cf) ; M: t (>cf) ; M: f (>cf) ; M: string (>cf) ; M: byte-array (>cf) ; M: hashtable (>cf) [ [ (>cf) &CFRelease ] bi@ ] assoc-map ; M: sequence (>cf) [ (>cf) &CFRelease ] map ; M: alien (>cf) CFRetain ; : >cf ( obj -- cf ) [ (>cf) ] with-destructors ;