callable object arguments - functions take the simmer env as an argument #252
tomjemmett
started this conversation in
Ideas
Replies: 1 comment 5 replies
-
I prefer explicit over implicit, but if the implementation doesn't break current functionality, this is something we could look into. I'm not sure whether this could work with things like |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If we want to use a function like
get_selected()
ornow()
we need to have access to the simmer environment, for example:this isn't pipe friendly, so one approach is to create a function to replace add_generator, e.g.
as far as I can see, all of the functions like log_ (in this example) which can take a function for the
value
arguments have no arguments - if instead these functions were to have as their first argument the current simmer environment we could have much neater code, e.g.this could cause problems for existing code, but a check to see whether the argument is a function with 0 arguments or not could solve this, e.g.
is this something that would be a good addition to
{simmer}
?Beta Was this translation helpful? Give feedback.
All reactions