On 8/16/05, Michael Benfield <[EMAIL PROTECTED]> wrote:
> define-record-printer seems to only work for records defined with
> define-record, and not with define-record-type or
> define-foreign-record.

It should definitely work for records defined with `define-record-type':

(define-record-type <foo> 
  (make-foo x y)
  foo?
  (x get-x) 
  (y get-y) )

(define-record-printer (<foo> f p)
  (display "<a foo>" p) )

(print (make-foo 33 44))

==>  "<a foo>"

`define-foreign-record' doesn't create a record structure as such -
it's merely a set of procedures for accessing a C struct.

To print foreign records in a more usable format, one could wrap
them into a (normal) record and define a printer for the wrapper
record.


cheers,
felix


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to