Skip to content

Instantly share code, notes, and snippets.

... .. ...
...... . ..,. ?+. .. ...
........ .I.D ,.=8.I ...
. .. ...... D+8. 7. .:D~? . ..
.... ..... ..I~ =: M .7$ I.. .. ..
.. .....D. .O.D.. .8+Z~
.. .. O .. D~8... =7~D,
..... 8.....=~I. ....=$=N .
.. ....$+.: ..=7$. O:. .7Z?7 . ..
*** why-potion-4476f678fd22706ada7acf2c425c9336328b38c5/core/table.c 2009-07-01 00:07:26.000000000 +0100
--- why-potion-4476f678fd22706ada7acf2c425c9336328b38c5-1/core/table.c 2009-07-03 11:04:06.000000000 +0100
*************** PN potion_tuple_put(Potion *P, PN cl, PN
*** 204,209 ****
--- 204,216 ----
return potion_table_put(P, PN_NIL, potion_table_cast(P, self), key, value);
}
+ PN potion_tuple_map(Potion *P, PN cl, PN self, PN block) {
+ PN_TUPLE_EACH(self, i, v, {
*** ../why-potion-4476f678fd22706ada7acf2c425c9336328b38c5/core/table.c 2009-07-01 00:07:26.000000000 +0100
--- core/table.c 2009-07-03 12:03:20.000000000 +0100
*************** PN potion_tuple_put(Potion *P, PN cl, PN
*** 204,209 ****
--- 204,220 ----
return potion_table_put(P, PN_NIL, potion_table_cast(P, self), key, value);
}
+ PN potion_tuple_map2(Potion *P, PN cl, PN self, PN block) {
+ PN_TUPLE_EACH(self, i, v, {
*** why-potion-4476f678fd22706ada7acf2c425c9336328b38c5/core/table.c 2009-07-01 00:07:26.000000000 +0100
--- why-potion-4476f678fd22706ada7acf2c425c9336328b38c5-2/core/table.c 2009-07-03 11:17:44.000000000 +0100
*************** PN potion_table_each(Potion *P, PN cl, P
*** 59,65 ****
unsigned k;
for (k = kh_begin(t->kh); k != kh_end(t->kh); ++k)
if (kh_exist(t->kh, k)) {
! PN_CLOSURE(block)->method(P, block, self, kh_key(t->kh, k), kh_value(t->kh, k));
}
return self;
@jgouly
jgouly / gist:882276
Created March 22, 2011 22:53
socket errs in rubinius
Socket#getaddrinfo accepts empty addresses for IPv4 passive sockets ERROR
SocketError: Temporary failure in name resolution
{ } in Socket::Foreign.getnameinfo at lib/socket.rb:340
FFI::MemoryPointer.new at kernel/platform/pointer.rb:342
{ } in Socket::Foreign.getnameinfo at lib/socket.rb:332
FFI::MemoryPointer.new at kernel/platform/pointer.rb:342
{ } in Socket::Foreign.getnameinfo at lib/socket.rb:331
FFI::MemoryPointer.new at kernel/platform/pointer.rb:342
Socket::Foreign.getnameinfo at lib/socket.rb:330
Socket::Foreign.unpack_sockaddr_in at lib/socket.rb:431
[jey@tigger rubinius]$ bin/rbx compile -Pe "a = 1 ? 1 : 2"
An exception occurred running compile
undefined method `new' on true:TrueClass. (NoMethodError)
Backtrace:
Kernel(TrueClass)#new (method_missing) at kernel/delta/kernel.rb:85
Rubinius::Compiler::Parser(Rubinius::Compiler::StringParser)#print at \
lib/compiler/stages.rbc:174
CompilerScript#set_printers at lib/bin/compile.rb:129
CompilerScript#compile_string at lib/bin/compile.rb:212
@jgouly
jgouly / gist:882394
Created March 23, 2011 00:26
two rets?
rbx compile -Be "def foo(x) return x; end"
================= :foo =================
Arguments: 1 required, 1 total
Locals: 1: x
Stack size: 2
Lines to IP: 1: -1..3
0000: push_local 0 # x
0002: ret
#!/usr/bin/env rbx
class Code; end
g = Rubinius::Generator.new
g.name = :call
g.file = :"repl"
g.set_line 1
g.push_int 1
#!/usr/bin/env rbx
g = Rubinius::Generator.new
g.name = :call
g.file = :"repl"
g.set_line 1
g.push_const :Kernel
g.push_int 1
g.allow_private
g.send_stack :p, 1
g.ret
def go_to_char( char, after = ON_CHAR )
r = @last_row
i = @lines[ r ].index( char, @last_col + 1 )
if i
if after
i += 1
end
return cursor_to r, i, DO_DISPLAY
end