Keyword inputs and outputs #4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This proposal introducing keyed inputs and outputs.
The example from the
Source
section in the design document transformed to fit this:Notes
This'd take the
masked
output ofmask
and use it as thedivisor
input ofdiv
.Pros
Cons
Questions
Keyword inputs and outputs?to Keyword inputs and outputsYeah, makes sense.
However, I'd treat outputs as lists so one could also split an array like this:
That's however impractical, if we want full static typing so we probably should differentiate between static and variable length lists... potentially tuples, so we can easily destructure them?
The splitting and combination syntax is kinda a headache in general, and i think we should on a type level only allow single inputs and outputs in an operator/command/modifier (though, of course with syntactic sugar for lists/tuples to simplify?)
Why exactly? Then we'll just end up using lists, dictionaries or structs for commands that do need multiple inputs (e.g. add/sub/mul/div/mod).
What would be a usecase for splitting a list like this?
Also this again introduces the problem of not knowing which index refers to what semantic output. Take the
mask
operation for example, which could return the masked part and the rest (the unmasked part).From @schrottkatze in #2:
We'd need a type system before we could implement this then.
I will take care of that ASAP, it's just that i'm horrible in thinking in documentation and rather just implement something and get it working and improve that and then document it, so that effectively depended on your work ^^'
"ASAP" is definitely not necessary, lol. Do it anytime you want. And if you figure out that you don't, then we'll think of something else.