|
WishLisp is a Lisp interpreter for Windows and licensed under Open Source Licence (MIT),
you can Download runtime or Download source code. This is a prototype implemented in C# (Microsoft .Net framework). I started this project by figuring how to run the lisp expressions / functions provided in the following books (I bought them in my favorite IT Bookstore in Paris Le Monde En Tique):
Feel free to send feedback to me: kernmichel(at)yahoo.fr
Features
- "Mini IDE" ("Windowed Shell":
wlWin.exe): allows creation / edition of lisp project files (.lisp)
- 2 Shells: Console (
wl.exe) and "Windowed Shell" (wlWin.exe, Console within a WinForm Window)
- Implemented as a DLL (
WishLisp.dll) which allows easy integration in/with Microsoft .Net components:
- Common Lisp implemented functions
- Unit Test function (
test) which performs tests described in UnitTest.txt
More...
- In my "previous life" I also wrote a Freeware MindMapping tool Thinkgraph
- Give a look at my Flick Photo Blog which gathers pictures taken in the streets
17th September 2008: version 0.0.1.3.6
- Release of Source Code under Open Source Licence (MIT)
- Enhancements of the Windowed Shell (
wlWin.exe): Project/Save (!!)
- Added functions
(eql) and (progn)
- Fix on recursivity of functions
- Fix on Symbols: now registered in a dictionnary so that
(eql 'a 'a) return True
- Fix on functions
(format), (cdr)), (not) and (null)
- Minor Enhancement:
(load) function now returns an error message if file not found
2nd August 2008: version 0.0.1.3.5
- Enhancements of the Windowed Shell (
wlWin.exe)
Project/Open...: Opens a lisp project (.lisp file) in a new Editor Tab
and loads it in WishLisp
It is possible to open multiple projects.
In Windowed Shell (ed) function mimics Project / Open
Project/Load current project: to load / reload the current project in WishLisp
Help/About with a link to www.wishlisp.com
1st August 2008: version 0.0.1.3.4
- Minor enhancement:
(help) function displays aligned items
- Enhancement of the
(load) function: now the function definitions
may span several text lines and it is possible to use define multiple functions
(until now only one defun was supported...)
- Enhancements of Windowed Shell (
wlWin.exe)
- Trace subwindow which displays output from
(trace) function. This
is a "proof of concept" which illustrates how the output stream
pointed by a system variable (*trace-output*) may be redirected
to another output stream
- View menu which allows to Show/Hide Shell and Trace views
- File/Open... allows to load lisp source code from a .lisp file
- Update of Sample0 source code here in this Homepage
- Update of Sample1 source code here in this Homepage
28th July 2008: version 0.0.1.3.2
- Added sample How to integrate WishLisp in a .Net application
- Recursivity supported (see fibonacci test in
UnitTest.txt)
- Added Common Lisp operator:
<
- Added Common Lisp functions:
sleep, trace, untrace, fourth, fifth, symbol-function, fboundp
21th July 2008: version 0.0.1.2
- Project name changed from QuantumLisp to WishLisp to avoid ambiguity with project really coonexted to Quantum Computing project (QL for Quantum Lisp...)
- Interpreter is released as a DLL to provide soon easy integration in C# applications
- First release of a Windows GUI for the interpreter (wlWin.exe)
- First example of how to define a custom function which calls native code, provided sample is the function
msgbox which displays a WinForms MessageBox
- Added common lisp functions:
pop, reverse, defmacro
- Added utility function
system which allows to launch an application (ex: (system "iexplore" "http://www.google.com"))
20th July 2008: version 0.0.1.1
- Fix on
defun
- Added common lisp functions:
functionp, integerp, eval
- Added utility function
implemented which provides the list of implemented functions
18th July 2008: version 0.0.1
Here is the first public version of a Lisp interpreter implementation for Windows, you can download it here QuantumLisp. The interpreter comes with a unit test file (UnitTest.txt) which allows to test the lisp commands that are currently implemented, you can start the unit test by typing (test) whithin the interpreter.
List of Common Lisp implemented functions (most are not fully implemented)
Exit: bye, exit, quit,
Operators: +, -, *, /,
Evaluation: quote, ', eval,
List: list, car, cdr, cons, push, first, second, third, fourth, fifth, getf, pop, reverse
Logic: null, not, if, and , or, >, <,
List: listp, integerp, functionp, fboundp,
Definitions: defun, defvar, defmacro, load, ed, trace, untrace, symbol-function,
IO, Time, ..: read, format, sleep
Sample 0: How to define a custom function which calls native code
First create a C# Console application project and add a reference to WishLisp.dll
Second create the MsgBoxF Function class
using System;
using System.Windows.Forms;
using WishLisp;
namespace Sample0_Extending_WL
{
public class MsgBoxF: FunctionA
{
public MsgBoxF(): base("MSGBOX", Atom.NIL, Atom.NIL)
{
_f = inner_eval;
}
public Atom inner_eval(Atom arg, Atom context)
{
Atom arg1 = Evaluator.eval(arg.child, context);
string message = StringA.GetDisplayString(arg1);
string title = "";
if (arg.Count > 1)
{
Atom arg2 = Evaluator.eval(arg.next.child, context);
title = StringA.GetDisplayString(arg2);
}
MessageBox.Show(message, title);
return Atom.NIL;
} // msgbox
}
} |
Third put the following code in the main (eg: Program.cs) of the Console application project
using System;
using WishLisp;
namespace Sample0_Extending_WL
{
class main
{
static void Main(string[] args)
{
WL.Environment.init();
WL.Out.PrintLn("\nWishLisp Sample0: Extending WishLisp with custom functions");
WL.Out.PrintLn("----------------------------------------------------------");
WL.Out.PrintLn("To try this sample, just type (msgbox \"Hello\") in the interpreter");
FunctionA.Register(new MsgBoxF());
WL.Shell.read_eval_print_loop(WL.ShellType.Console, "");
}
}
} |
Sample 1: How to integrate WishLisp in a .Net application
First create a C# Console application project and add a reference to WishLisp.dll
Second put the following code in the main (eg: Program.cs) of the Console application project
using System;
using WishLisp;
namespace Sample1_WL_Inside
{
class main
{
static void Main(string[] args)
{
WL.Environment.init();
WL.Out.PrintLn("\nWishLisp Sample1: WishLisp Inside .Net Application");
WL.Out.PrintLn("--------------------------------------------------");
string lisp_expression = "(reverse '(W I S H L I S P))";
WL.Out.PrintLn(">>> Lisp Expression: " + lisp_expression);
Atom output = WL.Reader.Evaluate(lisp_expression, Atom.NIL);
WL.Out.PrintLn("\n>>> WishLisp Output: " + output.asString());
}
}
} |
|