Skip to content

Instantly share code, notes, and snippets.

@rossabaker
Forked from paulosuzart/gist:413430
Last active September 7, 2025 04:35
Show Gist options
  • Save rossabaker/413448 to your computer and use it in GitHub Desktop.
Save rossabaker/413448 to your computer and use it in GitHub Desktop.
migrated to paste.rossabaker.com
@paulosuzart
Copy link

I think the param names are less important, since the action will perform some operation over the closure parameters. But the params order yes, can be meaningful. Annotation can be expensive and annoying. Can a simply convetion solve this?

The convention could be option. People would decide to explicit the parameters or grab them using params(..). :)

@rossabaker
Copy link
Author

We need to be sure that it doesn't conflict with the existing routing syntax. If the closure takes parameters, then that could trigger the by-position mapping -- I think that would work.

@paulosuzart
Copy link

Perfect!
:? Does not blur the closure parameter names with request path parameters.
Of course, this way one cannot use params("?") at the same time of passing params to the closure. Nice.
Hope the idea to be useful.

@rossabaker
Copy link
Author

Yes, this is definitely a feature that we would like to add. Thanks for the idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment