[Fluxus] Apropos
Scott
alcoholiday at gmail.com
Tue Sep 29 09:09:12 PDT 2009
Hey Guys,
I find this little tid-bit useful, it works like the unix apropos command.
Instead of waiting for me to get my tree merged, I'd thought I'd let someone
else commit it; if it seems useful for others.
I'm also planning on integrating this with the helpfile function at some
point.
-Scott
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; apropos
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; usage: (apropos "foo") will return a list of all namespace-mapped-symbols
with "foo" in them
(define (apropos s)
(let* ([apropos-list (map symbol->string (namespace-mapped-symbols))]
[apropos-regex (lambda (s)
(let ((al (filter (lambda (l) (regexp-match s l)) apropos-list)))
al))])
(apropos-regex (string-append ".*" s ".*"))))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pawfal.org/pipermail/fluxus-pawfal.org/attachments/20090929/77e3ad5b/attachment-0002.htm>
More information about the Fluxus
mailing list