sharing context/variables between multiple playgrounds

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

sharing context/variables between multiple playgrounds

Peter Uhnak
Hi,

is there a way to share context/variables between multiple playgrounds?

E.g. in Playground window 1 I declare

```
factor := 70.
```

and in Playground window 2 I do (without declaring `factor`)

```
5 * factor. "-> 350"
```


Thanks,
Peter

Reply | Threaded
Open this post in threaded view
|

Re: sharing context/variables between multiple playgrounds

Pavel Krivanek-3
In that cases I simply make them global.

-- Pavel

2017-08-07 10:16 GMT+02:00 Peter Uhnak <[hidden email]>:
Hi,

is there a way to share context/variables between multiple playgrounds?

E.g. in Playground window 1 I declare

```
factor := 70.
```

and in Playground window 2 I do (without declaring `factor`)

```
5 * factor. "-> 350"
```


Thanks,
Peter


Reply | Threaded
Open this post in threaded view
|

Re: sharing context/variables between multiple playgrounds

Tim Mackinnon
In reply to this post by Peter Uhnak
I mentioned this a while back 2, less between different playground windows, but more when you drill down on a value in a playground and then want to use a value on the first pane. There was some discussion about this (Denis had some good ideas), and it seemed like a good idea but something to put on the todo list to implement and propose.

Tim

> On 7 Aug 2017, at 09:16, Peter Uhnak <[hidden email]> wrote:
>
> Hi,
>
> is there a way to share context/variables between multiple playgrounds?
>
> E.g. in Playground window 1 I declare
>
> ```
> factor := 70.
> ```
>
> and in Playground window 2 I do (without declaring `factor`)
>
> ```
> 5 * factor. "-> 350"
> ```
>
>
> Thanks,
> Peter
>


Reply | Threaded
Open this post in threaded view
|

Re: sharing context/variables between multiple playgrounds

Offray Vladimir Luna Cárdenas-2
In reply to this post by Peter Uhnak

Hi,

I have been thinking in a similar problem for Grafoscopio. In that way, we could have the same persistence among playgrounds in a similar way to Jupyter's persistence among code cells. My bet would be on using the playground bindings that you get when it is executed. In Grafoscopio's case, I'm thinking in storing a them into some kind of ordered set that is available to all notebook nodes... still these are early thoughts and I don't like that the bindings only operate when you have not defined the variable between bars... see screenshot below.

So, to add to Peter's question:

- There is any way to access not only variables bindings in a playground, but all variables that are declared there, once it is executed?

- How can tap into the playgrounds self-completion behavior, so it can read variable names stored in a particular place?

Thanks,

Offray


On 07/08/17 03:16, Peter Uhnak wrote:
Hi,

is there a way to share context/variables between multiple playgrounds?

E.g. in Playground window 1 I declare

```
factor := 70.
```

and in Playground window 2 I do (without declaring `factor`)

```
5 * factor. "-> 350"
```


Thanks,
Peter



Reply | Threaded
Open this post in threaded view
|

Re: sharing context/variables between multiple playgrounds

Sean P. DeNigris
Administrator
In reply to this post by Pavel Krivanek-3
Pavel Krivanek-3 wrote
> In that cases I simply make them global.

It seems that a variable defined with a capitalized name in an inspector is
still local. How do you make it global? Something like: `Smalltalk globals
at: #MyVar put: expression`?



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: sharing context/variables between multiple playgrounds

Marcus Denker-4

> On 31 Aug 2017, at 17:46, Sean P. DeNigris <[hidden email]> wrote:
>
> Pavel Krivanek-3 wrote
>> In that cases I simply make them global.
>
> It seems that a variable defined with a capitalized name in an inspector is
> still local. How do you make it global? Something like: `Smalltalk globals
> at: #MyVar put: expression`?
>

Yes, there was a discussion about fixing the inspector…

I have a fix… but not yet the time to integrate it:

https://pharo.fogbugz.com/f/cases/20254/Playground-should-ask-to-create-class-for-non-Existing-Globals

        Marcus