{"size": 2017, "ext": "scrbl", "max_stars_repo_path": "share/pkgs/compatibility-doc/mzlib/scribblings/pconvert-prop.scrbl", "max_stars_repo_name": "takikawa/racket-ppa", "max_stars_repo_stars_event_min_datetime": "2018-07-29T04:13:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T16:11:17.000Z", "max_issues_repo_path": "compatibility-doc/mzlib/scribblings/pconvert-prop.scrbl", "max_issues_repo_name": "NoahStoryM/compatibility", "max_issues_repo_issues_event_min_datetime": "2017-08-25T20:26:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T17:48:40.000Z", "max_forks_repo_path": "compatibility-doc/mzlib/scribblings/pconvert-prop.scrbl", "max_forks_repo_name": "NoahStoryM/compatibility", "max_forks_repo_forks_event_min_datetime": "2015-03-09T12:20:01.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-09T05:02:56.000Z"}
{"max_stars_count": 10, "max_issues_count": 15, "max_forks_count": 8, "avg_line_length": 40.34, "max_line_length": 95, "alphanum_fraction": 0.7714427367}
#lang scribble/doc
@(require "common.rkt"
          (for-label mzlib/pconvert
                     mzlib/pconvert-prop))

@mzlib[#:mode title pconvert-prop]


@deftogether[(
@defthing[prop:print-converter property?]
@defproc[(print-converter? [v any/c]) any]
@defproc[(print-converter-proc [v print-converter?]) (any/c (any/c . -> . any/c) . -> . any/c)]
)]{

The @racket[prop:print-converter] property can be given a procedure
value for a structure type. In that case, for constructor-style print
conversion via @racket[print-convert], instances of the structure are
converted by calling the procedure that is the property's value. The
procedure is called with the value to convert and a procedure to
recursively convert nested values. The result should be an
S-expression for the converted value.

The @racket[print-converter?] predicate recognizes instances of
structure types that have the @racket[prop:print-converter] property,
and @racket[print-converter-proc] extracts the property value.}


@deftogether[(
@defthing[prop:print-convert-constructor-name property?]
@defproc[(print-convert-named-constructor? [v any/c]) any]
@defproc[(print-convert-constructor-name [v print-convert-named-constructor?]) any]
)]{

The @racket[prop:print-convert-constructor-name] property can be given
a symbol value for a structure type. In that case, for
constructor-style print conversion via @racket[print-convert],
instances of the structure are shown using the symbol as the
constructor name. 

The @racket[prop:print-converter] property takes precedence over
@racket[prop:print-convert-constructor-name]. If neither is attached
to a structure type, its instances are converted using a constructor
name that is @racketidfont{make-} prefixed onto the result of
@racket[object-name].

The @racket[print-convert-named-constructor?] predicate recognizes
instances of structure types that have the
@racket[prop:print-convert-constructor-name] property, and
@racket[print-convert-constructor-name] extracts the property value.}
