- Implements ~90% of Ruby functionality with some bugs
- Can be used to create OS X desktop applications
- Integrates with XCode
- Uses the Obj-C GC (deprecated)
- Fix known Ruby compatibility bugs
#include <stdio.h> | |
void method(char* first, char* second, char* third) | |
{ | |
printf("method arguments - first: %s, second: %s, third: %s\n", first, second, third); | |
return; | |
} | |
void wrapped_method(char* first, char* second, char* third); | |
#define method(first, second, third) wrapped_method((second), (third), (first)) |
def process(input) | |
commands = { | |
'q' => -> { puts 'Goodbye' }, | |
'tweet' => -> { puts 'tweeting' }, | |
'dm' => -> { puts 'direct messaging' }, | |
'help' => -> { puts 'helping' } | |
} | |
commands.fetch(input, -> {}).call() | |
end |
def munger(&block) | |
block.binding.eval('b = rand(99)') | |
end | |
def doit | |
a = 1 | |
b = 2 | |
munger do; end | |
puts "a + b = #{a + b}" | |
end |
class FunkyStringComp | |
def to_str | |
raise "This is some crazy shit..." | |
end | |
def <=>(oth) | |
3.0 | |
end | |
end |
class Greater | |
def <=>(other) | |
1 | |
end | |
end | |
g = Greater.new | |
t = Time.now | |
s = "test" | |
i = 101 |
### | |
# | |
# This is a dirty, dirty trick to write tests that test `require`: | |
# | |
module RequireMock | |
REQUIRE_SENTINEL = [] | |
def require(lib) | |
REQUIRE_SENTINEL << lib | |
super |
(defproject bebop "1.0.0-SNAPSHOT" | |
:description "Space Cowboy" | |
:dependencies [[ring/ring-jetty-adapter "1.1.5"] | |
[cheshire "4.0.2"] | |
[hiccup "1.0.1"] | |
[org.clojure/clojure "1.4.0"] | |
[tnrglobal/bishop "1.2.0"]] | |
:immutant {:content-path "/"}) |
strategy = | |
String(ARGV.shift || 'thread') | |
n = | |
Integer(ARGV.shift || 4) | |
mb = |
class MyGroupedListController < UIViewController | |
attr_accessor :posts | |
attr_accessor :sections | |
class TableViewSection | |
attr_accessor :title | |
attr_accessor :items | |
def initialize(params={}) | |
@title = params[:title] |