Anonymous (owner)

Revisions

  • 9b49c0 Thu Jul 31 13:33:00 -0700 2008
  • 37e283 Thu Jul 31 13:32:32 -0700 2008
gist: 3523 Download_button fork
public
Public Clone URL: git://gist.github.com/3523.git
Text only
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
> ruby lib/compiler/mri_compile.rb -frbx-kernel clone.rb clone.rbc
./lib/compiler/../../vm/gen/simple_field.rb:331: warning: already initialized constant Slots
Compiling clone.rb
> vm/vm clone.rbc
Loading: clone.rbc
Runtime exception: Unable to resolve primitive
> rake vm:missing_primitives |grep object_clone
>
 
> cat clone.rb
s1 = "Hello"
def klone; Ruby.primitive :object_clone; end
class << s1
  def foo; p 5;end
end
 
s2 = s1.klone
s2.foo