TokenScript icon indicating copy to clipboard operation
TokenScript copied to clipboard

Handling tuple returns?

Open JamesANZ opened this issue 6 years ago • 5 comments

Many functions return a bunch of parameters. Maybe we should add a tuple type or a way to explicitly write out the variables that are returned.

JamesANZ avatar May 20 '19 06:05 JamesANZ

Have added the tuple type in #162 but it doesn't have a way to interpret the args yet

JamesANZ avatar May 21 '19 01:05 JamesANZ

@colourful-land how about a type with something like this: tuple<[Any]>, similar to Kotlin/swift notation

JamesANZ avatar May 22 '19 02:05 JamesANZ

That means we will have an attribute type that is a tuple. That's a dangerous decision to make (more dangerous than, e.g. if we have an attribute type that is an array) because the consequence is huge. Let's try not to solve it in May.

SmartLayer avatar May 28 '19 01:05 SmartLayer

@colourful-land how about instead of a tuple we simply allow you to explicitly define multiple return args like uint,uint,string etc?

JamesANZ avatar May 29 '19 01:05 JamesANZ

@colourful-land how about instead of a tuple we simply allow you to explicitly define multiple return args like uint,uint,string etc?

Let me observe your compound TokenScript in whole and decide. I don't think we can include this in May release anyway, so I'll prioritize other release showstoppers (like repo server offering action scripts)

SmartLayer avatar May 29 '19 01:05 SmartLayer