From: David C. <dw...@dw...> - 2006-11-12 18:16:22
|
> 1) (Serious newbie q) What does the # stand for? I haven't seen that > yet in what I have read. # is the "call this selector" function. These are equivalents: // Objective-C [someObject someSelector] // Haskell someObject # someSelector More complicated equivalents: // Objective-C [someObject someSelector:foo withArgs:bar] // Haskell someObject # someSelectorWithArgs foo bar And of course: // Objective-C [[someObject fooSelector] barSelector] // Haskell someObject # fooSelector >>= barSelector >>= serves as the "nested selectors" equivalent; the way that > 2) For the general audience: Is there any way to make the getIvar code > (obj #. var = obj # getIVar var) disappear? This appears in every > class and seems like something that could be part of a base class, or > part of the template definition (note that I have no idea how the > template stuff works so...). If you are not using it, you do not need to define it. It is just a convenience function for accessing the instance variables of an object. > 3) In general are all of the NSXxxx functions in > Cocoa/Foundation/AppKit prefaced with nsXxxx in Haskell? In general, yes. It should be noted that not all functions are imported; it depends on how smart the ifgen script is (which, as I understand it, basically parses the header files for Cocoa and automates the wrapper generation for the ffi in Haskell). I've thought that a tool like unto "perldoc" would be in order for some of the Haskell packages (I also haven't looked to see if Haddock docs are a generation option with hoc; it may be). > Thanx, > joe David Christensen |