-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadable.asd
76 lines (66 loc) · 2.97 KB
/
readable.asd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
;;;; readable.asd - Common Lisp package for "readable" Lisp notations.
;;;; See http://readable.sourceforge.net for information on these notations:
;;;; - curly-infix: Add infix in {...}, so {a op b op c...} => (op a b c...),
;;;; {a b} => (a b), and {a} => a. No precedence, by intent.
;;;; In "full" curly-infix, datums inside {} are *neoteric* expressions.
;;;; - neoteric: Add suffix support, so f(...) => (f ...), f{...} => (f {...})
;;;; - sweet: Indentation implies parentheses. Solo datums with no children
;;;; represent themselves; otherwise the datums are wrapped into a list:
;;;; define fibfast(n) ; Typical function notation
;;;; if {n < 2} ; Indentation, infix {...}
;;;; n ; Single expr = no new list
;;;; fibup n 2 1 0 ; Simple function calls
;;;; ==>
;;;; (define (fibfast n)
;;;; (if (< n 2)
;;;; n
;;;; (fibup n 2 1 0)))
; For ASDF information, see:
; http://common-lisp.net/~mmommer/asdf-howto.shtml
; http://www.xach.com/lisp/asdf-tutorial/
; http://common-lisp.net/project/asdf/
(in-package #:cl-user)
(defpackage #:readable-asd
#+clisp (:modern t)
(:use :cl :asdf))
(defpackage #:readable
#+clisp (:modern t)
(:use :cl)
(:export #:enable-basic-curly #:basic-curly-read
#:enable-full-curly-infix #:enable-curly-infix #:curly-infix-read
#:enable-neoteric #:neoteric-read
#:enable-sweet #:sweet-read
#:my-char-code-limit
#:disable-readable
#:*original-readtable*
#:readable-parse-error #:*noisy*
#:$nfx$ #:$bracket-apply$
#:*print-notation* ; Write format for write-readable etc.
#:write-readable
#:prin1-readable
#:princ-readable
#:print-readable
#:pprint-readable
#:write-to-string-readable
#:prin1-to-string-readable
#:princ-to-string-readable
#:stringify-object-readable
#:output-object-readable))
(in-package #:readable-asd)
(defsystem readable
:name "readable"
:version "1.0.8" ; ONLY digits and periods allowed.
:maintainer "David A. Wheeler"
:author "David A. Wheeler"
:license "MIT"
:description "Support 'readable' extensions to Lisp s-expressions"
:long-description "Common Lisp implementation of 'readable' extensions to Lisp s-expresions - curly-infix-expressions, neoteric-expressions, and sweet-expressions, per http://readable.sourceforge.net. This can be useful if you want your Lisp code to be easier to read."
; :serial t ;; the dependencies are (no longer) linear.
:components
((:file "basic-curly")
(:file "print")
(:file "neoteric" :depends-on ("basic-curly" "print"))
(:file "backquote") ; Re-implements backquote, as needed by sweet
(:file "sweet" :depends-on ("basic-curly" "neoteric" "backquote"))
(:file "enablers" :depends-on ("basic-curly" "neoteric" "sweet"))))