-
-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
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
deftask list syntax #574
Comments
My 2c: it is interesting but I guess also kind of hard cause if you open that Pandora's box then you also need to parse multi-arity task options. And what happens if I use I have one I guess that would be the most difficult case to handle correctly and frankly I see no big benefit in it. Of course I might be totally wrong here 😀😀 |
I think adding a more helpful error message would be great, but I don't think adding support for multiple arities makes any sense because boot tasks are already fundamentally multi-arity because all options are passed as keyword-style args and most should probably be optional or have sane-defaults. Also, along with what @arichiardi points out, there are other things ( Better error messages are always a good thing though 👍 |
Thanks for the input @arichiardi and @RadicalZephyr! For the record, I wasn't suggesting adding support for multiple arities, just adding support for... (deftask foo
([]
(comp (a) (b)))) ...in addition to... (deftask foo
[]
(comp (a) (b))) ...and perhaps throwing an exception stating " (deftask foo
([]
(comp (a) (b)))
([f foo VAL "..."]
(comp (a) (b) (c)))) You two know the internals of boot way better than I do and are in a much better position to decide if the added complexity is worth it, though. If not, an error message (and perhaps a docstring change to show usage) would be very helpful. 👍 |
👍 for a better error message here, a PR would be most welcome. Thanks for the suggestions. |
Boot is now giving a new error message:
Has this been fixed or do we still want a more descriptive error? |
I think this still needs a PR for the error message |
Does this seem like a decent error message? I hesitate to give an example, because this will apply to all |
What is a clifn? Do you mean a task called from the command line? In that case we can drop I believe. |
@arichiardi deftask calls the |
yes |
It comes from the namespace boot.cli, line 251. There seems to be a clojure.tools.cli, but it appears to be a different thing. However, it's still very possible clifns are only used by deftask. If that's the case, is this a better error message: "Multiple arity format not supported for tasks. Use single arity format. Ex (deftask build [x y ...] ;commands)" |
@micha @alandipert Does the above error message look good? |
@DonyorM yes, I like it, thanks. |
Resolved via #627 |
I prefer to define my single-arity functions the same way I do multi-arity functions. Example:
I did this out of habit on the
deftask
macro......and got this error which was a bit confusing:
Is there any interest in making
deftask
a bit more likedefn
(supporting a list containing the bindings/forms) or adding a more helpful error message?The text was updated successfully, but these errors were encountered: