File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
- 8.2.1
1
+ 8.3.0
Original file line number Diff line number Diff line change 5
5
(:use :cl )
6
6
(:export
7
7
# :parse-docstring-body
8
- # :parse-simple-body))
8
+ # :parse-simple-body
9
+ # :with-names))
9
10
10
11
(in-package :org.tfeb.hax.utilities )
11
12
@@ -36,3 +37,17 @@ a list of forms."
36
37
(multiple-value-bind (decls forms)
37
38
(parse-simple-body doc/decls/forms)
38
39
(values nil decls forms))))
40
+
41
+ (defmacro with-names ((&rest clauses) &body forms)
42
+ " Bind a bunch of variables to fresh symbols with the same name
43
+
44
+ Optionally you can specify the name by giving a clause as (var <string-designator>)."
45
+ ` (let , (mapcar (lambda (clause)
46
+ (etypecase clause
47
+ (symbol
48
+ ` (, clause (make-symbol , (string clause))))
49
+ (cons
50
+ (destructuring-bind (name sd) clause
51
+ ` (, name (make-symbol (string , sd)))))))
52
+ clauses)
53
+ ,@ forms))
You can’t perform that action at this time.
0 commit comments