Liste des Groupes | Revenir à co vms |
On 8/20/2024 8:36 AM, Simon Clubley wrote:On 8/20/2024 6:47 AM, Arne Vajhøj wrote:One thing I wish was available in all languages is the ability to return
multiple values from a function call so you can return both a status and
the value(s) in one assignment. Ie: "a, b, c = demo_function(param1, param2);".
>
In languages with dynamic associative arrays (such as PHP), I simulate
this by returning an associative array from a function call with both
status and value fields. Makes coding _so_ much cleaner and robust.
Few languages support multiple return values.This is one of the many reasons I like PERL.
And a few other languages support tuples with named fields
or anonymous classes with named properties, which is almost as good.
And almost all newer high level languages support map/dictionary/associative array.
Les messages affichés proviennent d'usenet.