[racket] Does the ffi/unsafe/objc require racket/gui/base to do things?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Jan 13 17:40:40 EST 2013

At Sun, 13 Jan 2013 13:50:52 -0700, Danny Yoo wrote:
> > You may want to use `ffi/unsafe/nsalloc'.
> 
> Ok, I see now.
> 
> 
> As a followup: I've found that I need to have this (or require
> ffi/unsafe/nsalloc, which provides this):
> 
>     (define cocoa-lib (ffi-lib (format
> "/System/Library/Frameworks/Cocoa.framework/Cocoa")))
> 
> before calling into import-class with those Cocoa classes.
> 
> I had assumed that I'd be able to poke around the Cocoa classes
> without having to dynamically load the Cocoa library, so that's where
> I went wrong.  Requiring 'ffi/unsafe/nsalloc' also does the
> prerequisite library-loading work.
> 
> 
> Is it ok to add a little margin note to the docs on import-class to
> provide this warning?

Good idea. I think it fits better inline, though, so I've added a note
that way.


Posted on the users mailing list.