Skip to content

Instantly share code, notes, and snippets.

@spieden
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spieden/84bdb5a66321b8a35602 to your computer and use it in GitHub Desktop.
Save spieden/84bdb5a66321b8a35602 to your computer and use it in GitHub Desktop.
; I was able to export a static method I added to NSString with my protocol and category:
cljs.user=> (.hello js/NSString)
"world"
; .. but trying to do the same with a built-in method didn't work:
cljs.user=> (.stringWithContentsOfFilePathEncodingError js/NSString "/tmp/hello" NSUTF8StringEncoding nil)
undefined is not a function (evaluating 'NSString.stringWithContentsOfFilePathEncodingError("/tmp/hello",cljs.user.NSUTF8StringEncoding,null)')
; I was trying to implement spit and slurp with exported methods as an exercise. Seems
; like more wrapping and delegation may be needed. =\ I did try removing "Error" from
; the function name in case JSC treats trailing NSError** args like PyObjc does -- no
; dice.
; Here's a relevant thread I haven't dug into yet: https://gist.github.com/MarkVillacampa/7379799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment