diff options
| author | Joel Martin <github@martintribe.org> | 2014-11-15 23:15:09 -0600 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2015-01-09 16:16:47 -0600 |
| commit | ee7cd5859e56423983f025088c8cef36b7ed09dd (patch) | |
| tree | da9f2011f4feaa34c96a63407fa4e8720eb1d4dc /vb/step0_repl.vb | |
| parent | c3b508af92800f63bf99f41af68f026535f454f5 (diff) | |
| download | mal-ee7cd5859e56423983f025088c8cef36b7ed09dd.tar.gz mal-ee7cd5859e56423983f025088c8cef36b7ed09dd.zip | |
VB.Net: port of C# version.
Diffstat (limited to 'vb/step0_repl.vb')
| -rw-r--r-- | vb/step0_repl.vb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/vb/step0_repl.vb b/vb/step0_repl.vb new file mode 100644 index 0000000..ab8fe5e --- /dev/null +++ b/vb/step0_repl.vb @@ -0,0 +1,43 @@ +Imports System +Imports Mal + +Namespace Mal + class step0_repl + ' read + Shared Function READ(str As String) As String + Return str + End Function + + ' eval + Shared Function EVAL(ast As String, env As String) As String + Return ast + End Function + + ' print + Shared Function PRINT(exp As String) As String + Return exp + End Function + + ' repl + Shared Function REP(str As String, env As String) As String + Return PRINT(EVAL(READ(str), env)) + End Function + + Shared Function Main As Integer + Dim prompt As String = "user> " + Dim line As String + + Do + line = Mal.readline.Readline(prompt) + If line is Nothing Then + Exit Do + End If + If line = "" Then + Continue Do + End If + Console.WriteLine(REP(line, "")) + Loop While True + Return 0 + End function + end class +End Namespace |
