The above script will output 3. By declaring $a and $b global within the function, all references to either variable will refer to the global version. There is no limit to the number of global variables that can be manipulated by a function.
Name:
python is fucking shit2012-02-21 8:31
a = 1
b = 2
def Sum():
global a, b
b = a + b
Sum()
print b
The above script will output 3. By declaring a and b global within the function, all references to either variable will refer to the global version. There is no limit to the number of global variables that can be manipulated by a function.
The above script will output 3. By using a and b within the function, all references to either variable will refer to the global version. There is no limit to the number of global variables that can be manipulated by a function.
>>4
D allows you to write extremely fast and responsive forum software, see for yourself how nice does it feel: http://forum.dlang.org/
Besides attracting more users (according to Google, the difference between 0.9s and 0.4s page load time results in 20% difference in traffic [1]), using D instead of PHP will literally save you money in hardware and maintenance costs, especially if you are using solutions like Amazon AWS.
Plus, D has a powerful type system which allows for much faster development: a bug caught at compile time costs 10x less to fix than one caught by unittests, 100x less than one caught immediately after deployment, and 1000x less than one caught during normal operation. Statically-enforced protection from all kinds of injections is simply priceless.
The above script will output 3. By using a and b within the function, all references to either variable will refer to the global version. There is no limit to the number of global variables that can be manipulated by a function.