WurstScript icon indicating copy to clipboard operation
WurstScript copied to clipboard

FR: automatically derive to/from index for trivial tuple-types

Open Cokemonkey11 opened this issue 4 years ago • 0 comments

Here is an example:

public tuple instant(real timestamp_seconds)

public function instantToIndex(instant inst) returns int
    return realToIndex(inst.timestamp_seconds)

public function instantFromIndex(int index) returns instant
    return instant(realFromIndex(index))

Only saves 4 lines of code to automatically derive this, but would be nice!

Cokemonkey11 avatar Mar 20 '21 14:03 Cokemonkey11