Skip to content

Commit d5f0c48

Browse files
committed
rename sig global table to sig*
1 parent 56bda59 commit d5f0c48

5 files changed

Lines changed: 18 additions & 20 deletions

File tree

ac.scm

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -619,18 +619,17 @@
619619
(namespace-set-variable-value! nm a)
620620
a))))
621621

622-
(define fn-signatures (make-hash-table 'equal))
622+
(define sig* (make-hash-table 'equal)) ;; fn/macro name -> params
623+
(xdef sig* sig*)
623624

624-
; This is a replacement for xdef that stores opeator signatures.
625+
; This is a replacement for xdef that stores operator signatures.
625626
; Haven't started using it yet.
626627

627628
(define (odef a parms b)
628629
(namespace-set-variable-value! (ac-global-name a) b)
629-
(hash-table-put! fn-signatures a (list parms))
630+
(hash-table-put! sig* a (list parms))
630631
b)
631632

632-
(xdef sig fn-signatures)
633-
634633
; versions of car and cdr for parsing arguments for optional
635634
; parameters, that yield nil for nil. maybe we should use
636635
; full Arc car and cdr, so we can destructure more things

arc.arc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
(assign do (annotate 'mac
3030
(fn args `((fn () ,@args)))))
3131

32-
(sref sig 'args 'do)
32+
(sref sig* 'args 'do)
3333
(sref source-file* current-load-file* 'do)
3434

3535
(assign safeset (annotate 'mac
@@ -40,21 +40,21 @@
4040
(disp #\newline (stderr))))
4141
(assign ,var ,val)))))
4242

43-
(sref sig '(var val) 'safeset)
43+
(sref sig* '(var val) 'safeset)
4444
(sref source-file* current-load-file* 'safeset)
4545

4646
(assign docify-body (fn (body)
4747
(if (if (is (type car.body) 'string) cdr.body)
4848
body
4949
(cons nil body))))
5050

51-
(sref sig '(body) 'docify-body)
51+
(sref sig* '(body) 'docify-body)
5252
(sref source-file* current-load-file* 'docify-body)
5353

5454
(assign def (annotate 'mac
5555
(fn (name parms . body)
5656
((fn ((doc . body))
57-
`(do (sref sig ',parms ',name)
57+
`(do (sref sig* ',parms ',name)
5858
(sref help* ',doc ',name)
5959
(sref source-file* current-load-file* ',name)
6060
(sref source* '(def ,name ,parms ,@body) ',name)
@@ -64,14 +64,14 @@
6464
(assign redef (annotate 'mac
6565
(fn (name parms . body)
6666
((fn ((doc . body))
67-
`(do (sref sig ',parms ',name)
67+
`(do (sref sig* ',parms ',name)
6868
(sref help* ',doc ',name)
6969
(sref source-file* current-load-file* ',name)
7070
(sref source* '(def ,name ,parms ,@body) ',name)
7171
(assign ,name (fn ,parms ,@body)))) ; don't warn on redef
7272
(docify-body body)))))
7373

74-
(sref sig '(name parms . body) 'def)
74+
(sref sig* '(name parms . body) 'def)
7575
(sref source-file* current-load-file* 'def)
7676

7777
(def caar (xs) (car:car xs))
@@ -115,7 +115,7 @@
115115
(assign mac (annotate 'mac
116116
(fn (name parms . body)
117117
((fn ((doc . body))
118-
`(do (sref sig ',parms ',name)
118+
`(do (sref sig* ',parms ',name)
119119
(sref help* ',doc ',name)
120120
(sref source-file* current-load-file* ',name)
121121
(sref source* '(mac ,name ,parms ,@body) ',name)
@@ -125,14 +125,14 @@
125125
(assign remac (annotate 'mac
126126
(fn (name parms . body)
127127
((fn ((doc . body))
128-
`(do (sref sig ',parms ',name)
128+
`(do (sref sig* ',parms ',name)
129129
(sref help* ',doc ',name)
130130
(sref source-file* current-load-file* ',name)
131131
(sref source* '(mac ,name ,parms ,@body) ',name)
132132
(assign ,name (annotate 'mac (fn ,parms ,@body))))) ; don't warn on redef
133133
(docify-body body)))))
134134

135-
(sref sig '(name parms . body) 'mac)
135+
(sref sig* '(name parms . body) 'mac)
136136
(sref source-file* current-load-file* 'mac)
137137

138138
(mac make-br-fn (body) `(fn (_) ,body))

lib/defpat.arc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,13 @@
8181
(()) ())
8282
See also [[defpat]] "
8383
; special handling for some macros because
84-
; their signatures are not in the (sig ...)
85-
; table
84+
; their signatures are not in the sig* table
8685
(if (in macro 'def 'mac)
8786
`(,macro ,(car body) ,@(*defpat-internal (cdr body)))
8887
(is macro 'fn)
8988
`(fn ,@(*defpat-internal body))
9089
; else
91-
(let s (sig macro)
90+
(let s (sig* macro)
9291
(unless s
9392
(err (string "p-m: unknown macro " macro)))
9493
(unless (dotted s)

lib/help.arc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
(when (or value doc)
4848
(pr "[" kind "]")
4949
(apply pr (n-of (- 4 (len:string kind)) " "))
50-
(write (aif sig.name (cons name it)
50+
(write (aif sig*.name (cons name it)
5151
(in kind 'fn 'mac) (list name)
5252
name))
5353
(prn)
@@ -60,5 +60,5 @@
6060
Otherwise, names of which `(string test)' is a prefix pass. "
6161
(let test (if (isa test 'fn) test
6262
(let pfx string.test [begins string._ pfx]))
63-
(each f (sort < (keep test keys.sig))
63+
(each f (sort < (keep test keys.sig*))
6464
(pr (helpstr sym.f nil)))))

lib/ppr.arc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
(ppr-sub
142142
(pr "(")
143143
(withs (proc car.x
144-
args sig.proc
144+
args sig*.proc
145145
n len.args
146146
str (tostring:print proc)
147147
l len.str

0 commit comments

Comments
 (0)