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: 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 |
From: Matthew M. <mat...@gm...> - 2005-10-04 23:05:59
|
Greetings all, 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. - Matt -- http://www.matthewmorgan.net/blog |
From: David C. <dw...@dw...> - 2005-09-30 13:51:18
|
> It is an area that needed development until a few days ago :-). > Functions with a fixed number of arguments are now imported > automatically in the bindings (as long as all the argument types > are supported by hoc). Supporting variable-argument functions like > NSLog would be quite hard and I think NSLog alone is not worth it - > it's easier to just write somehting to stderr yourself. > > Cheers, > > Wolfgang Cool, thanks. Really, the features that I liked from NSLog() was the ability to inline an NSObject's description within the format string (ala @"% @"), but that could be done just as well as haskellString (obj # description). Now, depending on whether NSRect is a supported argument type (I think it's just a packed struct of floats), it'll make life easier. Thanks! David |
From: Wolfgang T. <wol...@gm...> - 2005-09-30 06:17:13
|
> I'm trying to write a custom NSView in Haskell. For academic > purposes, I'm just trying to provide a basic drawRect selector; one > which just draws a frame around the bounds of the view. However, I > am not seeing how to access the NSFrameRect() functions and friends. > > This seems to be a similar problem to the one I was describing in > my last message in regards to NSLog(). Is there some way to access > these functions from within Haskell with the use of HOC, or do I > manually have to wrangle in the functions through ffi? Is this an > area which just needs development, and will be supported in future > versions? It is an area that needed development until a few days ago :-). Functions with a fixed number of arguments are now imported automatically in the bindings (as long as all the argument types are supported by hoc). Supporting variable-argument functions like NSLog would be quite hard and I think NSLog alone is not worth it - it's easier to just write somehting to stderr yourself. Cheers, Wolfgang |
From: Matthew M. <mat...@gm...> - 2005-09-22 01:11:09
|
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.=20 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 This probably isn't the Right Fix, but it's at least a quick way to get HOC running. - Matt -- http://www.matthewmorgan.net/blog |
From: Wolfgang T. <wol...@gm...> - 2005-09-18 17:30:02
|
> I'm trying to write a custom NSView in Haskell. For academic > purposes, I'm just trying to provide a basic drawRect selector; one > which just draws a frame around the bounds of the view. However, I > am not seeing how to access the NSFrameRect() functions and friends. > Is this an area which just needs development, and will be supported > in future versions? Yes. Definitely needs development. Doing it by hand using the FFI is hard, as the FFI does not support passing structures like NSRect. For now, I recommend writing a small objective-c helper class that wraps those functions in static methods; this class can then be used more conveniently using declareClass, declareSelector and an instance declaration. About NSLog... variable argument functions are a nightmare and will probably never be properly supported. CHeers, Wolfgang |
From: David C. <dw...@dw...> - 2005-09-10 04:55:04
|
Hello folks, I'm trying to write a custom NSView in Haskell. For academic purposes, I'm just trying to provide a basic drawRect selector; one which just draws a frame around the bounds of the view. However, I am not seeing how to access the NSFrameRect() functions and friends. This seems to be a similar problem to the one I was describing in my last message in regards to NSLog(). Is there some way to access these functions from within Haskell with the use of HOC, or do I manually have to wrangle in the functions through ffi? Is this an area which just needs development, and will be supported in future versions? Any pointers would be appreciated. Thanks much, David Christensen |
From: David C. <dw...@dw...> - 2005-09-10 03:35:52
|
Greetings, I was wondering about accessing the NSLog() function from hoc, which got me wondering about functions with va_list signatures from C. Is it possible to have such functions in Haskell? I've read the example of printf which requires a TH approach; I don't know the status of other such functions, but it seems like a similar approach would be necessary. Thanks, David Christensen |
From: Wolfgang T. <wol...@gm...> - 2005-09-09 23:31:40
|
On 9-Sep-05, at 6:58 PM, David Christensen wrote: > Wolfgang, > > Thanks for the info -- got it all built and playing with it now. A > few quick questions, as it seems like the mailing lists are fairly > sparse at this point, and google did not turn up anything useful: So lets start making the mailing lists more interesting, shall we? I'm Cc-ing the hoc-users list now. > 1) I'm trying to write a Show instance for NSString, NSArray and > some other core types in order to be able to use the string > representation of the Cocoa datatype in my Haskell program. > Currently, I'm using toNSString and fromNSString to try and convert > the types to something which can be used in Haskell's IO system, > but I keep running into errors ... but I'm still not enough of a > Haskell guru to be able to debug them. > > What I've got now is: > > instance Show (NSString ()) where > show = fromNSString The error is due to a limitation in Haskell 98 (which, I think, was put there to prevent the type class system from becoming to complex). If you use -fglasgow-exts, the above should be legal. A note on the () and why instance Show (NSString a) is a Bad Thing: The () means exacly NSString, no subclasses, and the a means, subclasses allowed. NSMutableString is a subclass of NSString, and using pure functions on mutable objects is evil; therefore, fromNSString has type NSString () -> String rather than NSString a -> String. > 2) CamelBones, a Perl-Cocoa bridge, supports "toll-free bridging" > between Perl types and Obj-C types NSArray, NSDictionary, NSString, > etc. Is this an option with hoc for future development? It's not that easy; for Perl, they probably get to do it based on some runtime type of the object (NSString or Perl String). That won't work for Haskell, of course. To do it the statically typed way, we might introduce some type class, say "StringClass", and make both NSString () and String instances of that class. This would mean a lot of ambiguity, though; whenever you get a NSString object from one method and pass it to another, you'd have to specify a type annotation (:: NSString () or :: String) to specify whether it should be converted to a Haskell String and back, or not. I don't think it's worth it, I'd rather stick with explicit to/fromNSString. However, if, one day in the future, there is a standard library type class for strings (to support things like packed strings more natively), we could take advantage of that by making NSString () an instance of that class. Don't hold your breath though, this is being discussed about once a year on various Haskell mailing lists, with no results so far. Cheers, Wolfgang |
From: Arouna <aro...@ho...> - 2005-08-18 19:23:34
|
Hello Dear I am contacting you believing you are a honest and trustworthy person.I = believe you will not betray the confidence I am willing to repose in you, for = me to have contacted you even though we've not met before. My name is Arouna Goudal=E9,the only son of late Mr.Hassan Goudal=E9 who = was the chairman /President/CEO,Cacao-Cafe & Agro-Alimentary industries = plc.SCAFECAO)"Bouake" and ex-owner of Polyclinic LA-MADONNE, of the Republic = of Cote d'Ivoire,please if possible you can send phone contact for good = cominucation. You can find the story on this = website:http://news.bbc.co.uk/2/hi/africa/2269238.stm On 19th of September 2002,a group of so called rebels took over the city of = Bouake to over-throw the Government of Mr.Laurent Gbagbo the President of = Cote d'Ivoire. On the 20th day morning at about 4:18am some fractions of the = same group of rebels break into our house and killed our security guard and = pass-through the gate entrance to the main building and took my father away = to an un-known destination. After about four hours later we found him (my father) at the road side, by = then he had been totally beaten and was bleeding to death lying in the pool = of his own blood. From there, we rushed him to a near by hospital and hours = later he sent for my mother. So he told her that he can not make it from the = doctors diagnosis, he also told her that it was because he (my father) was = not from the northern part of the country that he has been treated this way = and also being a political activist. And again he said he is suspecting some = of his business partners for conspiracy and this sort of brutality. He also = told my mother that he deposited a huge amount of money in a Finance house in = the Capital city of Senegal (Dakar) and also told her where he kept the whole = documents concerning this deposit that is made for investment purpose in the = western world. That same day, he (my father) gave up the ghost. Then with the help of the = French soldiers, we escaped to Senegal, where we are now. I am now contacting = you believing you are honest and trustworthy to help us to receive the money = in your account for investment, I and my mother has decided in compensating = you 20%of the total amount for your assistance . Please do take your time to go through the mail and get back to us, so that I = will simply introduce to the Finance house where the fund are being kept now = for onward transfer.alternative mail is ar...@wa... I am waiting for your response. Thanks and God bless. Arouna Goudal=E9 . |
From: Wolfgang T. <wol...@gm...> - 2005-07-23 02:07:45
|
> There's just one problem left: When I demand the state of a button, > it returns an IO Int, the according constants are of type > NSCellStateValue. Is there a way to "cast" those values? The InterfaceGenerator generates the following: data NSCellStateValue = NSMixedState | NSOffState | NSOnState instance ObjCArgument NSCellStateValue CInt where exportArgument NSMixedState = return (-1) exportArgument NSOffState = return 0 exportArgument NSOnState = return 1 importArgument (-1) = return NSMixedState importArgument 0 = return NSOffState importArgument 1 = return NSOnState objCTypeString _ = "i" You can use those, but it is obviously necessary to design something "proper". Haskell's Enum class would not be appropriate because the succ, pred, enumFromTo, etc. functions aren't appropriate for everything that is defined using C enum. And while we're at it, there's the question of what to do with anonymous enums (I'm just ignoring them so far). Cheers, Wolfgang |
From: Christian H. <chr...@gm...> - 2005-07-23 00:59:24
|
Thank you very much for your help! Everything works great now! There's just one problem left: When I demand the state of a button, it returns an IO Int, the according constants are of type NSCellStateValue. Is there a way to "cast" those values? Cheers, Chris |
From: Wolfgang T. <wol...@gm...> - 2005-07-22 02:57:47
|
> To make it more interesting, it uses the > "performSelectorWithObject" method on itself. When I do this, my > application crashes. I found the problem. performSelectorWithObject calls a method that takes an object parameter _and returns an object_. You need to declare: $(declareSelector "dummy:" [t| forall a. NSObject a -> IO (NSObject ())|]) and return nil from the method. When performSelectorWithObject calls a method without a return value, it passes on whatever (garbage) value it finds in the machine register R3 that would have been used for the return value. When HOC tries to convert that garbage value back to a Haskell object, it crashes. I'll try to add some additional sanity checks there so that we can at least have better error messages. Cheers, Wolfgang |
From: Christian H. <chr...@gm...> - 2005-07-21 11:15:14
|
Am 21.07.2005 um 04:23 schrieb Wolfgang Thaller: >> now that the installation finally succeeded, the real problems >> begin... >> >> I wrote a small application with a "Quit" button. Before the >> application displays that it quits, I want it to perform some >> fancy action: call the dummy method "dummy" on itself. (Ok, this >> is just a simplified version of what I really want...) >> >> To make it more interesting, it uses the >> "performSelectorWithObject" method on itself. When I do this, my >> application crashes. >> > > Please stand by while I try to reproduce the problem... does > running the program from gdb turn up anything at all? > I could locate the problem a bit better: The problem is, that I import a module where (what I forgot) a global MVar is declared, like module Test where import Control.Concurrent.MVar import System.IO.Unsafe testVar :: MVar Int testVar = unsafePerformIO (newMVar 0) The module has so far not been used at all in my application, but the import alone seems to interfere somehow with the Cocoa framework. This problem remains when compiling with the -threaded option. Cheers, Chris |
From: Wolfgang T. <wol...@gm...> - 2005-07-21 02:36:36
|
Christian Hofer wrote: > By the way, is there a way to get MVar concurrency working together > with HOC? Can I use MVars just like that (after telling Cocoa to > run thread-safe)? Do I have to use POSIX threads? Compile your program using the -threaded option to ghc in order to enable the threaded run time system. Then, "forkIO" spawns an "unbound" (lightweight) thread. The RTS may run multiple lightweight threads in a single POSIX thread. Do not call Cocoa from threads created by forkIO. "forkOS" spawns a POSIX thread. Best of all, you can also use NSThread from HOC. And YES, MVars will work between all those different threads. Note that if you don't use -threaded, calls to forkIO will cause a run time error and calls to any Haskell code from other OS threads (NSThreads, pthreads, whatever) will most likely result in a crash. Cheers, Wolfgang |
From: Wolfgang T. <wol...@gm...> - 2005-07-21 02:23:44
|
> now that the installation finally succeeded, the real problems > begin... > > I wrote a small application with a "Quit" button. Before the > application displays that it quits, I want it to perform some fancy > action: call the dummy method "dummy" on itself. (Ok, this is just > a simplified version of what I really want...) > > To make it more interesting, it uses the > "performSelectorWithObject" method on itself. When I do this, my > application crashes. Please stand by while I try to reproduce the problem... does running the program from gdb turn up anything at all? Cheers, Wolfgang |
From: Christian H. <chr...@gm...> - 2005-07-20 23:43:51
|
Hi again, now that the installation finally succeeded, the real problems begin... I wrote a small application with a "Quit" button. Before the application displays that it quits, I want it to perform some fancy action: call the dummy method "dummy" on itself. (Ok, this is just a simplified version of what I really want...) To make it more interesting, it uses the "performSelectorWithObject" method on itself. When I do this, my application crashes. In Objective-C it looks like this (and it works): - (IBAction)quit:(id)sender { [self performSelector: @selector(dummy:) withObject: self]; [actionLabel setStringValue: [NSString stringWithCString: "Quit!" encoding: NSMacOSRomanStringEncoding]]; } - (void)dummy:(NSObject*)ignored { } In Haskell, I started like this: I declared a selector for my dummy in my Selectors.hs: $(declareSelector "dummy:" [t| forall a. NSObject a -> IO ()|]) Then I added an instance method: $(exportClass [...] InstanceMethod Selectors.info_dummy]) inet_dummy _ self = return () inet_quit _ self = self # performSelectorWithObject (getSelectorForName "dummy:") self -- self # inet_dummy self <-- that works, but is not what I want! self #. _actionLabel >>= setStringValue (toNSString ("Quit!")) -- replacing this line with just a "return ()" works as well!!! Now, the selector is found ((self # respondsToSelector (getSelectorForName "dummy:")) returns true), but when I try to perform the selector, and change the label text afterwards, the application crashes. Am I doing something wrong? (Remark: I did not use the -O compiler option.) By the way, is there a way to get MVar concurrency working together with HOC? Can I use MVars just like that (after telling Cocoa to run thread-safe)? Do I have to use POSIX threads? Regards, Chris |
From: Wolfgang T. <wol...@gm...> - 2005-07-19 23:40:58
|
> Indeed, there is no HOC.conf, only the files: > > $ find . -name 'HOC.conf*' > ./HOC/HOC.conf-inplace > ./HOC/HOC.conf.in Oops, a missing dependency in the Makefile. Fixed now in CVS, a quick workaround: cd HOC make HOC.conf Thanks for the report. Cheers, Wolfgang |
From: Christian H. <chr...@gm...> - 2005-07-19 16:02:42
|
Am 18.07.2005 um 18:27 schrieb Wolfgang Thaller: > Grmpf. Code built by 3.3 "should not" refer to fprintf$LDBLStub. > a) Make sure you've completely rebuilt the HOC_cbits directory > after switching to gcc 3.3. ("make clean" should work, but don't > trust my Makefiles to work correctly; make sure that all the .o > files are really gone). Ok. Indeed, "make clean" did not remove the libffi object files. I deleted the whole thing, refetched it from CVS, and now the compilation works fine. Thank you for your help! But now, "make install" fails with the following error: --- ghc-pkg update HOC.conf Reading package info from "HOC.conf" ghc-pkg.bin: HOC.conf: openFile: does not exist (No such file or directory) make[1]: *** [install] Error 1 --- Indeed, there is no HOC.conf, only the files: $ find . -name 'HOC.conf*' ./HOC/HOC.conf-inplace ./HOC/HOC.conf.in Regards, Chris |
From: Wolfgang T. <wol...@gm...> - 2005-07-18 16:27:44
|
> Unfortunately, yes. (In order to be sure, I tried it again, but the > problem remains.) > > Chris > > $ gcc --version > gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1809) > Copyright (C) 2002 Free Software Foundation, Inc. Grmpf. Code built by 3.3 "should not" refer to fprintf$LDBLStub. a) Make sure you've completely rebuilt the HOC_cbits directory after switching to gcc 3.3. ("make clean" should work, but don't trust my Makefiles to work correctly; make sure that all the .o files are really gone). b) Write a "Hello, world" program in C (#include <stdio.h> and use printf, other popular "Hello, world" variants don't do the trick here...). Look at or send me the output of gcc -S and gcc -E. If the output mentions $LDBLStub, find out the values of the __LDBL_MANT_DIG__ and __DBL_MANT_DIG__ macros. (See sys/cdefs.h for info on how Apple's headers decide whether to use "foo$LDBLStub" instead of plain "foo" for some library functions). Cheers, Wolfgang |
From: Christian H. <chr...@gm...> - 2005-07-18 09:43:57
|
Am 18.07.2005 um 07:54 schrieb Wolfgang Thaller: >> ../HOC_cbits/HOC_cbits.o: unknown symbol `_fprintf$LDBLStub' >> > > Are you sure that you are using gcc 3.3 and not gcc 4.0? That's a > known incompatibility between ghc 6.4 and gcc 4.0 (use "sudo > gcc_select 3.3") Unfortunately, yes. (In order to be sure, I tried it again, but the problem remains.) Chris $ gcc --version gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1809) Copyright (C) 2002 Free Software Foundation, Inc. |
From: Wolfgang T. <wol...@gm...> - 2005-07-18 05:54:17
|
> ../HOC_cbits/HOC_cbits.o: unknown symbol `_fprintf$LDBLStub' Are you sure that you are using gcc 3.3 and not gcc 4.0? That's a known incompatibility between ghc 6.4 and gcc 4.0 (use "sudo gcc_select 3.3") Cheers, Wolfgang |
From: Christian H. <chr...@gm...> - 2005-07-17 21:06:33
|
Hi, I am unable to build HOC under the specified conditions. make outputs the following: ghc-6.4: ../HOC_cbits/HOC_cbits.o: unknown symbol `_fprintf$LDBLStub' final link ... ghc-6.4: linking extra libraries/objects failed make[1]: *** [ghcmake.build-stamp] Error 1 In directory InterfaceGenerator mkdir -p build /usr/local/bin/ghc --make Main.hs \ -odir build -hidir build \ -package-conf ../inplace.conf \ -o ifgen ../inplace.conf: openBinaryFile: does not exist (No such file or directory) ... (and lots of further error messages) Unfortunately, I am quite illiterate w.r.t. the make-procedure. So I have no idea what that means. Can anybody give me a hint? Cheers, Chris |
From: Wolfgang T. <wol...@gm...> - 2005-06-12 19:41:10
|
I just found out about a problem with GHC 6.4 and gcc 4.0 on Tiger that affects the HOC CVS version (thanks for Petter Egesund for making me aware of the problem). You have to switch to gcc 3.3 for compiling (the libffi component of) HOC; if you compile it using gcc 4.0, there will be strange errors later during the build. Enjoy, Wolfgang |
From: Wolfgang T. <wol...@gm...> - 2005-06-12 13:54:33
|
On 12-Jun-05, at 9:03 AM, Petter Egesund wrote: > Thanks for answering! > > It does not seem like inplace.conf exists?! > > A dump from make is enclosed! Ah, I see, make in directory HOC failed for another reason: Compiling HOC.StdArgumentTypes ( ./HOC/StdArgumentTypes.hs, build/ objects/HOC/StdArgumentTypes.o ) ghc-6.4: ../HOC_cbits/HOC_cbits.o: unknown symbol `_fprintf$LDBLStub' There seem to be lots of problems involving _fprintf$LDBLStub on the net, but I didn't quite manage to figure things out yet, and I'm unable to reproduce the problem. Which gcc and OS version are you using? If you are using gcc 4 and tiger: have you installed XCode 2.1 (the new "universal binaries" release)? Cheers, Wolfgang |