Re: Closures in leu of pointers?

2013-06-29 Thread cts . private . yahoo
No, actually, it's okay that it's local by default, after all. TCL's got that capability of explicitly specifying the scope (up n or something like that?). That's okay for tcl, not sure if it would seem so elegant for python. But you can't tell me that the scenarios that I presented in the be

Re: Closures in leu of pointers?

2013-06-29 Thread cts . private . yahoo
Touchy aren't we ... :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Closures in leu of pointers?

2013-06-29 Thread cts . private . yahoo
exactly that. Without wanting to analyze it in too much depth now, I would want a local keyword to allow me to know I was protecting my variables, and a way to specify other scopes, without so much implied scoping in non-intuitive ways... Now everybody is gonna tell me how wrong I am, but you

Re: Closures in leu of pointers?

2013-06-29 Thread cts . private . yahoo
:) Thank you guys for saying what I was biting my tongue about (thanks everybody for the help, BTW!). This "python-think" stuff was starting to get on my nerves - but then it occurred to me that - although having many powerful features - it has so many weird restrictions that it requires a spe

Re: Closures in leu of pointers?

2013-06-29 Thread cts . private . yahoo
I love the title. Reminds me of Ivanhoe ... great time travel. -- http://mail.python.org/mailman/listinfo/python-list

Re: Closures in leu of pointers?

2013-06-29 Thread cts . private . yahoo
"PS: If you're reading this and love the French language -- I am deeply sorry for the pain I'm causing you..." It's obviously a team effort... My French ain't so hot, either. I had to google your "tout chez" until I ran into the explanation: hallo :) also ich gucke super gerne two and a half

Re: Closures in leu of pointers?

2013-06-29 Thread cts . private . yahoo
Alas, one reason it's a weak workaround is that it doesn't work - at least, not how I wish it would: $ cat ptrs x = 34 def p1 (a1): a1[0] += 12 p1 ([x]) print (x) $ python ptrs 34 -- http://mail.python.org/mailman/listinfo/python-list

Re: Closures in leu of pointers?

2013-06-29 Thread cts . private . yahoo
Well, it would have been French if I had spelled it right - since you force me overcome my laziness, I see I should have spelled it lieu ... Thank you. You reminded me of the (weak) workaround of using arrays and confirmed my suspicion that I although I can read the variable, I won't be able t

Closures in leu of pointers?

2013-06-29 Thread cts . private . yahoo
Hi, I'd like to use closures to set allow a subroutine to set variables in its caller, in leu of pointers. But I can't get it to work. I have the following test pgm, but I can't understand its behaviour: It uses a function p2() from the module modules.closure1b: def p2 (proc): proc ("d