Embedding L Sharp in VB.NET

0 views
Skip to first unread message

Stever1975

unread,
Mar 20, 2007, 9:49:39 PM3/20/07
to LSharp
Dim result As Object
Dim strScript As String

txtinput.Text = strScript
result = LSharp.Runtime.EvalString(strScript)
txtDebug.Text = result.ToString

Having difficulty with evalstring:

when given: (+ 3 4)
returns 7
And it seem to work correctly with other simple arithmetic.

when given: (car '(a b c))
returns a
Which is good.

But when I give it: (cdr '(a b c))
returns : LSharp.Cons
when what I want is (b c)
so I think its just returning the type... I'm not sure... But I'm
wondering how I can convert it to a string so it will read (b c)?

Thanks in advance
Steve

rayc...@gmail.com

unread,
Mar 20, 2007, 10:44:33 PM3/20/07
to LSharp

Which version of LSharp are you using? In the latest version
currently on SourceForge (which might not be available as a binary
download), Cons.ToString() produced the printed representation of the
list, "(b c)" in your example. I'm not sure what earlier versions
(1.21?) did.

You could try:

txtDebug.Text = LSharp.Printer.WriteToString(result)

which is what Cons.ToString() does in the most current version.

You might want to grab the latest sources from SVN and compile them
yourself, to ensure you have the latest bits.

Reply all
Reply to author
Forward
0 new messages