4 ms·
> ps2: How cool would it be to have a REPL console like the one in RubyMotion on the Xcode console? You can! Every time it comes up, I'm going to repeat this
by 286c8cb04bda 14y ago
> ps2: How cool would it be to have a REPL console like the one in RubyMotion on the Xcode console?
You can!
Every time it comes up, I'm going to repeat this suggestion: Use Nu[1] as a REPL for iOS[2] and OS X[3].
[1] http://programming.nu http://programming.nu
[2] http://groups.google.com/group/programming-nu/browse_thread/thread/e8592ef8128245fd/68e83fa4a5306446?lnk=gst&q=#68e83fa4a5306446 http://groups.google.com/group/programming-nu/browse_thread/...
[3] https://github.com/timburks/nu/blob/master/nu/console.nu https://github.com/timburks/nu/blob/master/nu/console.nu
- pssdbt 14y agoSounds interesting... I was just looking into F-script (http://www.fscript.org/ http://www.fscript.org/), is this similar?
- deleted 14y ago[deleted]
- 286c8cb04bda 14y agoAye, pretty similar. F-Script has some features that Nu does not (like the object explorer), while Nu is the only one that works on iOS. The big difference is heritage: F-Script is Smalltalk and Nu is Lisp.
- ctruman 14y agoOkay this sounds really cool, but I am a little confused as to how to implement it. How do I use the console to interact with my app in the simulator?
- 286c8cb04bda 14y ago> How do I use the console to interact with my app in the simulator? Nu builds as a static library. You need to include it in your project and link it into your binary to make it available. Then you'll need to instantiate a NuRemoteHost object after your application has launched. Once it's running you can launch a Nu interpreter and execute NuRemoteClient to connect to the host you created earlier.
- funkyboy 14y agobut then you type nu code in the prompt, not obj-c, right?
- 286c8cb04bda 14y agoYes, you'll be typing Nu code in a Nu interpreter. Even though it's a Lisp dialect, Nu was designed from the beginning to be interoperable with Objective-C, so translating between them is easy. (Convert brackets to parentheses and you're 80% of the way there.) As a contrived example, this: if(![self.address startsWith:@"https://"]) self.address = [@"https://" stringByAppendingString:self.address] Becomes this: (if (not (@address startsWith:"https://")) (set @address ("https://" stringByAppendingString:@address)))
- funkyboy 14y agothanks for the link. I'll try it out.