(index (":" 0) ("the" 134) ("assume" 578) ("define-type" 863) ("define-specialization" 1107) ("compiler-typecase" 2574))
(def (sig (syntax "(: IDENTIFIER TYPE)" (id :))) (p "Declares that the global variable " (tt "IDENTIFIER") " is of the given type."))
(def (sig (syntax "(the TYPE EXPRESSION)" (id the))) (p "Equivalent to " (tt "EXPRESSION") ", but declares that the result will be of the given type. Note that this form always declares the type of a single result, " (tt "the") " can not be used to declare types for multiple result values. " (tt "TYPE") " should be a subtype of the type inferred for " (tt "EXPRESSION") ", the compiler will issue a warning if this should not be the case."))
(def (sig (syntax "(assume ((VARIABLE TYPE) ...) BODY ...)" (id assume))) (p "Declares that at the start of execution of " (tt "BODY ..") ", the variables will be of the given types. This is equivalent to") (highlight scheme "(let ((VARIABLE (the TYPE VARIABLE)) ...) \n  BODY ...)"))
(def (sig (syntax "(define-type NAME TYPE)" (id define-type))) (p "Defines a type-abbreviation " (tt "NAME") " that can be used in place of " (tt "TYPE") ".  Type-abbreviations defined inside a module are not visible outside of that module."))
(def (sig (syntax "(define-specialization (NAME ARGUMENT ...) [RESULTS] BODY)" (id define-specialization))) (p "Declares that calls to the globally defined procedure " (tt "NAME") " with arguments matching the types given by " (tt "ARGUMENT") "s should be replaced by " (tt "BODY") " (a single expression). Each " (tt "ARGUMENT") " should be an identifier naming a formal parameter, or a list of the form " (tt "(IDENTIFIER TYPE)") ". In the former case, this argument specializes on the " (tt "*") " type. If given, " (tt "RESULTS") " (which follows the syntax given above under \"Type Syntax\") adjusts the result types from those previously declared for " (tt "NAME") ".") (p (tt "NAME") " must have a declared type (for example by using " (tt ":") "). If it doesn't, the specialization is ignored.") (p "User-defined specializations are always local to the compilation unit in which they occur and cannot be exported. When encountered in the interpreter, " (tt "define-specialization") " does nothing and returns an unspecified result.") (p "When multiple specializations may apply to a given call, they are prioritized by the order in which they were defined, with earlier specializations taking precedence over later ones.") (p "There is currently no way of ensuring specializations take place.  You can use the " (tt "-debug o") " compiler options to see the total number of specializations performed on a particular named function call during compilation."))
(def (sig (syntax "(compiler-typecase EXP (TYPE BODY ...) ... [(else BODY ...)])" (id compiler-typecase))) (p "Evaluates " (tt "EXP") " and executes the first clause which names a type that matches the type inferred during flow analysis as the result of " (tt "EXP") ". The result of " (tt "EXP") " is ignored and should be a single value. If a " (tt "compiler-typecase") " form occurs in evaluated code, or if it occurs in compiled code but specialization is not enabled, then it must have an " (tt "else") " clause which specifies the default code to be executed after " (tt "EXP") ". If no " (tt "else") " clause is given and no " (tt "TYPE") " matches, then a compile-time error is signalled."))
