-
Notifications
You must be signed in to change notification settings - Fork 0
/
definitions.lisp
143 lines (107 loc) · 4.51 KB
/
definitions.lisp
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
(in-package #:first-class-lambda-lists)
;;; Lambda list keyword classes
(define (fcll:lambda-list-keyword-class &whole))
(define (fcll:lambda-list-keyword-class &environment))
(define (fcll:lambda-list-keyword-class :required))
(define (fcll:lambda-list-keyword-class &optional))
(define (fcll:lambda-list-keyword-class &rest))
(define (fcll:lambda-list-keyword-class &key))
(define (fcll:lambda-list-keyword-class :subordinate))
(define (fcll:lambda-list-keyword-class &aux))
;;; Lambda list keywords
(define (fcll:lambda-list-keyword &whole) 1
:section-class (find-class 'standard-&whole-section))
(define (fcll:lambda-list-keyword :&environment-not-before-&whole) 1
:introducer '&environment
:section-class (find-class 'standard-&environment-section))
(define (fcll:lambda-list-keyword :&environment-last) 1
:introducer '&environment
:section-class (find-class 'standard-&environment-section))
(define (fcll:lambda-list-keyword :required) t
:introducer nil
:section-class (find-class 'standard-required-section)
:parameter-parser #'%parse-required-parameter
:recursablep t)
(define (fcll:lambda-list-keyword :required-specializable) t
:parent :required
:parameter-parser #'%parse-specializable-parameter)
(define (fcll:lambda-list-keyword &optional) t
:section-class (find-class 'standard-&optional-section)
:parameter-parser #'%parse-optional-parameter
:recursablep t)
(define (fcll:lambda-list-keyword :&optional-no-defaulting) t
:parent '&optional
:parameter-parser #'%parse-optional-no-defaulting-parameter)
(define (fcll:lambda-list-keyword &rest) 1
:section-class (find-class 'standard-&rest-section)
:recursablep t)
(define (fcll:lambda-list-keyword &body) 1
:section-class (find-class 'standard-&rest-section)
:recursablep t)
(define (fcll:lambda-list-keyword &key) t
:section-class (find-class 'standard-&key-section)
:parameter-parser #'%parse-key-parameter
:recursablep t
:parser-maker '%make-&key-parser)
(define (fcll:lambda-list-keyword :&key-no-defaulting) t
:parent '&key
:parser-maker '%make-lambda-list-keyword-parser
:parameter-parser #'%parse-key-no-defaulting-parameter)
(define (fcll:lambda-list-keyword &allow-other-keys) 0
:section-class (find-class 'subordinate-section))
(define (fcll:lambda-list-keyword &aux) t
:section-class (find-class 'standard-&aux-section)
:parameter-parser #'%parse-aux-parameter)
;;; Lambda list keyword order
(define (fcll:lambda-list-keyword-order :standard)
(list &whole
(or (list (or :required :required-specializable)
(or &optional :&optional-no-defaulting)
(or &rest &body)
(or &key :&key-no-defaulting)
&aux
:&environment-last)
:&environment-not-before-&whole)))
;;; Lambda list keyword conflicts
(define (fcll:lambda-list-keyword-conflicts :standard)
(and &rest &body))
;;; Lambda list kinds
(define (fcll:lambda-list-kind :ordinary)
defun
((make-instance 'standard-raw-lambda-list-core
:keywords-set (make-instance 'fcll:derived-lambda-list-keywords-set
;; &allow-other-keys is subordinate to &key, so implied by it.
:add '(:required &optional &rest &key &aux))
:keyword-order (defsys:locate 'fcll:lambda-list-keyword-order :standard)
:keyword-conflicts (defsys:locate 'fcll:lambda-list-keyword-conflicts :standard))))
(define (fcll:lambda-list-kind :generic-function)
defgeneric
((:derive :replace ((&optional :&optional-no-defaulting)
(&key :&key-no-defaulting))
:remove &aux)))
(define (fcll:lambda-list-kind :specialized)
defmethod
((:derive :replace ((:required :required-specializable)))))
(define (fcll:lambda-list-kind :destructuring)
destructuring-bind
((:derive :add (&whole &body))
:recurse :destructuring))
(define (fcll:lambda-list-kind :macro)
defmacro
((:derive :from :destructuring :add :&environment-not-before-&whole)))
(define (fcll:lambda-list-kind :boa)
defstruct
((:derive)))
(define (fcll:lambda-list-kind :defsetf)
defsetf
((:derive :add :&environment-last :remove &aux)))
(define (fcll:lambda-list-kind :deftype)
deftype
((:derive :from :macro)
:default-initform ''*))
(define (fcll:lambda-list-kind :define-modify-macro)
define-modify-macro
((:derive :remove (&key &aux))))
(define (fcll:lambda-list-kind :define-method-combination-arguments)
define-method-combination
((:derive :add &whole)))