You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like the . syntax more than _. though.
Imo, _ should be used for placeholders and unused variables only.
I'm in favor of allowing arbitrary piping (see #13) using a syntax like:
b |> foo (a, _, c)
In that case, _ is clearly a placeholder and not to be used as a variable.
That is if we even decide to push that proposal further.
Anyway, this would also become possible:
fn foo (a: i32, _: i32, c: i32) -> i32 = a + c
This use of _ could be nice if a specific function prototype is technically required but not actually used, which is likely to happen in situations using FFI, interface patterns, etc.
That would also work of course. Not sure if it's a good idea consistency-wise though. Mixing typed parameters and just types seems like a weird thing to do. Kinda hurts readability imo.
Test case:
The text was updated successfully, but these errors were encountered: