{"size": 2905, "ext": "scrbl", "max_stars_repo_path": "share/pkgs/compatibility-doc/mzlib/scribblings/compat.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/compat.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/compat.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": 29.3434343434, "max_line_length": 75, "alphanum_fraction": 0.6922547332}
#lang scribble/doc
@(require "common.rkt"
          scribble/eval
          (for-label mzlib/compat))

@(define compat-eval (make-base-eval))

@interaction-eval[#:eval compat-eval (require mzlib/compat)]

@mzlib[#:mode title compat]

The @racketmodname[mzlib/compat] library defines a number of
procedures and syntactic forms that are commonly provided by other
Scheme implementations. Most of the procedures are aliases for
@racketmodname[mzscheme] procedures.

@deftogether[(
@defproc[(=? [n number?] ...+) boolean?]
@defproc[(<? [n real?] ...+) boolean?]
@defproc[(>? [n real?] ...+) boolean?]
@defproc[(<=? [n real?] ...+) boolean?]
@defproc[(>=? [n real?] ...+) boolean?]
)]{

Same as @racket[=], @racket[<], etc.}

@deftogether[(
@defproc[(1+ [n number?]) number?]
@defproc[(1- [n number?]) number?]
)]{

Same as @racket[add1] and @racket[sub1].}


@defproc[(gentmp [base (or/c string? symbol?) "g"]) symbol?]{

Same as @racket[gensym].}


@defproc[(flush-output-port [o output-port? (current-output-port)]) void?]{

Same as @racket[flush-output].}

@defproc[(real-time) exact-integer?]{

Same as @racket[current-milliseconds].}


@defproc[(atom? [v any/c]) any]{

Same as @racket[(not (pair? v))] (which does not actually imply an
atomic value).}


@defform*[[(define-structure (name-id field-id ...))
           (define-structure (name-id field-id ...) 
                             ((init-field-id init-expr) ...))]]{

Like @racket[define-struct], except that the @racket[name-id] is moved
inside the parenthesis for fields. In addition,
@racket[init-field-id]s can be specified with automatic initial-value
expression.

The @racket[init-field-id]s do not have corresponding arguments for
the @racketidfont{make-}@racket[name-id] constructor. Instead, each
@racket[init-field-id]'s @racket[init-expr] is evaluated to obtain the
field's value when the constructor is called. The @racket[field-id]s
are bound in @racket[init-expr]s, but not other
@racket[init-field-id]s.

@examples[
#:eval compat-eval
(define-structure (add left right) ([sum (+ left right)]))
(add-sum (make-add 3 6))
]}

@deftogether[(
@defproc[(getprop [sym symbol?][property symbol?][default any/c #f]) any/c]
@defproc[(putprop [sym symbol?][property symbol?][value any/c]) void?]
)]{

The @racket[getprop] function gets a property value associated with
@racket[sym].  The @racket[property] argument names the property to be
found. If the property is not found, @racket[default] is returned.

The properties obtained with @racket[getprop] are the ones installed
with @racket[putprop].}


@defproc[(new-cafe [eval-handler (any/c . -> . any) #f]) any]{

Emulates Chez Scheme's @racket[new-cafe] by installing
@racket[eval-handler] into the @racket[current-eval] parameter while
running @racket[read-eval-print]. In addition, @racket[current-exit]
is set to escape from the call to @racket[new-cafe].}


@close-eval[compat-eval]
