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
class KVO { | |
class ClassMethods { | |
def define_slot_writer: slotname { | |
define_method: "#{slotname}:" with: |val| { | |
old_val = get_slot: slotname | |
set_slot: slotname value: val | |
match val { | |
case old_val -> nil # do nothing if no change | |
case _ -> | |
if: (__kvo_observers__[slotname to_sym]) then: @{ each: @{ call: [val] } } |
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
#!/usr/bin/env fancy | |
# A simple guessing game written in Fancy. | |
amount-guesses = 6 | |
"Welcone to the game!" println | |
random-number = 100 random + 1 | |
amount-guesses downto: 1 do: |remaining-guesses| { | |
"You have #{remaining-guesses} guesses remaining." println |
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
Rubinius Crash Report #rbxcrashreport | |
Error: signal �SIGSEGV | |
[[Backtrace]] | |
0 rbx 0x000000010b4d77c6 _ZN8rubiniusL12segv_handlerEi + 486� | |
1 libsystem_c.dylib 0x00007fff8ea54cfa _sigtramp + 26� | |
2 ??? 0x000000010dca32c0 0x0 + 4526322368� | |
3 rbx 0x000000010b699fec _ZN8rubinius13VariableScope4Info4markEPNS_6ObjectERNS_10ObjectMarkE + 124� | |
4 rbx 0x000000010b6b131b _ZN8rubinius16GarbageCollector11scan_objectEPNS_6ObjectE + 441� |
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
Rubinius Crash Report #rbxcrashreport | |
Error: signal SIGSEGV | |
[[Backtrace]] | |
0 rbx 0x000000010b96e9c6 _ZN8rubiniusL12segv_handlerEi + 486 | |
1 libsystem_c.dylib 0x00007fff8ea54cfa _sigtramp + 26 | |
2 ??? 0x00007fa2059c63c0 0x0 + 140333855564736 | |
3 libcrypto.0.9.8.dylib 0x00007fff8af503e4 CRYPTO_set_ex_data + 36 | |
4 openssl.bundle 0x000000010f5f96dc ossl_x509store_set_vfy_cb + 60 |
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
# usage: | |
class Fixnum { | |
def / other { | |
require: @{ | |
other class is: Fixnum | |
other is > 0 | |
} body: { | |
# actual method body goes here.. | |
} | |
} |
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
$ rbx -e "require('sha1'); SHA1.new('foo')" | |
An exception occurred evaluating command line code | |
StackError (StackError) | |
Backtrace: | |
SHA1.orig_new (new) at projects/rubinius/lib/digest/sha1.rb:11 | |
SHA1.orig_new (new) at projects/rubinius/lib/digest/sha1.rb:15 (7260 times) | |
SHA1.new at projects/rubinius/lib/sha1.rb:11 | |
{ } in Object#__script__ at -e:1 | |
Rubinius::BlockEnvironment#call_on_instance at kernel/common |
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
Rubinius Crash Report #rbxcrashreport | |
Error: signal �SIGSEGV | |
[[Backtrace]] | |
[[System Info]] | |
sysname: Darwin | |
nodename: udp090078uds.ucsf.edu | |
release: 11.0.0 |
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
#!/Users/cb/projects/rubinius/bin/rbx | |
# | |
# This file was generated by RubyGems. | |
# | |
# The application 'fancy' is installed as part of a gem, and | |
# this file is here to facilitate running it. | |
# | |
require 'rubygems' |
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
g++ -I. -I. -I/Users/backtype/projects/rubinius/vm/capi/include -I/Users/backtype/projects/idefy/FXRuby-1.6.19/ext/fox16 -DHAVE_SYS_TIME_H -DHAVE_SIGNAL_H -I/usr/local/include/fxscintilla -I/usr/local/include/fox-1.6 -fPIC -ggdb3 -O2 -fPIC -O0 -Iinclude -c FXRuby.cpp | |
FXRuby.cpp: In function ‘long int FXRbHandleMessage(FX::FXObject*, intptr_t, FX::FXObject*, FX::FXSelector, void*)’: | |
FXRuby.cpp:1271: error: invalid conversion from ‘intptr_t (*)()’ to ‘intptr_t (*)(...)’ | |
FXRuby.cpp:1271: error: initializing argument 1 of ‘intptr_t rb_rescue2(intptr_t (*)(...), intptr_t, intptr_t (*)(...), intptr_t, ...)’ | |
FXRuby.cpp:1271: error: invalid conversion from ‘intptr_t (*)()’ to ‘intptr_t (*)(...)’ | |
FXRuby.cpp:1271: error: initializing argument 3 of ‘intptr_t rb_rescue2(intptr_t (*)(...), intptr_t, intptr_t (*)(...), intptr_t, ...)’ | |
make: *** [FXRuby.o] Error 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
backtype ~/projects/fancy[master] $ rake -v | |
(in /Users/backtype/projects/fancy) | |
bison --output /Users/backtype/projects/fancy/lib/parser/ext/parser.c -d -v /Users/backtype/projects/fancy/lib/parser/ext/parser.y | |
/Users/backtype/projects/fancy/lib/parser/ext/parser.y:182.17-25: warning: type clash on default action: <object> != <> | |
/Users/backtype/projects/fancy/lib/parser/ext/parser.y: conflicts: 301 shift/reduce, 46 reduce/reduce | |
flex --outfile /Users/backtype/projects/fancy/lib/parser/ext/lexer.c --header-file=lexer.h /Users/backtype/projects/fancy/lib/parser/ext/lexer.lex | |
rbx /Users/backtype/projects/fancy/lib/parser/ext/extconf.rb | |
checking for main() in -lfl... yes | |
creating Makefile | |
flex --outfile /Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.c --header-file=lexer.h /Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex |