2015-05-04 06:12:24 +03:00
|
|
|
module Mal
|
|
|
|
class Symbol
|
2015-05-12 05:33:03 +03:00
|
|
|
property :str
|
|
|
|
def initialize(@str)
|
2015-05-04 06:12:24 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-05-04 13:57:20 +03:00
|
|
|
class List < Array(Type)
|
|
|
|
end
|
|
|
|
|
|
|
|
class Vector < Array(Type)
|
|
|
|
end
|
|
|
|
|
|
|
|
class HashMap < Hash(String, Type)
|
|
|
|
end
|
|
|
|
|
2015-05-11 19:47:58 +03:00
|
|
|
class Type
|
|
|
|
alias ValueType = Nil | Bool | Int32 | String | Symbol | List | Vector | HashMap | ((Array(Type) -> Type))
|
|
|
|
|
|
|
|
def initialize(@val : ValueType)
|
|
|
|
end
|
|
|
|
|
|
|
|
def initialize(other : Type)
|
|
|
|
@val = other.val
|
|
|
|
end
|
2015-05-04 13:57:20 +03:00
|
|
|
|
2015-05-12 05:33:03 +03:00
|
|
|
def unwrap
|
|
|
|
@val
|
|
|
|
end
|
2015-05-04 13:57:20 +03:00
|
|
|
end
|
2015-05-04 22:23:12 +03:00
|
|
|
|
2015-05-12 05:33:03 +03:00
|
|
|
alias Func = Array(Type) -> Type
|
2015-05-04 06:12:24 +03:00
|
|
|
end
|