Discussion:
[racket] Initial environment
Jukka Tuominen
2015-02-28 22:36:17 UTC
Permalink
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
Jukka Tuominen
2015-03-01 06:55:41 UTC
Permalink
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
Post by Jukka Tuominen
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
____________________
http://lists.racket-lang.org/users
____________________
Racket Users list:
http://lists.racket-lang.org/users
Eric Dong
2015-03-01 15:34:13 UTC
Permalink
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.
Post by Jukka Tuominen
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
Post by Jukka Tuominen
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
____________________
http://lists.racket-lang.org/users
____________________
http://lists.racket-lang.org/users
Jukka Tuominen
2015-03-01 21:00:05 UTC
Permalink
Thank you Eric,

I appreciate the principle. I got it working now without violations.

br, jukka
Post by Eric Dong
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
Post by Jukka Tuominen
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
Post by Jukka Tuominen
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
Post by Jukka Tuominen
remove the .zo file though...
br, jukka
____________________
http://lists.racket-lang.org/users
____________________
http://lists.racket-lang.org/users
____________________
Racket Users list:
http://lists.racket-lang.org/users
Robby Findler
2015-03-01 21:52:21 UTC
Permalink
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
Post by Jukka Tuominen
Thank you Eric,
I appreciate the principle. I got it working now without violations.
br, jukka
Post by Eric Dong
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
Post by Jukka Tuominen
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
Post by Jukka Tuominen
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
Post by Jukka Tuominen
remove the .zo file though...
br, jukka
____________________
http://lists.racket-lang.org/users
____________________
http://lists.racket-lang.org/users
____________________
http://lists.racket-lang.org/users
____________________
Racket Users list:
http://lists.racket-lang.org/users
Gustavo Massaccesi
2015-03-01 22:57:47 UTC
Permalink
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
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
Post by Jukka Tuominen
Thank you Eric,
I appreciate the principle. I got it working now without violations.
br, jukka
Post by Eric Dong
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
Post by Jukka Tuominen
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
Post by Jukka Tuominen
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
Post by Jukka Tuominen
remove the .zo file though...
br, jukka
____________________
http://lists.racket-lang.org/users
____________________
http://lists.racket-lang.org/users
____________________
http://lists.racket-lang.org/users
____________________
http://lists.racket-lang.org/users
____________________
Racket Users list:
http://lists.racket-lang.org/users
Jukka Tuominen
2015-03-01 23:39:23 UTC
Permalink
I've been planning to create #lang liitin at some point, although I'm a
bit hesitant whether this makes sense outside Liitin account. In addition
to having the environment all set up for you, the idea is to make sure
that the code is compatible between users and endures time. There are just
too many things moving in their own directions in the conventional
operating systems and even within Racket alone. What it could do though,
is to allow access to the permanent storage and remote computation and
such.

And yes, the problem with the initial interactions window remains.

br, jukka
Post by Gustavo Massaccesi
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
---
Welcome to DrRacket, version 6.1.1 [3m].
Language: racket [custom].
Post by Gustavo Massaccesi
(+ 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
Post by Gustavo Massaccesi
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
Post by Jukka Tuominen
Thank you Eric,
I appreciate the principle. I got it working now without violations.
br, jukka
Post by Eric Dong
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
Post by Jukka Tuominen
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
Post by Jukka Tuominen
If I want to ensure that certain libraries get automatically
included
Post by Jukka Tuominen
(required) in the initial racket/gracket/drracket environments,
where
Post by Jukka Tuominen
should I add them?
I tried /racket/collects/init.rkt but that didn't seem to work. I
didn't
Post by Jukka Tuominen
remove the .zo file though...
br, jukka
____________________
http://lists.racket-lang.org/users
____________________
http://lists.racket-lang.org/users
____________________
http://lists.racket-lang.org/users
____________________
http://lists.racket-lang.org/users
____________________
Racket Users list:
http://lists.racket-lang.org/users

Loading...