|
@ -353,62 +353,62 @@ module Crisp |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
NameSpace = { |
|
|
NameSpace = { |
|
|
"+" => calc_op(:+) |
|
|
|
|
|
"-" => calc_op(:-) |
|
|
|
|
|
"*" => calc_op(:*) |
|
|
|
|
|
"/" => calc_op(:/) |
|
|
|
|
|
"list" => func(:list) |
|
|
|
|
|
"list?" => func(:list?) |
|
|
|
|
|
"empty?" => func(:empty?) |
|
|
|
|
|
"count" => func(:count) |
|
|
|
|
|
"=" => rel_op(:==) |
|
|
|
|
|
"<" => rel_op(:<) |
|
|
|
|
|
">" => rel_op(:>) |
|
|
|
|
|
"<=" => rel_op(:<=) |
|
|
|
|
|
">=" => rel_op(:>=) |
|
|
|
|
|
"pr-str" => func(:pr_str) |
|
|
|
|
|
"str" => func(:str) |
|
|
|
|
|
"prn" => func(:prn) |
|
|
|
|
|
"println" => func(:println) |
|
|
|
|
|
"read-string" => func(:read_string) |
|
|
|
|
|
"slurp" => func(:slurp) |
|
|
|
|
|
"cons" => func(:cons) |
|
|
|
|
|
"concat" => func(:concat) |
|
|
|
|
|
"nth" => func(:nth) |
|
|
|
|
|
"first" => func(:first) |
|
|
|
|
|
"rest" => func(:rest) |
|
|
|
|
|
"throw" => -> (args : Array(Crisp::Expr)) { raise Crisp::RuntimeException.new args[0] } |
|
|
|
|
|
"apply" => func(:apply) |
|
|
|
|
|
"map" => func(:map) |
|
|
|
|
|
"nil?" => func(:nil?) |
|
|
|
|
|
"true?" => func(:true?) |
|
|
|
|
|
"false?" => func(:false?) |
|
|
|
|
|
"symbol?" => func(:symbol?) |
|
|
|
|
|
"symbol" => func(:symbol) |
|
|
|
|
|
"keyword" => func(:keyword) |
|
|
|
|
|
"keyword?" => func(:keyword?) |
|
|
|
|
|
"vector" => func(:vector) |
|
|
|
|
|
"vector?" => func(:vector?) |
|
|
|
|
|
"hash-map" => func(:hash_map) |
|
|
|
|
|
"map?" => func(:map?) |
|
|
|
|
|
"assoc" => func(:assoc) |
|
|
|
|
|
"dissoc" => func(:dissoc) |
|
|
|
|
|
"get" => func(:get) |
|
|
|
|
|
"contains?" => func(:contains?) |
|
|
|
|
|
"keys" => func(:keys) |
|
|
|
|
|
"vals" => func(:vals) |
|
|
|
|
|
"sequential?" => func(:sequential?) |
|
|
|
|
|
"readline" => func(:readline) |
|
|
|
|
|
"meta" => func(:meta) |
|
|
|
|
|
"with-meta" => func(:with_meta) |
|
|
|
|
|
"atom" => func(:atom) |
|
|
|
|
|
"atom?" => func(:atom?) |
|
|
|
|
|
"deref" => func(:deref) |
|
|
|
|
|
"deref" => func(:deref) |
|
|
|
|
|
"reset!" => func(:reset!) |
|
|
|
|
|
"swap!" => func(:swap!) |
|
|
|
|
|
"conj" => func(:conj) |
|
|
|
|
|
"time-ms" => func(:time_ms) |
|
|
|
|
|
|
|
|
"+" => calc_op(:+), |
|
|
|
|
|
"-" => calc_op(:-), |
|
|
|
|
|
"*" => calc_op(:*), |
|
|
|
|
|
"/" => calc_op(:/), |
|
|
|
|
|
"list" => func(:list), |
|
|
|
|
|
"list?" => func(:list?), |
|
|
|
|
|
"empty?" => func(:empty?), |
|
|
|
|
|
"count" => func(:count), |
|
|
|
|
|
"=" => rel_op(:==), |
|
|
|
|
|
"<" => rel_op(:<), |
|
|
|
|
|
">" => rel_op(:>), |
|
|
|
|
|
"<=" => rel_op(:<=), |
|
|
|
|
|
">=" => rel_op(:>=), |
|
|
|
|
|
"pr-str" => func(:pr_str), |
|
|
|
|
|
"str" => func(:str), |
|
|
|
|
|
"prn" => func(:prn), |
|
|
|
|
|
"println" => func(:println), |
|
|
|
|
|
"read-string" => func(:read_string), |
|
|
|
|
|
"slurp" => func(:slurp), |
|
|
|
|
|
"cons" => func(:cons), |
|
|
|
|
|
"concat" => func(:concat), |
|
|
|
|
|
"nth" => func(:nth), |
|
|
|
|
|
"first" => func(:first), |
|
|
|
|
|
"rest" => func(:rest), |
|
|
|
|
|
"throw" => -> (args : Array(Crisp::Expr)) { raise Crisp::RuntimeException.new args[0] }, |
|
|
|
|
|
"apply" => func(:apply), |
|
|
|
|
|
"map" => func(:map), |
|
|
|
|
|
"nil?" => func(:nil?), |
|
|
|
|
|
"true?" => func(:true?), |
|
|
|
|
|
"false?" => func(:false?), |
|
|
|
|
|
"symbol?" => func(:symbol?), |
|
|
|
|
|
"symbol" => func(:symbol), |
|
|
|
|
|
"keyword" => func(:keyword), |
|
|
|
|
|
"keyword?" => func(:keyword?), |
|
|
|
|
|
"vector" => func(:vector), |
|
|
|
|
|
"vector?" => func(:vector?), |
|
|
|
|
|
"hash-map" => func(:hash_map), |
|
|
|
|
|
"map?" => func(:map?), |
|
|
|
|
|
"assoc" => func(:assoc), |
|
|
|
|
|
"dissoc" => func(:dissoc), |
|
|
|
|
|
"get" => func(:get), |
|
|
|
|
|
"contains?" => func(:contains?), |
|
|
|
|
|
"keys" => func(:keys), |
|
|
|
|
|
"vals" => func(:vals), |
|
|
|
|
|
"sequential?" => func(:sequential?), |
|
|
|
|
|
"readline" => func(:readline), |
|
|
|
|
|
"meta" => func(:meta), |
|
|
|
|
|
"with-meta" => func(:with_meta), |
|
|
|
|
|
"atom" => func(:atom), |
|
|
|
|
|
"atom?" => func(:atom?), |
|
|
|
|
|
"deref" => func(:deref), |
|
|
|
|
|
"deref" => func(:deref), |
|
|
|
|
|
"reset!" => func(:reset!), |
|
|
|
|
|
"swap!" => func(:swap!), |
|
|
|
|
|
"conj" => func(:conj), |
|
|
|
|
|
"time-ms" => func(:time_ms), |
|
|
} of String => Crisp::Func |
|
|
} of String => Crisp::Func |
|
|
|
|
|
|
|
|
end |
|
|
end |