You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(4) |
Apr
(1) |
May
|
Jun
(4) |
Jul
(13) |
Aug
(1) |
Sep
(7) |
Oct
(6) |
Nov
|
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(17) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Joe J. <dar...@gm...> - 2006-11-12 21:32:59
|
Thanks for the info. This was very enlightening and will help a lot. :-) On 11/12/06, David Christensen <dw...@dw...> wrote: > > 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 > > > |
From: David C. <dw...@dw...> - 2006-11-12 18:21:42
|
> OK, I had to remove the NSView. prefix from the bounds call to get > that line to compile. Did you include the import statement for NSView explicitly? This may also be due to me forgetting to specify the import as qualified... :-) > However, the next line tells me that : > EPView.hs:20:30: Not in scope: `set' > And I'm not sure why it's not in scope because set IS a method of > AppKit.NSColor. This is an exporting issue due to the fact that there are multiple classes in the Cocoa hierarchy which define a "set" selector. In HOC, all selectors are of the same type; for these duplicate selectors there is no way to distinguish which selector you meant by name and type alone, so by default these are not exported. You can either import the module explicitly or import qualified to provide a different namespace for that selector to live: Either: > import AppKit > import qualified AppKit.NSColor as NSColor > ... > blackColor # NSColor.set Or: > import AppKit > import AppKit.NSColor (set) > ... > blackColor # set ---- David Christensen |
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 |
From: Joel R. <jo...@gm...> - 2006-11-12 14:58:17
|
Folks, I'm having trouble building HOC, apparently libtool complains about - static. I'm on 10.4.8 and I just did a cvs update. Is anyone else seeing this? Thanks, Joel -- http://wagerlabs.com/ |
From: Joe J. <dar...@gm...> - 2006-11-12 02:09:35
|
OK, I had to remove the NSView. prefix from the bounds call to get that line to compile. However, the next line tells me that : EPView.hs:20:30: Not in scope: `set' And I'm not sure why it's not in scope because set IS a method of AppKit.NSColor. On 11/11/06, David Christensen <dw...@dw...> wrote: > Joe wrote: > > > I am trying to create a custom NSView subclass that, specifically one > > that overrides drawRect. What I am having a problem with is > > understanding how to override this function and how to actually get > > some custom drawing done. Actually, I;m not even sure if my class is > > being instantiated. I slapped a view into the ExpressionParser window, > > gave it a custom class with the same name as my class (which would > > normally be all I would need to do in Cocoa). > > Joe, > > Here's the source for a more complex view that I wrote in Haskell. I > can't remember if this compiles/works correctly (it was working at > one point, but I started tinkering more), but it should give you > something to go on as far as showing how to declare the draw_rect > function appropriately. > > Of particular note, I believe that I had to export the info_drawRect > in the $(exportClass) directive in order for the Cocoa system to be > able to call the haskellized replacement function. > > (Also a style note, I was experimenting with some utility functions > which use unsafePerformIO; said usage is not recommended... :-D) > Additional disclaimer: this code was written about a year ago, so I'm > sure there are general improvements which could be made in general. > > I might make the following changes to your view, just to see if it > gives you what you are expecting: > > --- > {-# OPTIONS -fglasgow-exts -fth #-} > > module EPView where > > import Cocoa > import AppKit.NSView as NSView hiding (print) > > $(declareClass "EPView" "NSView") > > $(exportClass "EPView" "ev_" > [ > InstanceMethod info_drawRect > ] > ) > > obj #. var = obj # getIVar var > > ev_drawRect rect self = do > r <- self # NSView.bounds -- proper instance selection. > _NSColor # blackColor >>= set -- class selector > nsRectFill r > return () > --- > > Regards, > > David Christensen > > > > |
From: Joe J. <dar...@gm...> - 2006-11-12 00:39:27
|
Cool, I'll give that a shot. I didn't know about the AppKit import so I'll add that as well. A few questions: 1) (Serious newbie q) What does the # stand for? I haven't seen that yet in what I have read. 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...). 3) In general are all of the NSXxxx functions in Cocoa/Foundation/AppKit prefaced with nsXxxx in Haskell? Thanx, joe On 11/11/06, David Christensen <dw...@dw...> wrote: > Joe wrote: > > > I am trying to create a custom NSView subclass that, specifically one > > that overrides drawRect. What I am having a problem with is > > understanding how to override this function and how to actually get > > some custom drawing done. Actually, I;m not even sure if my class is > > being instantiated. I slapped a view into the ExpressionParser window, > > gave it a custom class with the same name as my class (which would > > normally be all I would need to do in Cocoa). > > Joe, > > Here's the source for a more complex view that I wrote in Haskell. I > can't remember if this compiles/works correctly (it was working at > one point, but I started tinkering more), but it should give you > something to go on as far as showing how to declare the draw_rect > function appropriately. > > Of particular note, I believe that I had to export the info_drawRect > in the $(exportClass) directive in order for the Cocoa system to be > able to call the haskellized replacement function. > > (Also a style note, I was experimenting with some utility functions > which use unsafePerformIO; said usage is not recommended... :-D) > Additional disclaimer: this code was written about a year ago, so I'm > sure there are general improvements which could be made in general. > > I might make the following changes to your view, just to see if it > gives you what you are expecting: > > --- > {-# OPTIONS -fglasgow-exts -fth #-} > > module EPView where > > import Cocoa > import AppKit.NSView as NSView hiding (print) > > $(declareClass "EPView" "NSView") > > $(exportClass "EPView" "ev_" > [ > InstanceMethod info_drawRect > ] > ) > > obj #. var = obj # getIVar var > > ev_drawRect rect self = do > r <- self # NSView.bounds -- proper instance selection. > _NSColor # blackColor >>= set -- class selector > nsRectFill r > return () > --- > > Regards, > > David Christensen > > > > |
From: David C. <dw...@dw...> - 2006-11-11 12:30:35
|
Joe wrote: > I am trying to create a custom NSView subclass that, specifically one > that overrides drawRect. What I am having a problem with is > understanding how to override this function and how to actually get > some custom drawing done. Actually, I;m not even sure if my class is > being instantiated. I slapped a view into the ExpressionParser window, > gave it a custom class with the same name as my class (which would > normally be all I would need to do in Cocoa). Joe, Here's the source for a more complex view that I wrote in Haskell. I can't remember if this compiles/works correctly (it was working at one point, but I started tinkering more), but it should give you something to go on as far as showing how to declare the draw_rect function appropriately. Of particular note, I believe that I had to export the info_drawRect in the $(exportClass) directive in order for the Cocoa system to be able to call the haskellized replacement function. (Also a style note, I was experimenting with some utility functions which use unsafePerformIO; said usage is not recommended... :-D) Additional disclaimer: this code was written about a year ago, so I'm sure there are general improvements which could be made in general. I might make the following changes to your view, just to see if it gives you what you are expecting: --- {-# OPTIONS -fglasgow-exts -fth #-} module EPView where import Cocoa import AppKit.NSView as NSView hiding (print) $(declareClass "EPView" "NSView") $(exportClass "EPView" "ev_" [ InstanceMethod info_drawRect ] ) obj #. var = obj # getIVar var ev_drawRect rect self = do r <- self # NSView.bounds -- proper instance selection. _NSColor # blackColor >>= set -- class selector nsRectFill r return () --- Regards, David Christensen |
From: Joe J. <dar...@gm...> - 2006-11-11 07:15:07
|
First, understand that I am a complete newbie to Haskell and HOC so please forgive me if this seems rather basic. I have checked the users archive and was unable to find an answer to this. I am trying to create a custom NSView subclass that, specifically one that overrides drawRect. What I am having a problem with is understanding how to override this function and how to actually get some custom drawing done. Actually, I;m not even sure if my class is being instantiated. I slapped a view into the ExpressionParser window, gave it a custom class with the same name as my class (which would normally be all I would need to do in Cocoa). Here is what I have for my view so far: {-# OPTIONS -fglasgow-exts -fth #-} module EPView where import Cocoa $(declareClass "EPView" "NSView") $(exportClass "EPView" "ev_" [ {- Outlet "expressionEntry" [t| NSTextField () |] , Outlet "evaluation" [t| NSTextField () |] ,-} InstanceMethod 'drawRect ] ) obj #. var = obj # getIVar var ev_drawRect rect self = do putStrLn "Hello World" The putStrLn is there just to get something into that method. I think it is doing something (as I see traces of Hell World in the console log, though not consistent). What I am trying to do is to get something to draw (right now nothing more complex then filling in the rect that is passed in with a blackColor from NSColor. Can anyone provide some pointers (or some code) for this problem? Thanx, joe |
From: Wolfgang T. <wol...@gm...> - 2006-11-08 19:30:34
|
> I tried a number of the apps in Samples and they all seem to exhibit > the same problems: Are you sure you tried the .apps, not just the binaries themselves? I.e. double-click the app-icon, or start Editor.app/Editor from the Terminal, not ./Editor. Cheers, Wolfgang |
From: Joe J. <dar...@gm...> - 2006-11-08 16:05:58
|
I tried a number of the apps in Samples and they all seem to exhibit the same problems: 1) Edit boxes take no input, instead the input goes to the terminal window it was lanuched from. 2) Alt-Q does the same. 3) Closing the application doesn't quit it. You have to explicitly kill the application from terminal. I also notice that the application, while seeming to have focus, puts no menu up in the menu bar. This would appear to mean that the app is not getting Key and Focus for some reason. Thanx, joe |
From: Joe J. <dar...@gm...> - 2006-11-08 06:42:25
|
Hi, I am new to Haskell and was excited to see ObjC bindings for Cocoa available. I downloaded the HEAD source (because I am running ghc 6.6 and saw a message and commit stating that the released code wouldn't build but that the latest source would). While I can build HOC and run the tests, trying to build the sample ExpressionParser throws up an error: [Mirkwood:hoc/Samples/ExpressionParser] jjones% make mkdir -p build ghc --make Main.hs -odir build -hidir build -O -o ExpressionParser [2 of 3] Compiling EPController ( EPController.hs, build/EPController.o ) EPController.hs:9:0: parse error on input `$' make: *** [ExpressionParser] Error 1 Any idea on what this error means? How to fix it? Thanx, joe |
From: Scott K <tur...@ho...> - 2006-08-12 04:35:57
|
I having been trying to build HOC. Working with version from CVS on Tiger with GCC 4.0 and GHC 6.4.1 and have made the -lSystemStubs to /HOC_cbits/Makefile.in edit. I ran ./configure --with-ghc=/user/local/bin/ghc-6.4.1 as GHC was not being found on the system. Building I get the following error: ... checking for ghc version... ./configure: line 2189: test: : integer expression expected configure: error: ** Sorry, your GHC is too old. GHC >= 6.4 required. GHC 6.4.1 is on my system in /user/local/bin and I am using it interactively in terminal. I would really like to get HOC going and try out some coding. I'm probably doing something silly, any suggestions? Thank you. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ |
From: David K. <dki...@gm...> - 2006-08-06 04:33:23
|
I just tried to build on OS 10.4.7 (Intel) using ghc-6.5.20060608. hoc-0.7 fails on configure with the following message: configure: error: libffi has not been ported to i386-apple-darwin8.7.1. cvs HEAD, on the other hand, seems to build fine. But I did have to add '-fth' to all of the Makefile.in (-fglasgow-exts used to imply -fth, but apparently no longer) -david k. |
From: David C. <dw...@dw...> - 2006-03-15 15:55:55
|
> Just discovered HOC. Has anyone built a large application (a la iTunes > ha ha) with it that they would be willing to share? I'd like to see > examples of some more complex Cocoa components in action, and where > people choose to draw the ObjC/Haskell lines. No large application, but I have a view that I have written in =20 Haskell, including all of the drawing methods. I will warn you that =20 there are some quirks in it that I can't quite figure out=97mainly that =20= occasionally the -isFlipped attribute seems to be reversed, but only =20 until you resize it. And occasionally, the origin seems to get =20 offset somehow. But other than those cosmetic issues (which, if =20 anyone knows a solution to, I'd be more than happy to hear) the view =20 draws successfully. I can include the code if anyone is interested. David Christensen |
From: Charles M. <cha...@gm...> - 2006-03-15 07:36:30
|
Just discovered HOC. Has anyone built a large application (a la iTunes ha ha) with it that they would be willing to share? I'd like to see examples of some more complex Cocoa components in action, and where people choose to draw the ObjC/Haskell lines. Charles |
From: Peter T. <pet...@co...> - 2006-03-11 16:33:07
|
Alwyn, Directions to obtain the CVS release are given at: http://sourceforge.net/cvs/?group_id=3D93369 Alternatively, you could go to the HOC Download page ( http://=20 hoc.sourceforge.net/download.html ) and click on the Sourceforge CVS repository link at the bottom of the =20= page. NOTE1: if you are new to using cvs, create a file at the top of your =20 home user directory ( ~/ ) for cvs to use as a record of its =20 activities, like this: [shell prompt]:~ your_user_name$ touch .cvspass do this *before* you issue the first cvs command. Be sure to read the _BUILDING.CVS_ file (also at the bottom of the =20 HOC Download page), for directions on building the CVS file. As of this writing, the Sourceforge web site is down, but there is a =20 copy in the top level directory ( hoc/BUILDING.CVS ) after you have =20 checked HOC out of cvs. For convenience, here is a copy of the =20 current BUILDING.CVS file: -----BUILDING.CVS COPY (Modified)----- CVS BUILDING INSTRUCTIONS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= These are build instructions if you've checked out HOC from CVS (instead of downloading a source distribution tarball). 1. Check out the libffi module from HOC's CVS repository into a directory named libffi-src/ in the HOC source tree: cvs -d :pserver:ano...@cv...:/cvsroot/hoc co -d =20 libffi-src libffi --NOTE2: changed cvs.sf.net in above command to cvs.sourceforge.net You can also check out libffi into another directory: if you do this, just make sure that 2. Execute autogen.sh to generate the GNU ./configure script: ./autogen.sh 3. Build HOC as usual with ./configure && make && make install. ----BUILDING.CVS COPY (Modified)---- NOTE3: If you are building on Mac OS 10.4 (Tiger) with Apple's gcc 4.0: 1. once you have retrieved the CVS version, change to the directory =20 hoc/HOC_cbits 2. backup the file Makefile.in by copying it to some archive name, =20 such as Makefile.in.old 3. open the file Makefile.in (preferably in a text editor that =20 displays line numbers, such as Emacs or Xcode) 4. change line 23 (not 33) from: ld -r -x -o HOC_cbits.o $(ALL_LOAD) libHOC_cbits.a to: ld -r -x -o HOC_cbits.o -lSystemStubs $(ALL_LOAD) libHOC_cbits.a 5. save your changes 6. proceed with the build process from item 2. in BUILDING.CVS =20 (running autogen.sh). Good luck, Pete On Mar 10, 2006, at 11:56 AM, David Christensen wrote: > Alwyn, > >> Is this project still alive? Is there any interest in maintaining it? > > I can't speak as one of the developers, but I have been interested =20 > in using HOC, and am currently using it to write one of my =20 > applications. I am still a relative newbie to haskell (just about =20 > a year of part-time hobbyist experience), and I have found that =20 > doing some of the cocoa integration starts to become a bit =20 > tedious. I think a more active user group would be great; I think =20 > there have been only 10 messages or so to hoc-users in the last =20 > year, so it feels an awful lot like swimming alone in a dark, dark =20 > ocean. :/ > >> My understanding is that the released version of HOC will not work =20= >> with GHC 6.4.1, but that there is a version in CVS that may do so. =20= >> I've been expecting a new release for months, but it hasn't been =20 >> forthcoming. > > The CVS version works=97poke around on hoc.sourceforge.net to find =20 > the anonymous cvs url. > > Regards, > > David Christensen > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting =20 > language > that extends applications into web and mobile media. Attend the =20 > live webcast > and join the prime developer group breaking into this new coding =20 > territory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat=121642= > _______________________________________________ > hoc-users mailing list > hoc...@li... > https://lists.sourceforge.net/lists/listinfo/hoc-users |
From: David C. <dw...@dw...> - 2006-03-10 16:56:48
|
Alwyn, > Is this project still alive? Is there any interest in maintaining it? I can't speak as one of the developers, but I have been interested in =20= using HOC, and am currently using it to write one of my =20 applications. I am still a relative newbie to haskell (just about a =20 year of part-time hobbyist experience), and I have found that doing =20 some of the cocoa integration starts to become a bit tedious. I =20 think a more active user group would be great; I think there have =20 been only 10 messages or so to hoc-users in the last year, so it =20 feels an awful lot like swimming alone in a dark, dark ocean. :/ > My understanding is that the released version of HOC will not work =20 > with GHC 6.4.1, but that there is a version in CVS that may do so. =20 > I've been expecting a new release for months, but it hasn't been =20 > forthcoming. The CVS version works=97poke around on hoc.sourceforge.net to find the =20= anonymous cvs url. Regards, David Christensen= |
From: Alwyn <dt0...@bl...> - 2006-03-10 07:11:03
|
On 9 Mar 2006, at 03:49, Peter Tanski wrote: > I recently attempted to build HOC 0.7 from the sources in the > Release download, > on Mac OS 10.4 (Tiger), with gcc 4.0 and ghc 6.4.1. There were > many, many errors > of various sorts--even after I edited the /HOC_cbits/Makefile.in, > line 23, as noted by > Mr. Morgan: Is this project still alive? Is there any interest in maintaining it? My understanding is that the released version of HOC will not work with GHC 6.4.1, but that there is a version in CVS that may do so. I've been expecting a new release for months, but it hasn't been forthcoming. Alwyn |
From: Peter T. <pet...@co...> - 2006-03-09 03:49:42
|
I recently attempted to build HOC 0.7 from the sources in the Release download, on Mac OS 10.4 (Tiger), with gcc 4.0 and ghc 6.4.1. There were many, many errors of various sorts--even after I edited the /HOC_cbits/Makefile.in, line 23, as noted by Mr. Morgan: [quote from http://sourceforge.net/mailarchive/forum.php? thread_id=8262704&forum_id=44522] > I tried building HOC from CVS using ghc 6.4.1 and gcc 4.0 (on Tiger), > but got a link error citing an undefined symbol, _fprintf$LDBLStub. > The following change to HOC_cbits/Makefile.in fixes the problem: > > 33c33 > < ld -r -x -o HOC_cbits.o $(ALL_LOAD) libHOC_cbits.a > --- > > ld -r -x -o HOC_cbits.o -lSystemStubs $(ALL_LOAD) > libHOC_cbits.a When I attempted to build HOC 0.7 from the cvs repository, after adding -lSystemStubs to /HOC_cbits/Makefile.in, everything worked perfectly. |
From: David C. <dw...@dw...> - 2005-12-20 05:32:14
|
Never mind; I have discovered that I should be using the data =20 constructors as the equivalent constructors, and I was wrong on the =20 other counts. Sorry for wasting everyone's time. Regards, David ---- On Dec 19, 2005, at 11:17 PM, David Christensen wrote: > Hey hoc-users, > > It looks like ifgen does not pull out the definitions for many of =20 > the geometry functions defined in NSGeometry =20 > (NSMinX,NSMaxX,NSWidth,NSMakeRect etc)=97understandably so, as they =20= > are defined as inline functions. So if we are wanting to create =20 > NSRects and manipulate the fields, it would seem like there would =20 > need to be a Haskell method of calling these functions (or =20 > manipulating the equivalent for the same underlying structures). =20 > Do such bindings exist already, and if not, would these be =20 > considered special-purpose enough that something would need to be =20 > hand-tailored, leaving ifgen alone? > > Regards, > > David Christensen > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through =20 > log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD =20 > SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=CCk > _______________________________________________ > hoc-users mailing list > hoc...@li... > https://lists.sourceforge.net/lists/listinfo/hoc-users |
From: David C. <dw...@dw...> - 2005-12-20 05:16:59
|
Hey hoc-users, It looks like ifgen does not pull out the definitions for many of the =20= geometry functions defined in NSGeometry =20 (NSMinX,NSMaxX,NSWidth,NSMakeRect etc)=97understandably so, as they are =20= defined as inline functions. So if we are wanting to create NSRects =20 and manipulate the fields, it would seem like there would need to be =20 a Haskell method of calling these functions (or manipulating the =20 equivalent for the same underlying structures). Do such bindings =20 exist already, and if not, would these be considered special-purpose =20 enough that something would need to be hand-tailored, leaving ifgen =20 alone? Regards, David Christensen= |
From: David C. <dw...@dw...> - 2005-10-28 22:48:22
|
Hola! How would one go about detecting a nil result in a Cocoa call (as =20 opposed to NSNull)?I.e., if you have an NSEnumerator and you are =20 trying to retrieve objects progressively, the end is indicated by =20 nil. I could not find anything on google about how to detect this=97is =20= this documented? (It would seem like there would have to be some =20 sort of coercion at a lower level, possibly exported as some function =20= (i.e., `nil')). Thanks, David Christensen= |
From: David C. <dw...@dw...> - 2005-10-28 20:23:16
|
Hey all, Is there a module which converts conveniently between NSDictionary and a Data.Map object? I realize that there are some differences between the types of objects which can be stored in the two mappings, but perhaps there would be a: mapFromDict :: NSDictionary a -> Map Id Id or a specialized version in the case that the keys and values are a particular type (say NSStrings) mapFromDictStrings :: NSDictionary () -> Map String String This seems like it could be useful, if not necessarily general purpose, and it may be that the two systems are a bit too schizophrenic to allow such a mapping to take place, but it'd work for me! Any thoughts on this idea? If something like this doesn't exist, I'd be glad to release my solution when I find it. Regards, David Christensen |
From: Matthew M. <mat...@gm...> - 2005-10-06 01:31:17
|
> What should be the Haskell type of this? > > NSString a -> CUInt -> (Bool, NSError ()) ? Either that or NSString a -> CUInt -> MagicOutPtr (NSError ()) -> Bool where MagicOutPtr is some magically marshalled type -- I'm waving my hands here 'cause I don't know much about the FFI. PyObjC uses the former method; F-Script uses the latter. The easier-to-implement way (whichever that is) is probably best. - Matt |
From: David C. <dw...@dw...> - 2005-10-05 06:08:32
|
> > - (BOOL)writeToFile:(NSString *)path options:(unsigned) > writeOptionsMask error:(NSError **)errorPtr; > > What should be the Haskell type of this? > > NSString a -> CUInt -> (Bool, NSError ()) ? As there is a possibility that this error is null, (i.e., no error), perhaps it should be: NSString a -> CUInt -> (Bool, Maybe NSError ()) Whether this should be the pattern in the general case, I do not know, but it seems like it (c|sh)ould be supported. What about instances where we have an in/out parameter? (Can't think of anything specifically in cocoa, but a lot of low-level c-code structs have this when passing pointers.) Those circumstances would have to be hand-added to the bindings, I believe. Any possibility of turning them into IORefs? David |