We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@||
It would be useful to be able to define function objects in Koto.
This could be achieved by adding a @|| meta key that can be defined in Maps, which would then allow the map to be treated as a function.
Map
e.g.
my_function = @||: || 42 my_function_with_args = @||: |x, y| x + y my_instance_function = data: [1, 2, 3] @||: |self| self.data print my_function() # 42 print my_function_with_args 2, 3 # 5 print my_instance_function() # [1, 2, 3]
The text was updated successfully, but these errors were encountered:
@()
Implemented in #197.
Sorry, something went wrong.
No branches or pull requests
It would be useful to be able to define function objects in Koto.
This could be achieved by adding a
@||
meta key that can be defined inMap
s, which would then allow the map to be treated as a function.e.g.
The text was updated successfully, but these errors were encountered: