(index ("make-variable" 0) ("warning-guard" 562) ("checked-guard" 1370) ("define-variable" 2248) ("define-warning-variable" 2707) ("define-checked-variable" 3415) ("define-parameter" 4121) ("define-warning-parameter" 4514) ("define-checked-parameter" 5228))
(def (sig (procedure "(make-variable INIT [GUARD]) => (procedure _ *)" (id make-variable))) (p "Returns a " (tt "procedure") " whose behavior is that of a " (tt "parameter") ", except for the fact that it is " (b "not") " a " (tt "parameter") ". The closed-over value is not thread-local.") (p (tt "INIT") " is some Scheme " (tt "object") " that meets the constraint enforced by the " (tt "GUARD") ".") (p (tt "GUARD") " is a " (tt "(procedure (*) *)") " returning an acceptable value for the variable. Default is " (tt "identity") ".") (p "Supports SRFI 17."))
(def (sig (syntax "(warning-guard GETTER-NAME TYPENAME [BODY...])" (id warning-guard))) (p "Constructs a variable or parameter guard procedure that generates a warning and returns the current value when the type predicate fails, otherwise the submitted value is returned.") (p (tt "TYPENAME") " is an " (tt "identifier") " and " (tt "TYPENAME?") " is a " (tt "(procedure (*) boolean)") ".") (p (tt "GETTER-NAME") " is an " (tt "identifier") " and the name of a " (tt "procedure _ *") ".") (p (tt "BODY") " is zero or more expressions that are performed after a successful typecheck. " (i "Note") " that since the guard is invoked by a " (tt "variable") " or " (tt "parameter") " during initialization, so will be the body code.") (highlight scheme "(use variable-item)\n\n(warning-guard some-var integer)"))
(def (sig (syntax "(checked-guard GETTER-NAME TYPENAME [BODY...])" (id checked-guard))) (p "Constructs a variable or parameter guard procedure that uses a type check procedure to verify the submitted value is returned.") (p (tt "TYPENAME") " is an " (tt "identifier") " and " (tt "check-TYPENAME") " is a " (tt "(procedure ((or #f symbol) * #!optional (or symbol string)) *)") ". See " (int-link "check-errors") " for a suite of these procedures.") (p (tt "GETTER-NAME") " is an " (tt "identifier") " and the name of a " (tt "procedure _ *") ".") (p (tt "BODY") " is zero or more expressions that are performed after a successful typecheck. " (i "Note") " that since the guard is invoked by a " (tt "variable") " or " (tt "parameter") " during initialization, so will be the body code.") (highlight scheme "(use variable-item type-checks)\n\n(checked-guard some-var integer)"))
(def (sig (syntax "(define-variable NAME INIT [GUARD])" (id define-variable))) (p "Wrapper around " (tt "make-variable") " that defines the variable " (tt "NAME") " to the " (i "variable") ".") (p (tt "NAME") " is an " (tt "identifier") ".") (p (tt "INIT") " and " (tt "GUARD") " as for " (tt "make-variable") ".") (highlight scheme "(use variable-item)\n\n(define-variable scale * (warning-guard scale procedure))\n(scale) ;=> #<procedure ...>\n(scale /)"))
(def (sig (syntax "(define-warning-variable NAME INIT TYPENAME [BODY...])" (id define-warning-variable))) (p "Wrapper around " (tt "make-variable") " and " (tt "warning-guard") " that defines the variable " (tt "NAME") " to the " (i "variable") ".") (p (tt "NAME") " is an " (tt "identifier") ".") (p (tt "INIT") " is some Scheme " (tt "object") ".") (p (tt "TYPENAME") " is an " (tt "identifier") ". The basename of a type predicate; see " (int-link "#warning-guard" "warning-guard") ".") (p (tt "BODY...") " as for " (tt "warning-guard") ".") (highlight scheme "(use variable-item)\n\n(define-warning-variable scale * procedure)\n(scale 23) ;=> Warning: (foo) \"bad argument type - not a procedure\" 23"))
(def (sig (syntax "(define-checked-variable NAME INIT TYPENAME [BODY...])" (id define-checked-variable))) (p "Wrapper around " (tt "make-variable") " and " (tt "checked-guard") " that defines the variable " (tt "NAME") " to the " (i "variable") ".") (p (tt "NAME") " is an " (tt "identifier") ".") (p (tt "INIT") " is some Scheme " (tt "object") ".") (p (tt "TYPENAME") " is an " (tt "identifier") ". The basename of a type predicate; see " (int-link "#checked-guard" "checked-guard") ".") (p (tt "BODY...") " as for " (tt "checked-guard") ".") (highlight scheme "(use variable-item)\n\n(define-checked-variable scale * procedure)\n(scale 23) ;=> Error: (foo) \"bad argument type - not a procedure\" 23"))
(def (sig (syntax "(define-parameter NAME INIT [GUARD])" (id define-parameter))) (p "Wrapper around " (tt "make-parameter") " that defines the parameter " (tt "NAME") " to the " (i "parameter") ".") (p (tt "NAME") " is an " (tt "identifier") ".") (p (tt "INIT") " and " (tt "GUARD") " as for " (tt "make-parameter") ".") (p "Duplicate of macro found in the " (tt "miscmacros") " extension."))
(def (sig (syntax "(define-warning-parameter NAME INIT TYPENAME [BODY...])" (id define-warning-parameter))) (p "Wrapper around " (tt "make-parameter") " and " (tt "warning-guard") " that defines the parameter " (tt "NAME") " to the " (i "parameter") ".") (p (tt "NAME") " is an " (tt "identifier") ".") (p (tt "INIT") " is some Scheme " (tt "object") ".") (p (tt "TYPENAME") " is an " (tt "identifier") ". The basename of a type predicate; see " (int-link "#warning-guard" "warning-guard") ".") (p (tt "BODY...") " as for " (tt "warning-guard") ".") (highlight scheme "(use parameter-item)\n\n(define-warning-variable scale * procedure)\n(scale 23) ;=> Warning: (foo) \"bad argument type - not a procedure\" 23"))
(def (sig (syntax "(define-checked-parameter NAME INIT TYPENAME [BODY...])" (id define-checked-parameter))) (p "Wrapper around " (tt "make-parameter") " and " (tt "checked-guard") " that defines the variable " (tt "NAME") " to the " (i "parameter") ".") (p (tt "NAME") " is an " (tt "identifier") ".") (p (tt "INIT") " is some Scheme " (tt "object") ".") (p (tt "TYPENAME") " is an " (tt "identifier") ". The basename of a type predicate; see " (int-link "#checked-guard" "checked-guard") ".") (p (tt "BODY...") " as for " (tt "checked-guard") ".") (highlight scheme "(use parameter-item)\n\n(define-checked-parameter scale * procedure)\n(scale 23) ;=> Error: (foo) \"bad argument type - not a procedure\" 23"))
