1
0
forked from alex-eg/sex

keep the parameter-type rule in types, where both readers find it

sex-modules spelled out its own copy of named-arg-type, and its own
strip-pub; a parameter shape taught to one would not reach the other.
This commit is contained in:
2026-10-14 20:06:51 +03:00
parent 049d97b5e1
commit 1158768446
5 changed files with 27 additions and 27 deletions

View File

@@ -198,13 +198,7 @@
(if (list? fields) (map second (normalize-fields fields)) (list)))
(define (signature-types args ret)
(cons ret (map arg-type (remove comment-form? args))))
;;; (f1 float) -> float, (n unsigned int) -> (unsigned int), (int) -> (int)
(define (arg-type arg)
(cond ((not (named-arg? arg)) arg)
((null? (cddr arg)) (second arg))
(else (cdr arg))))
(cons ret (arglist-types (remove comment-form? args))))
;;; Each name TYPE mentions, and whether it is behind a pointer:
;;;
@@ -247,7 +241,7 @@
(filter-map
(lambda (form)
(and (pair? form)
(let* ((core (if (pub-form? form) (cdr form) form))
(let* ((core (strip-pub form))
(name (and (pair? core) (pair? (cdr core))
(if (and (eq? (car core) 'define) (pair? (second core)))
(car (second core))