diff options
author | Darren Bane <darren.bane@gmail.com> | 2020-07-30 23:03:15 +0100 |
---|---|---|
committer | Darren Bane <darren.bane@gmail.com> | 2020-07-30 23:03:15 +0100 |
commit | 3a45de8cca52e72cc00b25b4eafaafb5a93f6b03 (patch) | |
tree | 52d0841ee0bd19c2dbe46871d4108379bef29465 /doc/bane.20.cdr15.md | |
parent | 79d6eb4f57011755f25444cc02b1bd6fb17b707d (diff) | |
parent | 628c87c1a75e48c34888031f2aca3695b5a704cf (diff) | |
download | lsp-3a45de8cca52e72cc00b25b4eafaafb5a93f6b03.tar.gz |
Merge branch 'master' of tilde.institute:public_repos/lsp
Diffstat (limited to 'doc/bane.20.cdr15.md')
-rw-r--r-- | doc/bane.20.cdr15.md | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/doc/bane.20.cdr15.md b/doc/bane.20.cdr15.md new file mode 100644 index 0000000..d999852 --- /dev/null +++ b/doc/bane.20.cdr15.md @@ -0,0 +1,48 @@ +title: An ISLisp-like subset of ANSI Common Lisp +author: Darren Bane +copyright: 2020 Darren Bane, CC BY-SA + +# Abstract + +A subset of Common Lisp that has rough feature parity with ISLisp is defined. + +# Introduction + +There are many Common Lisp coding standards encoding the opinion of various experts. +This document defines yet another, but relies on the opinions of the ISLisp standard committee instead. + +The ANSI Common Lisp standard explicitly allows subsets. +ISLisp was designed to be "culturally-compatible" with Common Lisp, +and indeed it is only moderate work to port between them +(and incidentally, also ELisp). + +# Procedure + +Write an ISLisp program, making the following adaptations: + +* `for` becomes `do` +* `quotient` becomes `/` +* `create` becomes `make-instance` +* `(class x)` becomes `(find-class 'x)` +* `(standard-output)` becomes `*standard-output*` + +ISLisp doesn't have the following features (and probably many more): + +* structs. Use classes instead. +* `print-object`. But you can define it yourself. + +## Extensions to ISLisp + +It was noted in the ISLisp standard document that the committee would have liked to define packages. +So I recommend the following pattern, using the subset of CL packages that OpenLisp supports: + +```lisp +(require "dependency") +(defpackage #:pack + (:use #:common-lisp #:dependency) + (:export + #:fun)) +(in-package #:pack) +... +(provide "pack") +``` |