[racket] Initial environment

From: Gustavo Massaccesi (gustavo at oma.org.ar)
Date: Sun Mar 1 17:57:47 EST 2015

I agree that the best method to do this in DrRacket is to create a new
language. Once you have the language, you can configure the initial
"Automatic" language in the Language/Choose_Language menu.

My problem is that DrRacket doesn't run the first program automatically, so if I
1) Open DrRacket
2) Type (+ 1 2) in the interactions window
3) Press Enter

I get an error:
---
Welcome to DrRacket, version 6.1.1 [3m].
Language: racket [custom].
> (+ 1 2)
[error icon] #%top-interaction: unbound identifier;
 also, no #%app syntax transformer is bound in: #%top-interaction
>
---

I have to run the main program once to be able to use the interaction windows.

This first run can be automatic. But some languages are slow or weird,
so I think it's better to be able to select if I want to run the
automatic program at start. Another problem is consistency, because it
would be different of what DrRacket does when you load a rkt file or
open it with double-click in a folder.

An easier and safer possibility is to replace the initial prompt with
a message "Interactions disable! Press the RUN button!" (or a
friendlier version) like when you run #lang racket/kernel

Gustavo

On Sun, Mar 1, 2015 at 6:52 PM, Robby Findler
<robby at eecs.northwestern.edu> wrote:
> You might also consider making a new language along the lines of #lang
> racket/gui that includes the extra stuff you want.
>
> Robby
>
> On Sun, Mar 1, 2015 at 3:00 PM, Jukka Tuominen
> <jukka.tuominen at finndesign.fi> wrote:
>>
>> Thank you Eric,
>>
>> I appreciate the principle. I got it working now without violations.
>>
>> br, jukka
>>
>>
>>> I do not think it is possible. DrRacket is designed so that the
>>> interaction
>>> window has the namespace of exactly the file you are writing. That is,
>>> what
>>> you type in the interactions window should behave similarly to if you
>>> appended it into the file. And running the file should have the same
>>> behavior as running it with the command-line racket. Having DrRacket
>>> insert
>>> requires silently would violate this.
>>>
>>> On Sun, Mar 1, 2015 at 1:55 AM, Jukka Tuominen
>>> <jukka.tuominen at finndesign.fi
>>>> wrote:
>>>
>>>>
>>>> Just to clarify my previous message...
>>>>
>>>> Say, I want to include 2htdp/image and 2htdp/universe libraries so that
>>>> once I start DrRacket, I can type "circle" in the interactions pane even
>>>> before pressing the "run" button. The same libraries should be available
>>>> directly for racket and gracket, as well.
>>>>
>>>> What would be the safest way to achieve this?
>>>>
>>>> br, jukka
>>>>
>>>>
>>>> >
>>>> > If I want to ensure that certain libraries get automatically included
>>>> > (required) in the initial racket/gracket/drracket environments, where
>>>> > should I add them?
>>>> >
>>>> > I tried /racket/collects/init.rkt but that didn't seem to work. I
>>>> didn't
>>>> > remove the .zo file though...
>>>> >
>>>> > br, jukka
>>>> >
>>>> >
>>>> >
>>>> > ____________________
>>>> >   Racket Users list:
>>>> >   http://lists.racket-lang.org/users
>>>> >
>>>>
>>>>
>>>> ____________________
>>>>   Racket Users list:
>>>>   http://lists.racket-lang.org/users
>>>>
>>>
>>
>>
>> ____________________
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.