Replies: 3 comments 1 reply
-
Look at #783, essentially there was too little use for it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Typical C3 API would be: fn NodeHandle? my_function(Matrix4x4f* matrix, bool *reversed) my_function() {
// do some business
}
fn void main() {
bool reversed;
NodeHandle node = my_function(&&(Matrix4x4f){}, &reversed)!!;
// or NodeHandle node = my_function(null, &reversed)!!; depending on implementation
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
List{(NodeHandle, Matrix4x4f, bool)} stack;
while(!stack.is_empty()) {
(NodeHandle node, Matrix4x4f mat, bool reversed) = stack.pop()!!;
// do some business
stack.push((node, mat, false));
} I don't understand, why would not a struct or a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Being able to use tuple is very convenient when you don't want to create a full struct to handle return value. For example:
I can return multiple value in a function (I imagine the syntax something like this)
Without it
Another use case I find it useful is to quickly define a state. I often use a stack/queue of tuple to DFS or BFS
Without it
Imagine when I am in the middle of implementing a DFS, I suddenly need a new state I have to go back up and declare a new
List
and manage that list, that will add some friction.Beta Was this translation helpful? Give feedback.
All reactions