-
Notifications
You must be signed in to change notification settings - Fork 19
/
snippets.json
107 lines (107 loc) · 2.63 KB
/
snippets.json
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
{
"Format String": {
"prefix": "format",
"body": [
"format ${1:T} \"$2\" $0"
]
},
"Comment": {
"prefix": "comment",
"body": [
"#|",
" $0",
"|#"
]
},
"Let Expression": {
"prefix": "let",
"body": [
"let (($1))",
" $0"
]
},
"Let-Star Expression": {
"prefix": "let*",
"body": [
"let* (($1))",
" $0"
]
},
"Define Class": {
"prefix": "defclass",
"body": [
"defclass ${1:name} (${2:#| base classes |#})",
" (${3:#| slots |#})",
" (${4:#| options |#})"
]
},
"Slot": {
"prefix": "slot",
"body": [
"${1:name}",
" :accessor $1",
" :initform ${2:nil}",
" :initarg :$1"
]
},
"Define Condition": {
"prefix": "define-condition",
"body": [
"define-condition ${1:name} (${2:error})",
" (${3:#| slots |#})",
" (:report (lambda (condition stream) (format stream \"~A\" (${4:slot} condition))))"
]
},
"Define Struct": {
"prefix": "struct",
"body": [
"defstruct ${1:name}",
" ${3:#| slots |#}"
]
},
"Define Struct With Print": {
"prefix": "struct-with-print",
"body": [
"defstruct (${1:name} (:print-function (lambda (struct stream depth)",
" (if (and *print-level* (<= *print-level* depth))",
" (format stream \"#\")",
" (format stream \"$2\" $3)))))",
" ${4:#| slots |#}"
]
},
"Define Function": {
"prefix": "defun",
"body": [
"defun ${1:name} ($2)",
" $0"
]
},
"Define Method": {
"prefix": "defmethod",
"body": [
"defmethod ${1:name} ($2)",
" $0"
]
},
"Define Package": {
"prefix": "package",
"body": [
"(defpackage :${1:name}",
" (:use :cl$2))",
"",
"(in-package :$1)",
"",
"$0"
]
},
"Define System": {
"prefix": "defsystem",
"body": [
"defsystem \"${1:name}\"",
" :description \"$2\"",
" :serial t",
" :components ((:file \"package\")",
" ($0))"
]
}
}