On this page:
#%foreign-inline

3.27 Unsafe Access to Core Compiler Forms🔗ℹ

syntax

(#%foreign-inline datum maybe-mode)

 
maybe-mode = 
  | #:effect
  | #:pure
  | #:pure*
  | #:copy
  | #:copy*
The #%foreign-inline form unsafely inlines an expression form that is supported by the core compiler and runtime system that Racket runs on, which is Chez Scheme in the case of Racket CS. Omitting maybe-mode is equivalent to supplying #:effect.

Ensuring that datum is supported and has appropriate behavior (consistent with maybe-mode) is up to the user of this form:

  • The datum must not refer to any variable that is bound in the enclosing scope.

  • Evaluating datum must not raise an exception or otherwise inspect the current continuation, and it must return a single value.

  • If #:pure or #:copy is specified, then evaluating datum must not have any side effects or depend on preceding effects.

  • If #:pure* or #:copy* is specified, then not only must evaluating datum have no side effects or dependencies on preceding effects, the expression must be applied to arguments where the application has no side effects or dependencies on preceding effects.

  • If #:copy or #:copy* is specified, then the compilation may duplicate the entire (#%foreign-inline datum maybe-mode) expression one or more times to inline its implementation at different uses of its value.

Added in version 9.1.0.8 of package base.