From: <cod...@go...> - 2008-12-05 16:37:30
|
Comment #1 on issue 5 by james.c...@usma.edu: Use Objective-C 2.0 runtime interface http://code.google.com/p/hoc/issues/detail?id=5 I am interested in implementing at least a part of this in support of work I am doing. Specifically, I would like to be able to use "Cocoa Bindings" with Haskell- implemented subclasses of NSManagedObject and it appears to me that a necessary first step toward that working will be "proper" allocation and construction of the classes using the designated runtime functions. I have dug around a bit in the code to get my bearings, and I would like to do the following: - Refactor all "cbits" usage of structs objc_ivar, objc_ivar_list, objc_method, and obcj_method_list outside of newClass.m to a new set of structs named as hoc_ivar, etc. Additionally, I would like to include size and alignment information in the hoc_ivar struct in place of the offset currently used in objc_ivar. - Refactor all Haskell code's usage of IvarList to lists of a new opaque type Ivar, including wrapping HOC.NewClass.newClass to something that will marshall [Ivar] to struct hoc_ivar_list before calling the "cbits" newClass. - Change the 'instance size' parameter from newClass() in newClass.h/m to be an "extra bytes" parameter (or eliminate it entirely based on the assumption that it should always be zero). When dealing with the old runtime or the GNUStep runtime, the appropriate size would be calculated from the ivar list (plus the extra-bytes parameter). If the parameter is eliminated entirely, a flag on the ivar structure could be added indicating whether to add the ivar as an old-style "indexed" ivar or a new-style "managed" one, thus giving the flexibility to still provide the old style ivars if necessary for some reason. - Implement a build flag for "objective C 2.0 mode" - When in that mode, use the new objective C 2.0 runtime stuff to implement newClass. If anyone is currently working on this or has any input about an appropriate strategy or ways the strategy outlined here should be modified, please let me know. -- You received this message because you are listed in the owner or CC fields of this issue, or because you starred this issue. You may adjust your issue notification preferences at: http://code.google.com/hosting/settings |