-
Notifications
You must be signed in to change notification settings - Fork 1
/
utilities.dylan
42 lines (38 loc) · 1018 Bytes
/
utilities.dylan
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
module: libgit2
define macro git-options-definer
{ define git-options ?type:name ?flags:* end }
=> { define git-options-aux ?type (?flags) (?flags) end }
end macro git-options-definer;
define macro git-options-aux-definer
{ define git-options-aux ?type:name (?keys) (?flags:*) end }
=> { define method initialize (?=opts :: ?type, #key ?keys)
?=next-method();
gen-bindings(?flags);
end }
keys:
{ }
=> { }
{ ?key; ... }
=> { ?key, ... }
key:
{ }
=> { }
{ option ?identifier:name => ?dylan-identifier:name ?default-value }
=> { ?dylan-identifier = ?default-value }
default-value:
{ }
=> { #f }
{ = ?val:expression }
=> { ?val }
end;
define macro gen-bindings
{ gen-bindings () }
=> { }
{ gen-bindings (?option; ?more:*) }
=> { ?option; gen-bindings(?more) }
option:
{ option ?getter:name => ?identifier:name ?:* }
=> { if (?identifier)
?getter ## "-setter"(?identifier, ?=opts);
end if }
end macro;