Crystal Example Code
# ˅
# ˄
module Foo
# ˅
# ˄
# ˅
# ˄
end
# ˅
# ˄
Crystal Example Code
# ˅
# ˄
struct Foo
# ˅
# ˄
# ˅
# ˄
end
# ˅
# ˄
Crystal Example Code
# ˅
# ˄
enum Foo
Red
Green
Blue
# ˅
# ˄
end
# ˅
# ˄
Crystal Example Code
# ˅
require "./bar"
# ˄
class Foo
include Bar
# ˅
# ˄
# ˅
# ˄
end
# ˅
# ˄
Crystal Example Code
# ˅
# ˄
class Foo
# ˅
# ˄
@name : string
getter name
def initialize
# ˅
# ˄
end
# ˅
# ˄
end
# ˅
# ˄
Write macros in the User Code Area - which is an area quoted with “˅” and “˄”.
Crystal Example Code
# ˅
macro println(*values)
print {{*values}}, '\n'
end
# ˄
class Foo
# ˅
macro emphasize(value)
"***#{ {{value}} }***"
end
# ˄
def initialize
# ˅
# ˄
end
# ˅
# ˄
end
# ˅
# ˄