(index ("describe" 0) ("dump" 206) ("describe-sequence-limit" 670) ("set-describer!" 1104) ("hexdump" 1931))
(def (sig (procedure "(describe obj #!optional out)" (id describe))) (p "Prints a textual description of " (tt "OBJ") " to output port " (tt "OUT") ", which defaults to " (tt "(current-output-port)") "."))
(def (sig (procedure "(dump obj #!optional offset length out)" (id dump))) (p "Hexdump the contents of " (tt "OBJ") " to output port " (tt "OUT") ", starting at " (tt "OFFSET") " and continuing for " (tt "LENGTH") " bytes.  Offset defaults to 0, length to " (tt "#f") " (meaning, until the end) and output to " (tt "(current-output-port)") ".") (p "If dumping a " (tt "pointer") " object, length defaults to 32 bytes, as the underlying length is unknown to us."))
(def (sig (parameter "(describe-sequence-limit n)" (id describe-sequence-limit))) (p "Limit the number of elements displayed to " (tt "N") " when describing the contents of a sequence -- e.g. a list, vector, bytevector, hash table or string. Defaults to 40.") (pre "#;6> (parameterize ((describe-sequence-limit 5))\n       (describe (iota 100)))\nlist of length 100\n 0: 0\n 1: 1\n 2: 2\n 3: 3\n 4: 4\n (95 elements not displayed)"))
(def (sig (procedure "(set-describer! TAG PROC)" (id set-describer!))) (p "Sets a custom description handler that invokes " (tt "PROC") " when the " (tt ",d") " or " (tt "describe") " command is invoked with a record-type object that has the type " (tt "TAG") " (a symbol). " (tt "PROC") " is called with two arguments: the object to be described and an output-port. It should write a possibly useful textual description of the object to the passed output-port. For example:") (pre "#;1> (define-record-type point (make-point x y) point?\n       (x point-x)\n       (y point-y))\n#;2> (set-describer! 'point \n       (lambda (pt o)\n         (with-output-to-port o\n           (lambda ()\n             (print \"a point with x=\" (point-x pt) \" and y=\" (point-y pt))))))\n#;3> ,d (make-point 1 2)\na point with x=1 and y=2"))
(def (sig (procedure "(hexdump bv start end ref out)" (id hexdump))) (p "Hexdump the contents of bytevector-like object " (tt "BV") " from offset " (tt "START") " to offset " (tt "END") ", to output port " (tt "OUT") ".  " (tt "REF") " is a procedure of two arguments, " (tt "(obj i)") ", which should return the byte value of " (tt "OBJ") " at offset " (tt "I") ".") (p "An example of " (tt "REF") " for a u8vector might be " (tt "u8vector-ref") ".  For string it might be " (tt "(λ (obj i) (char->integer (string-ref obj i)))") ", or even " (tt "##sys#byte") " if you want to live dangerously.") (p (tt "dump") " provides a high-level interface to this procedure."))
