When opening a new window where the language is one of the htdp languages (via the
language dialog, not the #lang htdp/* variants), teachpacks are put into the initial REPL (instead of just having the language primitives). closes PR 11160
This commit is contained in:
parent
081fc3bad5
commit
5e04a5c6d9
|
@ -1590,7 +1590,8 @@ TODO
|
||||||
(queue-user/wait
|
(queue-user/wait
|
||||||
(λ () ; =User=, =No-Breaks=
|
(λ () ; =User=, =No-Breaks=
|
||||||
(send (drracket:language-configuration:language-settings-language user-language-settings)
|
(send (drracket:language-configuration:language-settings-language user-language-settings)
|
||||||
first-opened))))
|
first-opened
|
||||||
|
(drracket:language-configuration:language-settings-settings user-language-settings)))))
|
||||||
|
|
||||||
(define/public (reset-console)
|
(define/public (reset-console)
|
||||||
(when (thread? thread-killed)
|
(when (thread? thread-killed)
|
||||||
|
@ -1686,8 +1687,16 @@ TODO
|
||||||
|
|
||||||
(queue-user/wait
|
(queue-user/wait
|
||||||
(λ () ; =User=, =No-Breaks=
|
(λ () ; =User=, =No-Breaks=
|
||||||
(send (drracket:language-configuration:language-settings-language user-language-settings)
|
(let ([lang (drracket:language-configuration:language-settings-language user-language-settings)])
|
||||||
first-opened)))
|
(cond
|
||||||
|
;; this is for backwards compatibility; drracket used to
|
||||||
|
;; expect this method to be a thunk (but that was a bad decision)
|
||||||
|
[(object-method-arity-includes? lang 'first-opened 1)
|
||||||
|
(send lang first-opened
|
||||||
|
(drracket:language-configuration:language-settings-settings user-language-settings))]
|
||||||
|
[else
|
||||||
|
;; this is the backwards compatible case.
|
||||||
|
(send lang first-opened)]))))
|
||||||
|
|
||||||
(insert-prompt)
|
(insert-prompt)
|
||||||
(send context enable-evaluation)
|
(send context enable-evaluation)
|
||||||
|
|
|
@ -426,6 +426,9 @@
|
||||||
(go "." welcome)
|
(go "." welcome)
|
||||||
(newline port)))
|
(newline port)))
|
||||||
|
|
||||||
|
(define/override (first-opened settings)
|
||||||
|
(for-each namespace-require/constant (htdp-lang-settings-teachpacks settings)))
|
||||||
|
|
||||||
(inherit get-module get-transformer-module get-init-code
|
(inherit get-module get-transformer-module get-init-code
|
||||||
use-namespace-require/copy?)
|
use-namespace-require/copy?)
|
||||||
(define/override (create-executable setting parent program-filename)
|
(define/override (create-executable setting parent program-filename)
|
||||||
|
|
|
@ -628,8 +628,8 @@ default settings obtained via
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@defmethod[(first-opened)
|
@defmethod*[([(first-opened [settings settings]) void?]
|
||||||
void?]{
|
[(first-opened) void?])]{
|
||||||
|
|
||||||
This method is called when the language is initialized, but
|
This method is called when the language is initialized, but
|
||||||
no program is run. It is called from the user's eventspace's
|
no program is run. It is called from the user's eventspace's
|
||||||
|
@ -638,6 +638,9 @@ main thread.
|
||||||
See also
|
See also
|
||||||
@method[drracket:rep:text% initialize-console].
|
@method[drracket:rep:text% initialize-console].
|
||||||
|
|
||||||
|
It does not have to accept both zero and one arguments; the zero argument
|
||||||
|
version is for backwards compatibility and drracket tests the arity of the
|
||||||
|
method before invoking it.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user