Legacy named argument syntax?

I noticed that you can declare named arguments with this odd syntax:

def foo(a b)
  p b
end

foo(a: 1)

And this gets used in the stdlib. Is it a legacy feature?

https://crystal-lang.org/reference/syntax_and_semantics/default_values_named_arguments_splats_tuples_and_overloading.html#external-names.

1 Like

Thank you. I have now actually used that, as I was coding an extended delegate method that does argument and return processing (for the new https://github.com/BrucePerens/recursive_generic/ shard) and I wanted to have a named argument called return:.