From 95f6c3bdbbfcb8dc65ef4289ac219ce1f2291d0b Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Thu, 12 Sep 2019 14:08:26 +0100 Subject: [PATCH] Added skeleton Common Lisp package. --- .gitignore | 2 ++ README.md | 2 ++ README.org | 5 ++++ ledit-test.asd | 17 ++++++++++++ ledit.asd | 25 ++++++++++++++++++ resources/test-fragments/defun-fact.html | 33 ++++++++++++++++++++++++ resources/test-fragments/defun-fact.lisp | 5 ++++ src/lisp/ledit.lisp | 7 +++++ test/lisp/ledit.lisp | 13 ++++++++++ tests/ledit.lisp | 1 + 10 files changed, 110 insertions(+) create mode 100644 .gitignore create mode 100644 README.org create mode 100644 ledit-test.asd create mode 100644 ledit.asd create mode 100644 resources/test-fragments/defun-fact.html create mode 100644 resources/test-fragments/defun-fact.lisp create mode 100644 test/lisp/ledit.lisp create mode 120000 tests/ledit.lisp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..185f039 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +*.lisp# diff --git a/README.md b/README.md index a798431..2c61774 100644 --- a/README.md +++ b/README.md @@ -9,5 +9,7 @@ There is nothing here yet. You cannot use it. It is just a very rough plan. There is the beginnings of a Clojure implementation. This is probably just proof-of-concept rapid prototyping. Clojure makes it extremely hard to rebind symbols, so in-core editing of Clojure is going to be pretty hard to make work. It's highly likely that working LEdit will be Common Lisp only. +## Common Lisp implementation +There is the beginnings of a Common Lisp implementation. This will probably lag the Clojure implementation largely because I am personally more familiar with Clojure, but the long term aim is to get the Common Lisp implementation to a stage where it is a robust and usable tool. diff --git a/README.org b/README.org new file mode 100644 index 0000000..d682b75 --- /dev/null +++ b/README.org @@ -0,0 +1,5 @@ +* Ledit + +** Usage + +** Installation diff --git a/ledit-test.asd b/ledit-test.asd new file mode 100644 index 0000000..21e20c1 --- /dev/null +++ b/ledit-test.asd @@ -0,0 +1,17 @@ +;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- +#| + This file is a part of ledit project. +|# + +(defsystem "ledit-test" + :defsystem-depends-on ("prove-asdf") + :author "" + :license "" + :depends-on ("ledit" + "prove") + :components ((:module "tests" + :components + ((:test-file "ledit")))) + :description "Test system for ledit" + + :perform (test-op (op c) (symbol-call :prove-asdf :run-test-system c))) diff --git a/ledit.asd b/ledit.asd new file mode 100644 index 0000000..2e2bee8 --- /dev/null +++ b/ledit.asd @@ -0,0 +1,25 @@ +;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- +#| + This file is a part of ledit project. +|# + +(in-package :cl-user) + +(defpackage :ledit-asd + (:use :cl :asdf)) + +(in-package :ledit-asd) + +(defsystem "ledit" + :version "0.1.0" + :author "Simon Brooke " + :license "GNU General Public License, version 2.0 or (at your option) any later version" + :depends-on ("xmls") + :components ((:module "src/lisp" + :components + ((:file "ledit")))) + :description "A browser-based Lisp structure editor" + :long-description + #.(read-file-string + (subpathname *load-pathname* "README.md")) + :in-order-to ((test-op (test-op "ledit-test")))) diff --git a/resources/test-fragments/defun-fact.html b/resources/test-fragments/defun-fact.html new file mode 100644 index 0000000..d6c9e39 --- /dev/null +++ b/resources/test-fragments/defun-fact.html @@ -0,0 +1,33 @@ + + +
+ defun + fact +
+ n +
+
+ cond +
+
+ zerop + n +
+ 1 +
+
+ t +
+ * + n +
+ fact +
+ 1- + n +
+
+
+
+
+
diff --git a/resources/test-fragments/defun-fact.lisp b/resources/test-fragments/defun-fact.lisp new file mode 100644 index 0000000..962c36f --- /dev/null +++ b/resources/test-fragments/defun-fact.lisp @@ -0,0 +1,5 @@ +;; In theory this should exactly translate into `defun-fact.html`, q.v. + +(defun fact (n) + (cond ((zerop n) 1) + (t (* n (fact (1- n)))))) diff --git a/src/lisp/ledit.lisp b/src/lisp/ledit.lisp index e69de29..f9ebe8a 100644 --- a/src/lisp/ledit.lisp +++ b/src/lisp/ledit.lisp @@ -0,0 +1,7 @@ +;;; -*- Mode: LISP; Syntax: COMMON-LISP; Package: CL-USER; Base: 10 -*- + +(defpackage ledit + (:use :cl :xmls)) +(in-package :ledit) + +;; blah blah blah. diff --git a/test/lisp/ledit.lisp b/test/lisp/ledit.lisp new file mode 100644 index 0000000..e4416f1 --- /dev/null +++ b/test/lisp/ledit.lisp @@ -0,0 +1,13 @@ +(defpackage ledit-test + (:use :cl + :ledit + :prove)) +(in-package :ledit-test) + +;; NOTE: To run this test file, execute `(asdf:test-system :ledit)' in your Lisp. + +(plan nil) + +;; blah blah blah. + +(finalize) diff --git a/tests/ledit.lisp b/tests/ledit.lisp new file mode 120000 index 0000000..400ffce --- /dev/null +++ b/tests/ledit.lisp @@ -0,0 +1 @@ +../test/lisp/ledit.lisp \ No newline at end of file