[plt-scheme] Re: newbie question: printing structs?

From: jos koot (jos.koot at telefonica.net)
Date: Tue Mar 13 05:35:17 EDT 2007

You also will have to take care of the inspector, i.e:

(define-struct a (x y z))
(define sa (make-a 1 2 3))
sa ; --> #<struct:a>

(define inspector (make-inspector))
(define-struct b (x y z) inspector)
(define sb (make-b 1 2 3))
sb ; --> #(struct:b 1 2 3)

Jos

----- Original Message ----- 
  From: Andrew Reilly 
  To: PLT-Scheme mailing list 
  Sent: Tuesday, March 13, 2007 7:30 AM
  Subject: [plt-scheme] Re: newbie question: printing structs?


  On Tue, Mar 13, 2007 at 04:53:11PM +1100, Andrew Reilly wrote:
  > When debugging, how can I print the entire contents of a struct?

  Aah.  I think I've just got it:
  (print-struct #t) gates subsequent display of struct contents, which is also
  gated by the #f argument to define-struct.  Neat.

  Cheers,

  -- 
  Andrew
  _________________________________________________
    For list-related administrative tasks:
    http://list.cs.brown.edu/mailman/listinfo/plt-scheme
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070313/463480c2/attachment.html>

Posted on the users mailing list.