1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-21 10:37:58 +03:00
mal/crystal/types.cr

34 lines
514 B
Crystal
Raw Normal View History

2015-05-04 06:12:24 +03:00
module Mal
class Symbol
property :str
def initialize(@str)
2015-05-04 06:12:24 +03:00
end
end
class List < Array(Type)
end
class Vector < Array(Type)
end
class HashMap < Hash(String, Type)
end
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
def unwrap
@val
end
end
alias Func = Array(Type) -> Type
2015-05-04 06:12:24 +03:00
end