Last active
August 29, 2015 14:25
-
-
Save spieden/84bdb5a66321b8a35602 to your computer and use it in GitHub Desktop.
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
; 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