This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(set malloc (NuBridgedFunction functionWithName:"malloc" signature:"li")) | |
(set memset (NuBridgedFunction functionWithName:"memset" signature:"llil")) | |
(set getchar (NuBridgedFunction functionWithName:"getchar" signature:"i")) | |
;; Allocate in 100MB chunks... | |
(set bytecount (* 1024 1024 100)) | |
(set iterations 10) | |
(set i 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Foundation/Foundation.h> | |
@protocol MyProto | |
@end | |
@interface JSBClass2 <MyProto> | |
@end | |
typedef struct jsbStruct | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface JSBClass : NSObject | |
{ | |
int anIntArray[12]; | |
struct jsbStruct aStruct; | |
struct jsbStruct aStruct2; | |
union jsbUnion aUnion; | |
int anEnum; | |
char aChar; | |
int anInteger; | |
short aShort; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(macro dbg (s) | |
`(let ((_a ,s)) | |
(print ',s) | |
(print " = ") | |
(puts _a) | |
_a)) | |
(function factorial (n) | |
(if (< n 2) | |
(then n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(load "NuMongoDB") | |
(load "NuJSON") | |
(load "Nutils:cl_utils") ; for butlast and last functions | |
(load "Nutils:with_object") ; for with-object | |
; Wrap the mongo connection and make sure the last value of body is | |
; the return value | |
(macro with-mongo ((user password db) *body) | |
(set __allbutlast (butlast *body)) | |
(set __last (last *body)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/objc/nu.m b/objc/nu.m | |
index 1d21a56..170206c 100644 | |
--- a/objc/nu.m | |
+++ b/objc/nu.m | |
@@ -230,6 +230,12 @@ int NuMain(int argc, const char *argv[], const char *envp[]) | |
@catch (NuException* nuException) | |
{ | |
printf("%s\n", [[nuException dump] cStringUsingEncoding:NSUTF8StringEncoding]); | |
+ if ([[nuException name] isEqualToString:@"NuUndefinedSuperclass"]) { | |
+ NSArray* a = [[nuException reason] componentsSeparatedByString:@" "]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = "/Users/jsb/Desktop/LayerTest"; | |
var filename = "jefftest.acorn"; | |
var acorn = JSTalk.application("Acorn"); | |
var doc = acorn.open(path + "/" + filename); | |
var count = doc.layers().count(); | |
for (i = 0; i < count; i++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static IMP handler_returning_void(void* userdata) | |
{ | |
return imp_implementationWithBlock(^(id receiver, ...) { | |
struct handler_description description; | |
description.handler = NULL; | |
description.description = userdata; | |
va_list ap; | |
va_start(ap, receiver); | |
nu_handler(0, &description, receiver, ap); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(set popen (NuBridgedFunction functionWithName:"popen" signature:"l**")) | |
(set pclose (NuBridgedFunction functionWithName:"pclose" signature:"il")) | |
(set fgetc (NuBridgedFunction functionWithName:"fgetc" signature:"il")) | |
(set mktemp (NuBridgedFunction functionWithName:"mktemp" signature:"**")) | |
(set unlink (NuBridgedFunction functionWithName:"unlink" signature:"i*")) | |
(function sys (command) | |
(set tempfile (mktemp "temp.XXXXXX")) | |
(set c (+ "(" command " 2>&1) > " tempfile)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMenu* menubar = [NSMenu new]; | |
NSMenuItem* appMenuItem = [NSMenuItem new]; | |
[menubar addItem:appMenuItem]; | |
[NSApp setMainMenu:menubar]; | |
NSMenu* appMenu = [NSMenu new]; | |
NSString* toggleFullScreenTitle = @"Toggle Full Screen"; |
OlderNewer