From: Wolfgang T. <wol...@gm...> - 2005-10-05 03:25:30
|
> I notice that ifgen doesn't handle out-parameters, such as the > increasingly-common (NSError**) idiom. (Examples include NSDocument's > readFromURL:ofType:error: and writeToURL:ofType:error:.) Is that just > a limitation of ifgen, or does the HOC runtime also need to be > extended to handle that case? Either way, I'm happy to help if I can. I think there should be a certain division of labour here between ifgen and libHOC; the latter should provide some more variants of declareSelector which support smarter argument marshalling, while ifgen has to recognise the relevant situations (maybe aided by the binding-script) and generate calls to the appropriate things. So we first need to figure out what kind of situations we want to handle: - (BOOL)writeToFile:(NSString *)path options:(unsigned) writeOptionsMask error:(NSError **)errorPtr; What should be the Haskell type of this? NSString a -> CUInt -> (Bool, NSError ()) ? Next, we should decide what TH macros libHOC should provide to import selectors with those types, and finally we need to decide in what situations ifgen can recognise these automatically, and when it will need help from the binding-script. My brain is all spent for today... ideas are welcome. Cheers, Wolfgang |