On Thu, Apr 7, 2011 at 11:11 PM, Terry Brown <[email protected]> wrote:

>> @x {
>> import os
>> print "many"
>> print "lines"
>>
>> @x }
>
> g is available in @x block, I assume?

Plan is to expose c,p,g there. Didn't do it yet (turns out having 1.8
yo son makes you busy).

> Does
>
> @x {
>
> g.vs.dirs = {'N':0, 'E':90, 'S':180, 'W':270}
>
> @x }
>
> work?

That will work soon, but now you can just do

dirs = {'N':0, 'E':90, 'S':180, 'W':270}

This is because @x blocks are executed so that g.vs is the global
namespace (i.e. as if you had entered everything in the vs.py module).


> And when you say g.vs namespace persists, for what timescale?  Session
> or forever or?

Just session. To persist stuff you would probably use c.db['foo'] = 12
or g.app.db.


> And would
>
> @x =projA.left {
>
> stuff on
> the left
>
> @x }
>
> @x =projB.left {
>
> gone already
>
> @x }
>
> store things in g.vs.projA.left and g.vs.projB.left?  Maybe this only
> matters if persistence is long term.

Yes, it would. If you check out valuespace stuff in contrib branch, it
does this.

You would have to do

@x {
projA = Bunch()
}
earlier in the tree though.

> And if persistence is long term, is g.vs shared between different
> outlines?

g.app.db is shared between leo processes (by virtue of being PickleShareDB.

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to