You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DrRacket uses a language's get-info function to set parameters such as
syntax coloring, indentation, and toolbar buttons. One parameter is definitions-text-surrogate1, which lets #langs set a surrogate
for DrRacket. The docs mention that this is a powerful, yet easy to do
wrong, IDE extension mechanism.
Unfortunately, as is, the definitions-text-surrogate form does not
mix well with meta-languages e.g. s-exp, reader, at-exp. When given
the definitions-text-surrogate key, get-info returns a single module
path for DrRacket to dynamic-require. There is no way for a
meta-language to mix in its surrogate with the surrogate of the
language its extending. (At least not without either creating a
temporary file on the fly, or trying to scrape the current state of
DrRacket. Both of which are terrible ideas.)
PROPOSAL:
We extend the valid values for the definitions-text-surrogate key to
be a list of symbols as well as a single symbol. In the case of a
single symbol, nothing changes.
In the case of a list, each element must also be a module path. The
last element must refer to a module that provides a surrogate% class
as before. Every other element, however, refers to a module that
provides a surrogate%mixin. The IDE constructs the expected
surrogate by traversing the list, each time dynamic-requireing the
module, and mixing in the result. Meta-languages can augment existing
surrogates, rather than having to throw them away entirely. The get-info code for a meta-language might look something like this:
ENGINEERING EFFORT:
It looks like all of the changes would be confined to the following files:
drracket/drracket/drracket/private/in-irl-namespace.rkt
drracket/drracket/drracket/private/insulated-read-language.rkt
drracket/drracket/drracket/private/module-language-tools.rkt
(Obviously also documentation+tests)
The text was updated successfully, but these errors were encountered:
BACKGROUND:
DrRacket uses a language's get-info function to set parameters such as
syntax coloring, indentation, and toolbar buttons. One parameter is
definitions-text-surrogate
1, which lets#lang
s set a surrogatefor DrRacket. The docs mention that this is a powerful, yet easy to do
wrong, IDE extension mechanism.
Unfortunately, as is, the
definitions-text-surrogate
form does notmix well with meta-languages e.g. s-exp, reader, at-exp. When given
the
definitions-text-surrogate
key, get-info returns a single modulepath for DrRacket to
dynamic-require
. There is no way for ameta-language to mix in its surrogate with the surrogate of the
language its extending. (At least not without either creating a
temporary file on the fly, or trying to scrape the current state of
DrRacket. Both of which are terrible ideas.)
PROPOSAL:
We extend the valid values for the
definitions-text-surrogate
key tobe a list of symbols as well as a single symbol. In the case of a
single symbol, nothing changes.
In the case of a list, each element must also be a module path. The
last element must refer to a module that provides a
surrogate%
classas before. Every other element, however, refers to a module that
provides a
surrogate%
mixin. The IDE constructs the expectedsurrogate by traversing the list, each time
dynamic-require
ing themodule, and mixing in the result. Meta-languages can augment existing
surrogates, rather than having to throw them away entirely. The
get-info
code for a meta-language might look something like this:ENGINEERING EFFORT:
It looks like all of the changes would be confined to the following files:
drracket/drracket/drracket/private/in-irl-namespace.rkt
drracket/drracket/drracket/private/insulated-read-language.rkt
drracket/drracket/drracket/private/module-language-tools.rkt
(Obviously also documentation+tests)
The text was updated successfully, but these errors were encountered: