"Rudy Rudolph" <[EMAIL PROTECTED]> writes:

>     def f(inout param):
>         param += 5
>         return "this is my result"
>
>     # call it
>     x = 2
>     result = f(x)
>     # x is now 7

In a dynamically typed language it's not going to work unless both
the parameter in the function definition and the actual argument are
marked. Then it's easy, well-defined, and can even support other
"lvalues", e.g.:

def f(ref x):
   x += 1
f(ref a[g()])
# g() is executed once
# reading x does __getitem__
# setting x does __setitem__

I'm not judging whether it's worth having, only how it should work if
supported.

-- 
   __("<         Marcin Kowalczyk
   \__/       [EMAIL PROTECTED]
    ^^     http://qrnik.knm.org.pl/~qrczak/
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to