KMRCLを眺める(174) SHOW-FUNCTIONS — #:g1

Posted 2010-07-08 13:41:00 GMT

今回は、KMRCLのsymbols.lispからSHOW-FUNCTIONSです。
前回は、変数でしたが今回はそれの関数版です。
動作は、

(KL:SHOW-FUNCTIONS :KMRCL)
->
Function KMRCL::STRING-DEFAULT-CASE  -> #<FUNCTION KMRCL::STRING-DEFAULT-CASE>
Function KMRCL::BYTE-ARRAY-OUTPUT-STREAM-OUT  -> #<CLOSURE (LAMBDA
                                                               (SB-KERNEL:INSTANCE)) {1004F93809}>
Function KMRCL::%PRINT-BYTE-ARRAY-OUTPUT-STREAM  -> #<FUNCTION KMRCL::%PRINT-BYTE-ARRAY-OUTPUT-STREAM>
Function KMRCL::BYTE-ARRAY-INPUT-STREAM-CHAR-SIZE  -> #<CLOSURE (LAMBDA
                                                                    (SB-KERNEL:INSTANCE)) {1004E9ADD9}>
Function KMRCL::BYTE-ARRAY-OUTPUT-STREAM-EOF-FORCED-P  -> #<CLOSURE (LAMBDA
                                                                        (SB-KERNEL:INSTANCE)) {10041AA599}>
Function KMRCL::BYTE-ARRAY-OUTPUT-STREAM-EXTERNAL-FORMAT  -> #<CLOSURE (LAMBDA
                                                                           (SB-KERNEL:INSTANCE)) {100535A469}>
Function KMRCL::BYTE-ARRAY-INPUT-STREAM-DUAL-CHANNEL-P  -> #<CLOSURE (LAMBDA
                                                                         (SB-KERNEL:INSTANCE)) {10044000B9}>
Function KMRCL::CL-SYMBOLS  -> #<FUNCTION KMRCL::CL-SYMBOLS>
Function KMRCL::BYTE-ARRAY-OUTPUT-STREAM-PATHNAME  -> #<CLOSURE (LAMBDA
                                                                    (SB-KERNEL:INSTANCE)) {1005353729}>
Function KMRCL::BYTE-ARRAY-OUTPUT-STREAM-DELETE-ORIGINAL  -> #<CLOSURE (LAMBDA
                                                                           (SB-KERNEL:INSTANCE)) {10059CD009}>
Function KMRCL::BYTE-ARRAY-INPUT-STREAM-LISTEN  -> #<CLOSURE (LAMBDA
                                                                 (SB-KERNEL:INSTANCE)) {1005A87D89}>
Function KMRCL::REMOTE-HOST  -> #<FUNCTION KMRCL::REMOTE-HOST>
Function KMRCL::REPL-ON-STREAM  -> #<FUNCTION KMRCL::REPL-ON-STREAM>
Function KMRCL::BYTE-ARRAY-BINCH  -> #<FUNCTION KMRCL::BYTE-ARRAY-BINCH>
Function KMRCL::CATCH-ERRORS  -> #<STANDARD-GENERIC-FUNCTION KMRCL::CATCH-ERRORS (1)>
Function KMRCL::BYTE-ARRAY-OUTPUT-STREAM-INSTEAD  -> #<CLOSURE (LAMBDA
                                                                   (SB-KERNEL:INSTANCE)) {1005586FB9}>
Function KMRCL::BUF-USED  -> #<CLOSURE (LAMBDA (SB-KERNEL:INSTANCE)) {10040F4CB9}>
Function KMRCL::BYTE-ARRAY-INPUT-STREAM-TIMEOUT  -> #<CLOSURE (LAMBDA
                                                                  (SB-KERNEL:INSTANCE)) {10053D5B79}>
Function KMRCL::BUF-POP  -> #<FUNCTION KMRCL::BUF-POP>
Function KMRCL::BYTE-ARRAY-INPUT-STREAM-BIN  -> #<CLOSURE (LAMBDA
                                                              (SB-KERNEL:INSTANCE)) {1004E19F49}>
Function KMRCL::BYTE-ARRAY-IN-MISC  -> #<FUNCTION KMRCL::BYTE-ARRAY-IN-MISC>
Function KMRCL::BYTE-ARRAY-INPUT-STREAM-BUFFERING  -> #<CLOSURE (LAMBDA
                                                                    (SB-KERNEL:INSTANCE)) {100517C1B9}>
Function KMRCL::MAPCAR2-APPEND-STRING-NONTAILREC  -> #<FUNCTION KMRCL::MAPCAR2-APPEND-STRING-NONTAILREC>
Function KMRCL::BUF-P  -> #<CLOSURE (LAMBDA (SB-KERNEL::OBJECT)) {100463FB59}>
Function KMRCL::BYTE-ARRAY-INPUT-STREAM-NAME  -> #<CLOSURE (LAMBDA
                                                               (SB-KERNEL:INSTANCE)) {1004245D19}>
Function KMRCL::CANONICALIZE-DIRECTORY-NAME  -> #<FUNCTION KMRCL::CANONICALIZE-DIRECTORY-NAME>
Function KMRCL::FIELD-BUFFERS-BUFFERS  -> #<CLOSURE (LAMBDA
                                                        (SB-KERNEL:INSTANCE)) {100529FFB9}>
Function KMRCL::BYTE-ARRAY-INPUT-STREAM-BYTE-ARRAY  -> #<CLOSURE (LAMBDA
                                                                     (SB-KERNEL:INSTANCE)) {1005979BF9}>
Function KMRCL::BASE-NAME  -> #<STANDARD-GENERIC-FUNCTION KMRCL::BASE-NAME (1)>
Function KMRCL::BYTE-ARRAY-INPUT-STREAM-BOUT  -> #<CLOSURE (LAMBDA
                                                               (SB-KERNEL:INSTANCE)) {1004738469}>
Function KMRCL::BYTE-ARRAY-OUTPUT-STREAM-BUFFERING  -> #<CLOSURE (LAMBDA
                                                                     (SB-KERNEL:INSTANCE)) {100461D8B9}>
Function KMRCL::MAKE-FD-STREAM  -> #<FUNCTION KMRCL::MAKE-FD-STREAM>
....
となっています。定義は、
(defun show-functions (package)
  (do-symbols (s package)
    (multiple-value-bind (sym status)
        (find-symbol (symbol-name s) package)
      (when (and (or (eq status :external)
                     (eq status :internal))
                 (fboundp sym))
        (format t "~&Function ~S~T -> ~S~%"
                sym
                (symbol-function sym))))))
で、変数版とほぼ同一です。

comments powered by Disqus