foolang
foolang copied to clipboard
association syntax: key -> value
key -> value --> Association from: key to: value
Implement as operator or syntax?
Pro syntax:
- Cannot be overridden
-
{ a -> x }
is a dictionary -
->
is already syntax in method signatures - Support for destructuring possible:
dict do: { |a -> b| ... }
Pro operator:
- less syntax, less special casing
-
{}
syntax is already wrought
Current thinking: syntax. Mainly because ->
is already syntax instead of an operator.
But why is association syntax needed in the first place? ...that's a really good question. Maybe it's not needed right now after all.