Add #t/#f return value for apropos

This commit is contained in:
Lassi Kortela 2019-10-13 21:41:02 +03:00
parent 3e3ea1ca53
commit e9998e31f1
1 changed files with 11 additions and 8 deletions

View File

@ -1126,14 +1126,17 @@
string<? symbol->string)))) string<? symbol->string))))
(define (apropos . args) (define (apropos . args)
(for-each (λ (sym) (let ((syms (apply apropos-list args)))
(displayln (and (not (null? syms))
(string-append (for-each (λ (sym)
(let ((val (symbol-value sym))) (displayln
(if (procedure? val) "procedure" "variable ")) (string-append
" " (let ((val (symbol-value sym)))
(symbol->string sym)))) (if (procedure? val) "procedure" "variable "))
(apply apropos-list args))) " "
(symbol->string sym))))
syms)
#t)))
(define-macro (help . args) (define-macro (help . args)
`(apply help* ',args)) `(apply help* ',args))