[This is preliminary documentation and subject to change]
Liogo is a Logo compiler for .NET. With Liogo, you can compile your Logo script to an EXE or a DLL. Liogo comes with a single command line tool called "liogoc" (for Liogo Compiler). At First, let's see a single launch of LIOGOC:
Our first Liogo source code is just a call to the print command with all datum supported. All existing editor could be used to write Liogo source (Notepad for example). Here, we save the source code as "hello.lgo":
print [Hello World!] print 12 print "Logo |
To build this file as an EXE, we just need to launch LIOGOC like this: "liogoc
hello.lgo". The result is a "hello.EXE" file:
(Note than on Linux, you need to launch "mono hello.exe" to run your file)
Of course in Liogo as in all other Logo, you can define your own procedure. A single one is factorial. For example in the "fact.lgo" file below:
;-- Compute Factorial to fact :n if equal? :n 1 [output 1] output :n * fact :n - 1 end print fact 1 print fact 4 |
As you can see, if you mix procedure declaration and statements, Liogo first build the procedure then the statements will be launch. So, if you build the "fact.lgo" and launch "fact.exe" ("mono fact.exe" on Linux).
Alternatively, with Liogo you can build your source code as a DLL. You just have to use the "/target:dll" option. See how below:
To test our new "fact.dll", let's write a single line source code called "callfact.lgo":
print fact 3 |
As for our previous script, we can compile "callfact.lgo" as an EXE. Because we need to call an external DLL, a new option must be used "/reference:dllname":
Note that Liogo use reflection to find which Logo procedures are defined in "fact.dll", so "fact.dll" could be called "myfact.dll" or "foo.dll" as well.
LIOGO - GPL Copyright (c) 2005-2007 Lionel Laské