treaz
treaz

Reputation: 508

Clone behavior diffent in REPL vs script

I have this piece of code that behaves differently in the io REPL vs running it as a script (i.e. io matrix_clone_test.io). To be specific:

I was expecting in both cases to see different objects resulting from Matrix clone. What am I missing?

Code snippet

Matrix := Object clone
matrix1 := Matrix clone
matrix2 := Matrix clone
matrix1 proto println
matrix2 proto println

Console output

Io> Matrix := Object clone
==>  Matrix_0x739da0:
  type             = "Matrix"

Io> matrix1 := Matrix clone
==>  Matrix_0x504b80:

Io> matrix2 := Matrix clone
==>  Matrix_0x42edd0:
[println code excluded for brevity]

Script execution

 Matrix_0x40f210:
  type             = "Matrix"

 Matrix_0x40f210:
  type             = "Matrix"

Upvotes: 0

Views: 38

Answers (0)

Related Questions