Hi Mark:

  Just a quick iOS update.  I grabbed the latest from your git repo and
from my initial work at implementing the required glib methods that you're
using, I now have it running on both my iPad and iPhone4S.  I don't look at
the glib source - I just google the missing function name and implement it
based on what the docs describe.   It spits out (to the debug console) the
same output as OSX shows when running "./cljc" from the Terminal, which
would be: "(4 5)"

  I took a snap of xcode running (with the "(4 5)" ) and dumped it here:
http://antimass.org/clojure/cljc_xcode.png

  As you can see, there are some "Unused variable 'env'" and "Expression
result unused" warnings which I'll probably just disable. But the main item
I was trying to determine from all this, was that it would be possible to
use your clojurec work under iOS, which now looks very doable!  The only
change I really had to make to the generated cljc.c file was change main()
-> main_ios() which I call from [AppDelegate
application:didFinishLaunchingWithOptions].

  I'll clean it up and commit to my github clojurec repo branch and then
I'll do a pull request later this weekend/Monday.  I'll also pop my signed
Clojure Contribution Agreement in the mail tomorrow incase that's needed.
 Again, thanks for your work on clojurec!  And to David Nolen for
ClojureScript - I do most of my play in ClojureScript and it's REPL (mainly
playing with WebGL as it ties into my day job. :)   I just want to have the
option to compile it out to C and then release in the App Store(s).  Cheers,

  Adam


On Tue, Jul 10, 2012 at 3:29 PM, Mark Probst <mark.pro...@gmail.com> wrote:

> Hey Adam,
>
> >   I've spent a couple of hours on this - and have run into a snag.  I've
> got
> > libgc compiling/linking with arm iOS and the Xcode project compiles
> cljc.c
> > fine. The problem is glib.  From what I've read, iOS can not use glib as
> it
> > must be statically linked into the app - but the LGPL doesn't allow that
> (at
> > least from what I've read).  Currently, there only seems to be about 7
> > methods that you're using that need it - 6 of which at utf8 related.  So,
> > I'm thinking that I'll make a 'prepreamble.m' and use NSString's
> > utf8/unichar support for simulating those methods.  But before I spend
> time
> > on that, any comments or ideas?  For g_file_get_contents(), I can
> probably
> > use [NSString stringWithContentsOfFile:encoding:error].
>
> I see the problem.
>
> My guess is that on iOS we'd use NSString anyway, even if we use glib2
> or whatever else for command-line programs.  One problem here is that
> you cannot allocate NSString's from Boehm, so you'd have to use
> finalizers to make sure the NSString's are released when the
> corresponding Clojure objects are collected.  See
> GC_register_finalizer in Boehm's gc.h.
>
> Late on we'll have proper Objective-C bindings, so the glueing will
> become much easier.
>
> Mark
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to