2014-04-07 09:17:13 +04:00
|
|
|
using System;
|
2014-04-17 08:57:50 +04:00
|
|
|
using System.IO;
|
2014-04-07 09:17:13 +04:00
|
|
|
using System.Collections.Generic;
|
2014-04-07 08:58:14 +04:00
|
|
|
using MalVal = Mal.types.MalVal;
|
2014-04-07 09:17:13 +04:00
|
|
|
using MalConstant = Mal.types.MalConstant;
|
2014-11-16 05:38:50 +03:00
|
|
|
using MalInt = Mal.types.MalInt;
|
2014-04-10 06:26:35 +04:00
|
|
|
using MalSymbol = Mal.types.MalSymbol;
|
2014-04-07 09:17:13 +04:00
|
|
|
using MalString = Mal.types.MalString;
|
2014-04-07 08:58:14 +04:00
|
|
|
using MalList = Mal.types.MalList;
|
2014-04-10 06:26:35 +04:00
|
|
|
using MalVector = Mal.types.MalVector;
|
|
|
|
using MalHashMap = Mal.types.MalHashMap;
|
2014-04-10 06:57:50 +04:00
|
|
|
using MalAtom = Mal.types.MalAtom;
|
2014-11-16 05:38:50 +03:00
|
|
|
using MalFunc = Mal.types.MalFunc;
|
2014-04-07 08:58:14 +04:00
|
|
|
|
|
|
|
namespace Mal {
|
|
|
|
public class core {
|
2014-04-07 09:17:13 +04:00
|
|
|
static MalConstant Nil = Mal.types.Nil;
|
|
|
|
static MalConstant True = Mal.types.True;
|
|
|
|
static MalConstant False = Mal.types.False;
|
|
|
|
|
2014-04-10 06:26:35 +04:00
|
|
|
// Errors/Exceptions
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc mal_throw = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => { throw new Mal.types.MalException(a[0]); });
|
|
|
|
|
|
|
|
// Scalar functions
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc nil_Q = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => a[0] == Nil ? True : False);
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc true_Q = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => a[0] == True ? True : False);
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc false_Q = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => a[0] == False ? True : False);
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc symbol_Q = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => a[0] is MalSymbol ? True : False);
|
|
|
|
|
2016-02-12 19:37:03 +03:00
|
|
|
static MalFunc string_Q = new MalFunc(
|
|
|
|
a => {
|
|
|
|
if (a[0] is MalString) {
|
|
|
|
var s = ((MalString)a[0]).getValue();
|
|
|
|
return (s.Length == 0 || s[0] != '\u029e') ? True : False;
|
|
|
|
} else {
|
|
|
|
return False;
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2014-12-19 05:33:49 +03:00
|
|
|
static MalFunc keyword = new MalFunc(
|
2015-03-15 01:14:32 +03:00
|
|
|
a => {
|
|
|
|
if (a[0] is MalString &&
|
|
|
|
((MalString)a[0]).getValue()[0] == '\u029e') {
|
|
|
|
return a[0];
|
|
|
|
} else {
|
|
|
|
return new MalString("\u029e" + ((MalString)a[0]).getValue());
|
|
|
|
}
|
|
|
|
} );
|
2014-12-19 05:33:49 +03:00
|
|
|
|
|
|
|
static MalFunc keyword_Q = new MalFunc(
|
|
|
|
a => {
|
2016-02-12 19:37:03 +03:00
|
|
|
if (a[0] is MalString) {
|
|
|
|
var s = ((MalString)a[0]).getValue();
|
|
|
|
return (s.Length > 0 && s[0] == '\u029e') ? True : False;
|
2014-12-19 05:33:49 +03:00
|
|
|
} else {
|
|
|
|
return False;
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2014-04-10 06:26:35 +04:00
|
|
|
|
2014-04-18 06:49:07 +04:00
|
|
|
// Number functions
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc time_ms = new MalFunc(
|
2014-11-16 08:51:59 +03:00
|
|
|
a => new MalInt(DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond));
|
2014-04-18 06:49:07 +04:00
|
|
|
|
2014-04-07 09:17:13 +04:00
|
|
|
// String functions
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc pr_str = new MalFunc(
|
2014-04-07 09:17:13 +04:00
|
|
|
a => new MalString(printer._pr_str_args(a, " ", true)) );
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc str = new MalFunc(
|
2014-04-07 09:17:13 +04:00
|
|
|
a => new MalString(printer._pr_str_args(a, "", false)) );
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc prn = new MalFunc(
|
2014-04-07 09:17:13 +04:00
|
|
|
a => {
|
|
|
|
Console.WriteLine(printer._pr_str_args(a, " ", true));
|
|
|
|
return Nil;
|
|
|
|
} );
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc println = new MalFunc(
|
2014-04-07 09:17:13 +04:00
|
|
|
a => {
|
|
|
|
Console.WriteLine(printer._pr_str_args(a, " ", false));
|
|
|
|
return Nil;
|
|
|
|
} );
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc mal_readline = new MalFunc(
|
2014-04-17 08:57:50 +04:00
|
|
|
a => {
|
|
|
|
var line = readline.Readline(((MalString)a[0]).getValue());
|
|
|
|
if (line == null) { return types.Nil; }
|
|
|
|
else { return new MalString(line); }
|
|
|
|
} );
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc read_string = new MalFunc(
|
2014-04-17 08:57:50 +04:00
|
|
|
a => reader.read_str(((MalString)a[0]).getValue()));
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc slurp = new MalFunc(
|
2014-04-17 08:57:50 +04:00
|
|
|
a => new MalString(File.ReadAllText(
|
|
|
|
((MalString)a[0]).getValue())));
|
|
|
|
|
|
|
|
|
2014-04-10 06:26:35 +04:00
|
|
|
// List/Vector functions
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc list_Q = new MalFunc(
|
2014-04-07 09:17:13 +04:00
|
|
|
a => a[0].GetType() == typeof(MalList) ? True : False);
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc vector_Q = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => a[0].GetType() == typeof(MalVector) ? True : False);
|
|
|
|
|
|
|
|
// HashMap functions
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc hash_map_Q = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => a[0].GetType() == typeof(MalHashMap) ? True : False);
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc contains_Q = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => {
|
|
|
|
string key = ((MalString)a[1]).getValue();
|
|
|
|
var dict = ((MalHashMap)a[0]).getValue();
|
|
|
|
return dict.ContainsKey(key) ? True : False;
|
|
|
|
});
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc assoc = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => {
|
|
|
|
var new_hm = ((MalHashMap)a[0]).copy();
|
|
|
|
return new_hm.assoc_BANG((MalList)a.slice(1));
|
|
|
|
});
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc dissoc = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => {
|
|
|
|
var new_hm = ((MalHashMap)a[0]).copy();
|
|
|
|
return new_hm.dissoc_BANG((MalList)a.slice(1));
|
|
|
|
});
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc get = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => {
|
|
|
|
string key = ((MalString)a[1]).getValue();
|
2014-04-15 10:24:43 +04:00
|
|
|
if (a[0] == Nil) {
|
|
|
|
return Nil;
|
|
|
|
} else {
|
|
|
|
var dict = ((MalHashMap)a[0]).getValue();
|
|
|
|
return dict.ContainsKey(key) ? dict[key] : Nil;
|
|
|
|
}
|
2014-04-10 06:26:35 +04:00
|
|
|
});
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc keys = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => {
|
|
|
|
var dict = ((MalHashMap)a[0]).getValue();
|
|
|
|
MalList key_lst = new MalList();
|
|
|
|
foreach (var key in dict.Keys) {
|
|
|
|
key_lst.conj_BANG(new MalString(key));
|
|
|
|
}
|
|
|
|
return key_lst;
|
|
|
|
});
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc vals = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => {
|
|
|
|
var dict = ((MalHashMap)a[0]).getValue();
|
|
|
|
MalList val_lst = new MalList();
|
|
|
|
foreach (var val in dict.Values) {
|
|
|
|
val_lst.conj_BANG(val);
|
|
|
|
}
|
|
|
|
return val_lst;
|
|
|
|
});
|
|
|
|
|
|
|
|
// Sequence functions
|
2014-11-16 05:38:50 +03:00
|
|
|
static public MalFunc sequential_Q = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => a[0] is MalList ? True : False);
|
2014-04-08 07:53:53 +04:00
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc cons = new MalFunc(
|
2014-04-08 07:40:30 +04:00
|
|
|
a => {
|
|
|
|
var lst = new List<MalVal>();
|
|
|
|
lst.Add(a[0]);
|
|
|
|
lst.AddRange(((MalList)a[1]).getValue());
|
|
|
|
return (MalVal)new MalList(lst);
|
|
|
|
});
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc concat = new MalFunc(
|
2014-04-08 07:40:30 +04:00
|
|
|
a => {
|
|
|
|
if (a.size() == 0) { return new MalList(); }
|
|
|
|
var lst = new List<MalVal>();
|
|
|
|
lst.AddRange(((MalList)a[0]).getValue());
|
|
|
|
for(int i=1; i<a.size(); i++) {
|
|
|
|
lst.AddRange(((MalList)a[i]).getValue());
|
|
|
|
}
|
|
|
|
return (MalVal)new MalList(lst);
|
|
|
|
});
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc nth = new MalFunc(
|
2014-12-19 05:33:49 +03:00
|
|
|
a => {
|
|
|
|
var idx = (int)((MalInt)a[1]).getValue();
|
|
|
|
if (idx < ((MalList)a[0]).size()) {
|
|
|
|
return ((MalList)a[0])[idx];
|
|
|
|
} else {
|
|
|
|
throw new Mal.types.MalException(
|
|
|
|
"nth: index out of range");
|
|
|
|
}
|
|
|
|
});
|
2014-04-10 06:26:35 +04:00
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc first = new MalFunc(
|
2016-02-03 19:14:38 +03:00
|
|
|
a => a[0] == Nil ? Nil : ((MalList)a[0])[0]);
|
2014-04-10 06:26:35 +04:00
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc rest = new MalFunc(
|
2016-02-03 19:14:38 +03:00
|
|
|
a => a[0] == Nil ? new MalList() : ((MalList)a[0]).rest());
|
2014-04-10 06:26:35 +04:00
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc empty_Q = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => ((MalList)a[0]).size() == 0 ? True : False);
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc count = new MalFunc(
|
2014-12-19 05:33:49 +03:00
|
|
|
a => {
|
|
|
|
return (a[0] == Nil)
|
|
|
|
? new MalInt(0)
|
|
|
|
:new MalInt(((MalList)a[0]).size());
|
|
|
|
});
|
2014-04-10 06:26:35 +04:00
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc conj = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => {
|
|
|
|
var src_lst = ((MalList)a[0]).getValue();
|
|
|
|
var new_lst = new List<MalVal>();
|
|
|
|
new_lst.AddRange(src_lst);
|
|
|
|
if (a[0] is MalVector) {
|
|
|
|
for(int i=1; i<a.size(); i++) {
|
|
|
|
new_lst.Add(a[i]);
|
|
|
|
}
|
|
|
|
return new MalVector(new_lst);
|
|
|
|
} else {
|
|
|
|
for(int i=1; i<a.size(); i++) {
|
|
|
|
new_lst.Insert(0, a[i]);
|
|
|
|
}
|
|
|
|
return new MalList(new_lst);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2016-02-12 19:37:03 +03:00
|
|
|
static MalFunc seq = new MalFunc(
|
|
|
|
a => {
|
|
|
|
if (a[0] == Nil) {
|
|
|
|
return Nil;
|
|
|
|
} else if (a[0] is MalVector) {
|
|
|
|
return (((MalVector)a[0]).size() == 0)
|
|
|
|
? (MalVal)Nil
|
|
|
|
: new MalList(((MalVector)a[0]).getValue());
|
|
|
|
} else if (a[0] is MalList) {
|
|
|
|
return (((MalList)a[0]).size() == 0)
|
|
|
|
? Nil
|
|
|
|
: a[0];
|
|
|
|
} else if (a[0] is MalString) {
|
|
|
|
var s = ((MalString)a[0]).getValue();
|
|
|
|
if (s.Length == 0) {
|
|
|
|
return Nil;
|
|
|
|
}
|
|
|
|
var chars_list = new List<MalVal>();
|
|
|
|
foreach (var c in s) {
|
|
|
|
chars_list.Add(new MalString(c.ToString()));
|
|
|
|
}
|
|
|
|
return new MalList(chars_list);
|
|
|
|
}
|
|
|
|
return Nil;
|
|
|
|
});
|
|
|
|
|
2014-04-10 06:26:35 +04:00
|
|
|
// General list related functions
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc apply = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => {
|
2014-11-16 05:38:50 +03:00
|
|
|
var f = (MalFunc)a[0];
|
2014-04-10 06:26:35 +04:00
|
|
|
var lst = new List<MalVal>();
|
|
|
|
lst.AddRange(a.slice(1,a.size()-1).getValue());
|
|
|
|
lst.AddRange(((MalList)a[a.size()-1]).getValue());
|
|
|
|
return f.apply(new MalList(lst));
|
|
|
|
});
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc map = new MalFunc(
|
2014-04-10 06:26:35 +04:00
|
|
|
a => {
|
2014-11-16 05:38:50 +03:00
|
|
|
MalFunc f = (MalFunc) a[0];
|
2014-04-10 06:26:35 +04:00
|
|
|
var src_lst = ((MalList)a[1]).getValue();
|
|
|
|
var new_lst = new List<MalVal>();
|
|
|
|
for(int i=0; i<src_lst.Count; i++) {
|
|
|
|
new_lst.Add(f.apply(new MalList(src_lst[i])));
|
|
|
|
}
|
|
|
|
return new MalList(new_lst);
|
|
|
|
});
|
|
|
|
|
2014-04-08 07:40:30 +04:00
|
|
|
|
2014-04-10 06:57:50 +04:00
|
|
|
// Metadata functions
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc meta = new MalFunc(
|
2014-04-10 06:57:50 +04:00
|
|
|
a => a[0].getMeta());
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc with_meta = new MalFunc(
|
2014-04-10 06:57:50 +04:00
|
|
|
a => ((MalVal)a[0]).copy().setMeta(a[1]));
|
|
|
|
|
|
|
|
|
|
|
|
// Atom functions
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc atom_Q = new MalFunc(
|
2014-04-10 06:57:50 +04:00
|
|
|
a => a[0] is MalAtom ? True : False);
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc deref = new MalFunc(
|
2014-04-10 06:57:50 +04:00
|
|
|
a => ((MalAtom)a[0]).getValue());
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc reset_BANG = new MalFunc(
|
2014-04-10 06:57:50 +04:00
|
|
|
a => ((MalAtom)a[0]).setValue(a[1]));
|
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
static MalFunc swap_BANG = new MalFunc(
|
2014-04-10 06:57:50 +04:00
|
|
|
a => {
|
|
|
|
MalAtom atm = (MalAtom)a[0];
|
2014-11-16 05:38:50 +03:00
|
|
|
MalFunc f = (MalFunc)a[1];
|
2014-04-10 06:57:50 +04:00
|
|
|
var new_lst = new List<MalVal>();
|
|
|
|
new_lst.Add(atm.getValue());
|
|
|
|
new_lst.AddRange(((MalList)a.slice(2)).getValue());
|
|
|
|
return atm.setValue(f.apply(new MalList(new_lst)));
|
|
|
|
});
|
|
|
|
|
2014-04-07 09:17:13 +04:00
|
|
|
|
|
|
|
|
|
|
|
static public Dictionary<string, MalVal> ns =
|
|
|
|
new Dictionary<string, MalVal> {
|
2014-11-16 05:38:50 +03:00
|
|
|
{"=", new MalFunc(
|
2014-04-07 09:17:13 +04:00
|
|
|
a => Mal.types._equal_Q(a[0], a[1]) ? True : False)},
|
2014-04-10 06:26:35 +04:00
|
|
|
{"throw", mal_throw},
|
|
|
|
{"nil?", nil_Q},
|
|
|
|
{"true?", true_Q},
|
|
|
|
{"false?", false_Q},
|
2014-11-16 05:38:50 +03:00
|
|
|
{"symbol", new MalFunc(a => new MalSymbol((MalString)a[0]))},
|
2014-04-10 06:26:35 +04:00
|
|
|
{"symbol?", symbol_Q},
|
2016-02-12 19:37:03 +03:00
|
|
|
{"string?", string_Q},
|
2014-12-19 05:33:49 +03:00
|
|
|
{"keyword", keyword},
|
|
|
|
{"keyword?", keyword_Q},
|
2014-04-17 08:57:50 +04:00
|
|
|
|
2014-04-07 09:17:13 +04:00
|
|
|
{"pr-str", pr_str},
|
|
|
|
{"str", str},
|
|
|
|
{"prn", prn},
|
|
|
|
{"println", println},
|
2014-04-17 08:57:50 +04:00
|
|
|
{"readline", mal_readline},
|
|
|
|
{"read-string", read_string},
|
|
|
|
{"slurp", slurp},
|
2014-11-16 05:38:50 +03:00
|
|
|
{"<", new MalFunc(a => (MalInt)a[0] < (MalInt)a[1])},
|
|
|
|
{"<=", new MalFunc(a => (MalInt)a[0] <= (MalInt)a[1])},
|
|
|
|
{">", new MalFunc(a => (MalInt)a[0] > (MalInt)a[1])},
|
|
|
|
{">=", new MalFunc(a => (MalInt)a[0] >= (MalInt)a[1])},
|
|
|
|
{"+", new MalFunc(a => (MalInt)a[0] + (MalInt)a[1])},
|
|
|
|
{"-", new MalFunc(a => (MalInt)a[0] - (MalInt)a[1])},
|
|
|
|
{"*", new MalFunc(a => (MalInt)a[0] * (MalInt)a[1])},
|
|
|
|
{"/", new MalFunc(a => (MalInt)a[0] / (MalInt)a[1])},
|
2014-04-18 06:49:07 +04:00
|
|
|
{"time-ms", time_ms},
|
2014-04-07 09:17:13 +04:00
|
|
|
|
2014-11-16 05:38:50 +03:00
|
|
|
{"list", new MalFunc(a => new MalList(a.getValue()))},
|
2014-04-07 09:17:13 +04:00
|
|
|
{"list?", list_Q},
|
2014-11-16 05:38:50 +03:00
|
|
|
{"vector", new MalFunc(a => new MalVector(a.getValue()))},
|
2014-04-10 06:26:35 +04:00
|
|
|
{"vector?", vector_Q},
|
2014-11-16 05:38:50 +03:00
|
|
|
{"hash-map", new MalFunc(a => new MalHashMap(a))},
|
2014-04-10 06:26:35 +04:00
|
|
|
{"map?", hash_map_Q},
|
|
|
|
{"contains?", contains_Q},
|
|
|
|
{"assoc", assoc},
|
|
|
|
{"dissoc", dissoc},
|
|
|
|
{"get", get},
|
|
|
|
{"keys", keys},
|
|
|
|
{"vals", vals},
|
2014-04-08 07:40:30 +04:00
|
|
|
|
2014-04-10 06:26:35 +04:00
|
|
|
{"sequential?", sequential_Q},
|
2014-04-08 07:40:30 +04:00
|
|
|
{"cons", cons},
|
|
|
|
{"concat", concat},
|
2014-04-08 07:53:53 +04:00
|
|
|
{"nth", nth},
|
2014-04-10 06:26:35 +04:00
|
|
|
{"first", first},
|
|
|
|
{"rest", rest},
|
|
|
|
{"empty?", empty_Q},
|
|
|
|
{"count", count},
|
|
|
|
{"conj", conj},
|
2016-02-12 19:37:03 +03:00
|
|
|
{"seq", seq},
|
2014-04-10 06:26:35 +04:00
|
|
|
{"apply", apply},
|
|
|
|
{"map", map},
|
2014-04-10 06:57:50 +04:00
|
|
|
|
|
|
|
{"with-meta", with_meta},
|
|
|
|
{"meta", meta},
|
2014-11-16 05:38:50 +03:00
|
|
|
{"atom", new MalFunc(a => new MalAtom(a[0]))},
|
2014-04-10 06:57:50 +04:00
|
|
|
{"atom?", atom_Q},
|
|
|
|
{"deref", deref},
|
|
|
|
{"reset!", reset_BANG},
|
|
|
|
{"swap!", swap_BANG},
|
2014-04-07 09:17:13 +04:00
|
|
|
};
|
2014-04-07 08:58:14 +04:00
|
|
|
}
|
|
|
|
}
|