Rationale behind :
for labeled arguments
#2256
wilkomanger
started this conversation in
Ideas & suggestions
Replies: 1 comment 2 replies
-
It's a mix of being similar to mainstream languages that use let x = some_function(label_a = 30, label_b = 40) is semantically the same as this let label_a = 30
let label_b = 40
let x = some_function(label_a = 30, label_b = 40) Overall there's not much in it. Perhaps if we had thought |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I was wondering what the rationale behind using
:
for labeled arguments is, such as:From what I can tell, Gleam uses
:
as a type bound 'operator' (except for function return types), which doesn't really match the use of the argument labels.It would seem more consistent to use
=
, as withlet
bindings, since in the end you're also assigning a value to a name with labeled arguments. It would look like this:I'm curious what the thought process behind this was!
Beta Was this translation helpful? Give feedback.
All reactions