diff options
| author | Joel Martin <github@martintribe.org> | 2014-12-18 20:33:49 -0600 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2015-01-09 16:16:50 -0600 |
| commit | b8ee29b22fbaa7a01f2754b4d6dd9af52e02017c (patch) | |
| tree | f4d977ed220e9a3f665cfbf4f68770a81e4c2095 /vb/step7_quote.vb | |
| parent | aaba249304b184e12e2445ab22d66df1f39a51a5 (diff) | |
| download | mal-b8ee29b22fbaa7a01f2754b4d6dd9af52e02017c.tar.gz mal-b8ee29b22fbaa7a01f2754b4d6dd9af52e02017c.zip | |
All: add keywords.
Also, fix nth and count to match cloure.
Diffstat (limited to 'vb/step7_quote.vb')
| -rw-r--r-- | vb/step7_quote.vb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/vb/step7_quote.vb b/vb/step7_quote.vb index 3f2d614..f38741e 100644 --- a/vb/step7_quote.vb +++ b/vb/step7_quote.vb @@ -51,8 +51,7 @@ Namespace Mal Shared Function eval_ast(ast As MalVal, env As MalEnv) As MalVal If TypeOf ast Is MalSymbol Then - Dim sym As MalSymbol = DirectCast(ast, MalSymbol) - return env.do_get(sym.getName()) + return env.do_get(DirectCast(ast, MalSymbol)) Else If TypeOf ast Is MalList Then Dim old_lst As MalList = DirectCast(ast, MalList) Dim new_lst As MalList @@ -115,7 +114,7 @@ Namespace Mal Dim a1 As MalVal = ast(1) Dim a2 As MalVal = ast(2) Dim res As MalVal = EVAL(a2, env) - env.do_set(DirectCast(a1,MalSymbol).getName(), res) + env.do_set(DirectCast(a1,MalSymbol), res) return res Case "let*" Dim a1 As MalVal = ast(1) @@ -126,7 +125,7 @@ Namespace Mal For i As Integer = 0 To (DirectCast(a1,MalList)).size()-1 Step 2 key = DirectCast(DirectCast(a1,MalList)(i),MalSymbol) val = DirectCast(a1,MalList)(i+1) - let_env.do_set(key.getName(), EVAL(val, let_env)) + let_env.do_set(key, EVAL(val, let_env)) Next orig_ast = a2 env = let_env @@ -199,9 +198,9 @@ Namespace Mal ' core.vb: defined using VB.NET For Each entry As KeyValuePair(Of String,MalVal) In core.ns() - repl_env.do_set(entry.Key, entry.Value) + repl_env.do_set(new MalSymbol(entry.Key), entry.Value) Next - repl_env.do_set("eval", new MalFunc(AddressOf do_eval)) + repl_env.do_set(new MalSymbol("eval"), new MalFunc(AddressOf do_eval)) Dim fileIdx As Integer = 1 If args.Length > 1 AndAlso args(1) = "--raw" Then Mal.readline.SetMode(Mal.readline.Modes.Raw) @@ -211,7 +210,7 @@ Namespace Mal For i As Integer = fileIdx+1 To args.Length-1 argv.conj_BANG(new MalString(args(i))) Next - repl_env.do_set("*ARGV*", argv) + repl_env.do_set(new MalSymbol("*ARGV*"), argv) ' core.mal: defined using the language itself REP("(def! not (fn* (a) (if a false true)))") |
