value is t or nil.
I've been generating a lot of HTML with Nu and decided to take this simple extension from the Hiccup Clojure library. Now when we specify a markup element with the (&element) automatic operator, we can add classes and id values by including "." and "#" in the element name. Examples: % (puts (&div)) <div></div> % (puts (&div.x)) <div class="x"></div> % (puts (&div#main)) <div id="main"></div> % (puts (&div#main.x1.x2.x3)) <div id="main" class="x1" class="x2" class="x3"></div> Beware that this means that the '#' can now be included in symbols, so if you have code like "this#", you will be unpleasantly surprised by this change.
If you send the map: message to a dictionary and it will apply the provided callable to each value and return another dictionary with the results set for the corresponding keys. E.g.: % (set origin (dict "alpha" 10 "bravo" 20)) <__NSDictionaryM:7f9224202c50> % (set destination (origin map: (do (x y) (+ 1 y)))) <__NSDictionaryM:7f9224202f40> % (destination "bravo") 21
also fixed unit test that expected "Xcode" to be installed. It fails when a developer preview is installed instead (under a different name).
…mbols to ObjC type signatures. Updated the cblock macro in cblocks.nu to use the signature operator. Added a test for c blocks to the TestBridge class.
… and added a test case for cblocks
NSXMLDocument is one of many classes whose init methods return something other than self. Others include NSArray and NSDictionary, which return a special "placeholder" subclass instance from alloc. NSXMLDocument behaves similarly but without an explicit placeholder subclass. This change should eliminate a crash that occurred when placeholders were overreleased. In past versions of Nu, we looked for known explicit placeholders and handled them specially, but this was removed in Lion when the NSArray and NSDictionary placeholders subclasses appeared to to ignore release messages. However, this was not true for NSXMLDocument, which implicitly uses the placeholder pattern and does not have a placeholder subclass. Now we watch methods whose names begin with "init" to see if they return their original target or not, which allows us to properly handle the placeholder pattern whether it is used from an explicit placeholder subclass or not.
* "Normal" message forwarding implement: -forwardInvocation:, -respondsToSelector:, -methodSignatureForSelector: * "Fast" message forwarding implement: -forwardingTargetForSelector:
…the match functions.
…broken for iOS simulator-only. oddly, these tests pass on the device.
The (ivars) and (ivar-accessor) operators now do nothing and should be removed. Instance variables are now implicitly created and stored using associated objects, so there is no overhead for their potential use. The (cmethod) and (imethod) operators are still available but with a deprecation warning in the log. They should be replaced by (+) and (-), which are more consistent with Objective-C usage. The (def) operator is gone. It was carried over from Ruby and in practice, the equivalent (function) is preferred.