This file contains hidden or 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
require "rubygems" | |
require "xmpp4r" | |
jid = Jabber::JID.new "[email protected]" | |
client = Jabber::Client.new jid | |
client.connect | |
puts "connected!" | |
client.auth "mysecretpassword" | |
puts "authenticated!" | |
client.close |
This file contains hidden or 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
backtype ~/Downloads $ rbx ffi-cairo.rb | |
An exception occurred running ffi-cairo.rb | |
Tried to use non-reference value 0x1 as type Float (25) (TypeError) | |
Backtrace: | |
Object#__script__ at ffi-cairo.rb:263 | |
Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:65 | |
Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:90 | |
Rubinius::Loader#script at kernel/loader.rb:591 | |
Rubinius::Loader#main at kernel/loader.rb:721 |
This file contains hidden or 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
def while: a do: b { | |
loop() { | |
a call if_true: b else: { return nil } | |
} | |
} | |
i = 0 | |
while: { i < 1_000_000 } do: { | |
i println | |
i = i + 1 |
This file contains hidden or 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
diff --git a/lib/compiler/ast/identifier.fy b/lib/compiler/ast/identifier.fy | |
index 591036b..49e70fa 100644 | |
--- a/lib/compiler/ast/identifier.fy | |
+++ b/lib/compiler/ast/identifier.fy | |
@@ -53,9 +53,9 @@ class Fancy AST { | |
def bytecode: g { | |
pos(g) | |
match @string { | |
- case "true" -> g push_true() | |
- case "false" -> g push_false() |
This file contains hidden or 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
require("rubygems") | |
require("sinatra") | |
get("/") { | |
"Hello, Sinatra, from Fancy!" | |
} | |
Sinatra Application run!() |
This file contains hidden or 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
require("rubygems") | |
require("sinatra") | |
gives me: | |
An exception occurred running /Users/backtype/projects/fancy/bin/fancy | |
invalid identifier if_nil: (NameError) | |
Backtrace: | |
{ } in Object#DelegateClass at /Users/backtype/projects/rubinius/lib |
This file contains hidden or 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
backtype ~/projects/rubinius[master] $ rbx | |
irb(main):001:0> require "rubygems" | |
=> true | |
irb(main):002:0> require "fancy" | |
=> true | |
irb(main):004:0> r = Range.fy :new, 0, :to, 100 | |
=> 0..100 | |
irb(main):005:0> r.fy :each, Proc.new{|i| i.fy :println} | |
0 | |
1 |
This file contains hidden or 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
# define some additional methods | |
class Fiber { | |
def sleep: seconds { | |
@sleep_end = Time now + seconds | |
} | |
def asleep? { | |
if: @sleep_end then: { | |
Time now < @sleep_end | |
} |
This file contains hidden or 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
def meth: block { | |
block call: [1,2] | |
} | |
meth: |a,b| { | |
# do stuff here with a and b | |
} |
This file contains hidden or 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
--------------------------------------------- | |
CRASH: A fatal error has occured. | |
Backtrace: | |
0 rbx 0x00000001000201f0 _ZN8rubiniusL12segv_handlerEi + 160 | |
1 libSystem.B.dylib 0x00007fff86a4567a _sigtramp + 26 | |
2 ??? 0x0000003236346461 0x0 + 215657768033 | |
3 rbx 0x0000000100208b82 _ZN8rubinius17VisitInstructionsINS_8JITVisitEE8dispatchEi + 4962 | |
4 rbx 0x00000001001e9af4 _ZN8rubinius3jit7Builder13generate_bodyEv + 1156 | |
5 rbx 0x00000001001d2159 _ZN8rubinius7Inliner21inline_generic_methodEPNS_5ClassEPNS_6ModuleEPNS_14CompiledMethodEPNS_8VMMethodE + 1545 |