[gambit-list] Problem with interactive development using remote REPL of iOS Sim.

mikel evins mevins at me.com
Wed Mar 6 21:16:30 EST 2013


On Mar 1, 2013, at 2:33 AM, mikel evins <mevins at me.com> wrote:

> I think it's worth mentioning a couple of things that are made possible by the CCL FFI, and that Gambit users might want to consider. 
> 
> With CCL's FFI you can make Lisp classes whose superclasses are Objective-C classes. You can write Lisp methods for Objective-C functions (or, rather, "messages"). You can create instances of Objective-C classes some of whose instance variables are Lisp values, and vice-versa: instances of Lisp classes, some of whose slots are Objective-C values. As shown in the example, you can call Objective-C methods directly, and you can refer to Objective-C variables and constants directly.
> 
> Again, almost all of the infrastructure is generated automatically, using ffigen together with parsers written in Lisp.

I thought I'd just see how hard it was to use the current version of ffigen to generate Cocoa headers, as I haven't done it in a while. It was pretty easy; it took less than 15 minutes from start to finish. The longest phase was downloading the large piece of ffigen.

I've done it before several times, though.

Actually generating ffi interfaces to Cocoa took three quarters of a second.

Here are a few randomly-chosen samples of the output of ffigen, for illustration:

(function ("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/objc/message.h" 223)
 "objc_msgSendv_stret"
 (function
  ((pointer (void ())) (typedef "id") (typedef "SEL") (typedef "size_t") (typedef "marg_list") )
  (void ())) (extern))

(macro ("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/objc/runtime.h" 364) "_C_ID" "'@'")

(enum-ident ("" 0)
 "OBJC_ASSOCIATION_ASSIGN" 0)
(enum-ident ("" 0)
 "OBJC_ASSOCIATION_RETAIN_NONATOMIC" 1)
(enum-ident ("" 0)
 "OBJC_ASSOCIATION_COPY_NONATOMIC" 3)
(enum-ident ("" 0)
 "OBJC_ASSOCIATION_RETAIN" 769)
(enum-ident ("" 0)
 "OBJC_ASSOCIATION_COPY" 771)

(struct ("" 0)
 "Protocol"
 (("isa" (field (typedef "Class") 0 8))))

(objc-instance-method ("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h" 158)
 "NSObject"
 ("NSDiscardableContentProxy")
 "autoContentAccessingProxy"
 ()
 (typedef "id"))

(var ("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/objc/runtime.h" 593)
 "_zoneAlloc"
 (pointer (function
  ((typedef "Class") (typedef "size_t") (pointer (void ())) )
  (typedef "id"))) (extern))







-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://webmail.iro.umontreal.ca/pipermail/gambit-list/attachments/20130306/802641ce/attachment.html 


More information about the Gambit-list mailing list