* Richard James Panturis Giuly <······@surfsouth.com>
| Is there a lisp function that will print the actual contents of a
| hash-table out for debugging. (I'm using ACL)
My suggestion: Use the inspector. Why do you need to print all of it?
#:Erik
--
If this is not what you expected, please alter your expectations.
Richard James Panturis Giuly <······@surfsouth.com> writes:
> Is there a lisp function that will print the actual contents of a
> hash-table out for debugging.
> (I'm using ACL)
>
(loop for key being each hash-key of *a-hash-table*
using (hash-value value)
collect (list key value))
will return the key value pairs in a list.
You can also use MAPHASH or WITH-HASH-TABLE-ITERATOR.
--
Lieven Marchand <···@bewoner.dma.be>
If there are aliens, they play Go. -- Lasker
Richard James Panturis Giuly <······@surfsouth.com> writes:
> Is there a lisp function that will print the actual contents of a
> hash-table out for debugging.
> (I'm using ACL)
maphash and with-hash-table-iterator allow you to iterate over the
contents of a hash-table.
Chris.
--
http://www.double.co.nz/dylan
Something like the following has been in my ~/.clinit.cl
since early in the last decade of the last century, assuming
you're willing to accept that the new millenium has already
started. The question whether the millenium changes at
2000 or 2001 is hardly relevant to the printing of hash-tables,
but it would be a shame to miss an opportunity needlessly to
annoy #:Erik.
(defun print-ht (ht &aux (*print-pretty* t))
(format t "~&~s~%" ht)
(maphash (lambda (k v) (format t ··@<~S~20T~3I~_~S~:>~%" k v)) ht)
(values))
(setf (tpl:alias "pht") #'print-ht)
Just kidding, #:Erik...
In article <·················@surfsouth.com>,
Richard James Panturis Giuly <······@surfsouth.com> wrote:
> Is there a lisp function that will print the actual contents of a
> hash-table out for debugging.
http://clocc.sourceforge.net
clocc/src/cllib/miscprint.lisp
(http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/~checkout~/clocc/src/clli
b/miscprint.lisp?cvsroot=clocc)
defun print-hash-table
see also clocc/src/cllib/inspect.lisp
which will display the hashtable in your html browser
> (I'm using ACL)
Allegro comes with an inspect ANSI CL function.
try it!
Sent via Deja.com http://www.deja.com/
Before you buy.
In article <·················@surfsouth.com>,
Richard James Panturis Giuly <······@surfsouth.com> wrote:
> Is there a lisp function that will print the actual contents of a
> hash-table out for debugging.
http://clocc.sourceforge.net
clocc/src/cllib/miscprint.lisp
(http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/~checkout~/clocc/src/clli
b/miscprint.lisp?cvsroot=clocc)
defun print-hash-table
see also clocc/src/cllib/inspect.lisp
which will display the hashtable in your html browser
> (I'm using ACL)
Allegro comes with an inspect ANSI CL function.
try it!
Sent via Deja.com http://www.deja.com/
Before you buy.