On this page:
7.1 Customizing Dr  Racket’s Behavior
7.2 Customizing Dr  Racket’s GUI

7 Language-Specific Capabilities

7.1 Customizing DrRacket’s Behavior

When using the language declared in the source, DrRacket queries that language via module-compiled-language-info to determine if an expression in the interactions window is ready to be submitted to the evaluator (when the user types return). The info procedure is passed 'drracket:submit-predicate and should return a function with this contract:
(-> input-port?
    boolean?
    boolean?)
This function’s first argument is a port that contains the interactions window’s data, starting from the prompt position to the end of the editor. The second argument is a boolean indicating if the insertion point is followed only by whitespace. The results should be a boolean indicating if the expression should be evaluated. This function is called in sandbox, but with no filesystem or networking limits.

7.2 Customizing DrRacket’s GUI

DrRacket’s capability interface provides a mechanism for tools to allow languages to hide their GUI interface, if the tool does not apply to the language. Tools register capabilities keyed with symbols via. drracket:language:register-capability. Once registered, a tool can query a language, via the capability-value method. The result from this method controls whether or not the tool shows this part of the GUI for DrRacket.

See drracket:language:register-capability for a list of the capabilities registered by default.