[Chicken-users] Creating new types and their representation in the REPL
From:
Jack Trades
Subject:
[Chicken-users] Creating new types and their representation in the REPL
Date:
Wed, 7 Jul 2010 13:45:39 -0500
I'm sure this is a simple question but I can't quite figure it out. Is there a way to get (define-record ...) to print out something other than the tag of the record?
Example of current behavior:
(define-record point x y)
(define p (make-point 5 10)) p ===> #<point>
Example of desired behavior:
(define-record point x y) (define p (make-point 5 10)) p ===> (5 10) -- or -- ===> (point 5 10)
Or is there a better way to create new types that allows for the representation of those types in the REPL to be customized? I guess what I'm looking for here is something like python's repr and str.