Skip to content

Instantly share code, notes, and snippets.

@jsn
Created February 9, 2018 00:24
Show Gist options
  • Save jsn/2c33727b1e204038c807b1ec2c7cdb62 to your computer and use it in GitHub Desktop.
Save jsn/2c33727b1e204038c807b1ec2c7cdb62 to your computer and use it in GitHub Desktop.
jason@jsn cr $ head -n1000 z.cr z2.cr
==> z.cr <==
def q
puts "in q"
1
end
Q = q()
class Z
def self.f(k)
puts "in class method for #{k}"
return Time.now
end
@@x : Time = f(:x)
@@y : Time = f(:y)
def self.x
@@x
end
puts "in class"
end
puts "out of class"
==> z2.cr <==
# puts Q
puts "before"
require "./z"
puts "after"
jason@jsn cr $ crystal z2.cr
before
in class method for x
in class method for y
in class
out of class
after
jason@jsn cr $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment