(make-object drracket:rep:text% context) → (is-a?/c drracket:rep:text%) context : (implements drracket:rep:context<%>)Resets any error highlighting in this editor.Resets any error highlighting in this editor.This displays each of the elements of results in the interactions window, expect those elements of results that are void. Those are just ignored.Specification: Use this function to evaluate code or run actions that should mimic the user’s interactions. For example, DrRacket uses this function to evaluate expressions in the definitions window and expressions submitted at the prompt.
Default implementation: The function run-loop is called. It is expected to loop, calling its argument with a thunk that corresponds to the user’s evaluation. It should call its argument once for each expression the user is evaluating. It should pass a thunk to its argument that actually does the users’s evaluation.Specification: This function evaluates all of the expressions in a text.
Default implementation: It evaluates all of the expressions in text starting at start and ending at end, calling do-many-evals to handle the evaluation.
(send a-drracket:rep:text evaluate-from-port port complete-program? cleanup) → any port : input-port? complete-program? : boolean? cleanup : (-> void)Evaluates the program in the port argument. If complete-program? is #t, this method calls the front-end/complete-program to evaluate the program. If it is #f, it calls front-end/interaction method. When evaluation finishes, it calls cleanup on the user’s main thread.
Just before calling cleanup, this invokes the thunk in drracket:rep:after-expression (if any). It takes the value of the drracket:rep:after-expression parameter on the DrRacket main thread, but invokes the thunk on the user’s thread.
This method must be called from the DrRacket main thread.Augments <method not found>.Called from the DrRacket main thread after evaluate-from-port finishes (no matter how it finishes).Use run-on-user-thread to initialize the user’s parameters, etc.
Do not print to current-output-port or current-error-port during the dynamic extent of the thunk passed to run-on-user-thread becuase this can deadlock. IO is still, in general, fine, but the current-error-port and current-output-port are set to the user’s ports that print into the interactions window and are not in a good state during those calls.
(send a-drracket:rep:text get-error-range) → (or/c false/c (list/c (is-a?/c text:basic%) number? number?))Specification: Indicates the highlighted error range. The state for the error range is shared across all instances of this class, so there can only be one highlighted error region at a time.
Default implementation: If #f, no region is highlighted. If a list, the first element is the editor where the range is highlighted and the second and third are the beginning and ending regions, respectively.This is the custodian controlling the user’s program.This is the user’s eventspace. The result of get-user-thread is the main thread of this eventspace.Returns the user’s language-settings for the most recently run program. Consider using get-next-settings instead, since the user may have selected a new language since the program was last run.Returns the user’s namespace. This method returns a new namespace each time Run is clicked.This method returns the thread that the users code runs in. It is returns a different result, each time the user runs the program.
It is #f before the first time the user click on the Run button or the evaluation has been killed.
This thread has all of its parameters initialized according to the settings of the current execution. See Parameters for more information about parameters.Call this method to highlight errors associated with this repl. See also reset-highlighting, and highlight-errors/exn.
This method highlights a series of dis-contiguous ranges in the editor.
It puts the caret at the location of the first error.Highlights the errors associated with the exn (only syntax and read errors – does not extract any information from the continuation marks)
See also highlight-errors.This inserts the “Welcome to DrRacket” message into the interactions buffer, calls reset-console, insert-prompt, and clear-undos.
Once the console is initialized, this method calls first-opened. Accordingly, this method should not be called to initialize a REPL when the user’s evaluation is imminent. That is, this method should be called when new tabs or new windows are created, but not when the Run button is clicked.
This method calls the first-opened from the user’s eventspace’s main thread and, when first-opened returns, it enqueue’s a callback that ends an edit sequence on the REPL and calls clear-undos. Accordingly, if the first-opened method does not return, the interactions text will be in an unclosed edit sequence.Inserts a new prompt at the end of the text.This method is called when the user chooses the kill menu item.Calls shutdown.
Calls the super method.Specification: This method queues thunks for DrRacket’s eventspace in a special output-related queue.Kills the old eventspace, and creates a new parameterization for it.This method resets the highlighting being displayed for this repl. See also: highlight-errors, and highlight-errors/exn.Specification: This function runs its arguments in the user evaluation thread. This thread is the same as the user’s eventspace main thread.
See also do-many-evals.
Default implementation: Calls f, after switching to the user’s thread.Shuts down the user’s program and all windows. Reclaims any resources the program allocated. It is expected to be called from DrRacket’s main eventspace thread.This waits for all pending IO in the rep to finish and then returns.
This method must only be called from the main thread in DrRacket’s eventspaceThis waits for all pending IO in the rep to finish and then returns.This method must only be called from the main thread in the user’s eventspace
|drracket:rep:drs-bindings-keymap-mixin : (class? . -> . class?)|
Calls the super method and adds in a keymap with the DrRacket-specific keybindings:
f5 - Run
c:x;o - toggles the focus between the definition and interactions windows.
Specification: Call this method to clear any annotations in the text before executing or analyzing or other such activities that should process the program.
Tools that annotate the program text should augment this method to clear their own annotations on the program text.
DrRacket calls this method before a program is run (via the Run button).
Default implementation: Clears any error highlighting in the definitions window.Call this method to disable evaluation GUI evaluation while some evaluation (or expansion) is taking place on another thread.
Override this method if you add a GUI-based mechanism for initiating evaluation in the frame.
This method is also called when the user switches tabs.
See also enable-evaluation.This method must disable the GUI controls that start user-sponsored evaluation. It is called once the user starts some evaluation to ensure that only one evaluation proceeds at a time.
It is also called when the user switches tabs.
See also disable-evaluation.This method is called to force the rep window to be visible when, for example, an error message is put into the rep. Also ensures that the appropriate tab is visible, if necessary.Returns the last values passed to set-breakables.The result of this method is used as the initial directory for the user’s program to be evaluated in.This method should return an explanatory string when the state of the program that the repl reflects has changed. It should return #f otherwise.The break button typically offers to kill if it has been pushed twice in a row. If this method is called, however, it ignores any prior clicks.Calling this method with a thread and a custodian means that the next time the break button is clicked, it will either break the thread or shutdown the custodian.
See also get-breakables.This method should update some display in the gui that indicates whether or not evaluation is currently proceeding in the user’s world.
(drracket:rep:after-expression) → (or/c #f (-> any)) (drracket:rep:after-expression top-level-expression) → void? top-level-expression : (or/c #f (-> any))