proc/Example()
return list(123,321,444)
mob/Login()
var a,b,c = Example()
world << a // 123
world << b // 321
world << c // 444
ID:2958911
![]() Jan 1, 3:23 pm
|
|||||||
| |||||||
Proposed Syntax
|
I think I get the point of this feature request.
They want a proc returning multiple values, and automatically set into multiple variables. So, ideally, we wouldn't want to return a list, but a way to let a proc to return multiple values to calling variables... I am not sure if a dm internal feature would be good for this, but it is partially feasible as a pointer if someone wants a proc doing such. #define set3vars(a, b, c) _set3vars(&a, &b, &c) // this is a handy way to take variables without putting & into proc arguments This is technically not a proc returning, but pointers will be possible to handle multiple variables. Using a list having pointers can be a way. but I am not sure what's worth between pointers v.s. new internal assignment feature |
Currently I do.
proc/ImageColorData(image) While below would save space and help with readability plus it's more logical to look at lol. proc/ImageColorData(image) It could also be utilized in many other situations I would think. Maybe the values returned could be seperated differently such as proc/ImageColorData(image) |
EvilDragonfiend wrote:
I think I get the point of this feature request. What you have is close to out parameters, which (practically) by-ref-ify by-value parameters. What they're asking for is destructuring/unpacking but from a python background, which wraps multiple comma separated returns in an invisible tuple for you :b |
Login to reply.
It's *probably* more trouble than it's worth though. :P