Permalink
Browse files

forgot to commit these small details

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRubyWebsite/trunk@4387 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent 21d336a commit 6550eb96f87c28ad714091e9db48406c3d69c20d @lrz lrz committed Jul 28, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 content/documentation/rubycocoa-to-macruby.txt
@@ -114,8 +114,8 @@ MacRuby allows you to use this syntax in your own method declarations, too:
<pre class="commands">
# MacRuby code
def saveWorld(planet, fromVillain: badguy, withHero:superhero)
- superhero.fight(badguy)
- planet.thank(superhero)
+ superhero.fight(badguy)
+ planet.thank(superhero)
end
</pre>
@@ -194,14 +194,14 @@ end
h3. Exception Handling
-Though Ruby's @Exception@ class and Objective-C's @NSException@ class are not technically bridged classes, @begin...rescue@ blocks in MacRuby can catch both Ruby @Exceptions@ and Cocoa @NSExceptions@. Conversely, you can catch MacRuby @Exceptions@ with Objective-C's @try@@/@catch@.
+Though Ruby's @Exception@ class and Objective-C's @NSException@ class are not technically bridged classes, @begin...rescue@ blocks in MacRuby can catch both Ruby @Exceptions@ and Cocoa @NSExceptions@. Conversely, you can catch MacRuby @Exceptions@ with Objective-C's @@try@/@@catch@.
h3. Other Syntactic Extensions
The MacRuby team has ported the syntactic extensions present in RubyCocoa for cases when Objective-C idioms differ with Ruby idioms, such as in the case of mutator methods and boolean accessor methods:
<pre class="commands">
-layer.setPosition = [100, 100] # Objective-C style
+layer.setPosition([100, 100]) # Objective-C style
layer.position = [100, 100] # Ruby style; calls the same method the Objective-C one does
layer.isHidden # Objective-C style
layer.hidden? # Ruby allows the '?' character in method names

0 comments on commit 6550eb9

Please sign in to comment.