![]() |
Function arguments with default values
You know what would be *really* awesome? If you could define a default value to function arguments, Python style.
PHP Code:
Can haz plz? :cry: |
Graal just treats undefined variables as null, so why not just do something like this?
PHP Code:
|
Quote:
|
Better yet, || and && shouldn't return boolean, but rather the last-evaluated operand:
PHP Code:
e2: Actually, if || and && are using the same optimization as here, that would have to change for this to make any sense. But perhaps we could just have ||= and &&= PHP Code:
|
All times are GMT +2. The time now is 06:16 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.