From: Richard James Panturis Giuly
Subject: Print hash table?
Date: 
Message-ID: <3941F7E7.CBEA6706@surfsouth.com>
Is there a lisp function that will print the actual contents of a
hash-table out for debugging.
(I'm using ACL)


-- 
	ricky
	······@surfsouth.com

From: Erik Naggum
Subject: Re: Print hash table?
Date: 
Message-ID: <3169625063299150@naggum.no>
* 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.
From: Lieven Marchand
Subject: Re: Print hash table?
Date: 
Message-ID: <m31z25spmt.fsf@localhost.localdomain>
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
From: Chris Double
Subject: Re: Print hash table?
Date: 
Message-ID: <wkzootekxt.fsf@double.co.nz>
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
From: Steven M. Haflich
Subject: Re: Print hash table?
Date: 
Message-ID: <3945EB2D.A4E43EEF@franz.com>
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...
From: ···@usa.net
Subject: Re: Print hash table?
Date: 
Message-ID: <642A954DD517D411B20C00508BCF23B0012899D5@mail.sauder.com>
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.
From: ···@usa.net
Subject: Re: Print hash table?
Date: 
Message-ID: <8i5gjg$l3$1@nnrp1.deja.com>
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.