-
Notifications
You must be signed in to change notification settings - Fork 476
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
Allow passing arguments to dependencies #555
Conversation
I also think the lisp style is the way to go. |
I'm good with either but I'd say the "lowest common denominator" might be the Fortran style. Most languages I've dealt with handle functions in the same manner that you have Fortran listed. Were as the LISP style is similar to calling functions in a subshell. So if your coming from anything other than LISP (and Scheme?) development or shell scripting the Fortran style will be more natural. |
78c8841
to
9aedfad
Compare
@clarfon and @runeimp, thanks for the feedback! I decided to go with the lisp-style, just because it felt more natural, and to make it visually distinct from function invocations. As for duplicate recipe invocations, Just will run every combination of recipe and arguments at most once. For example in: foo: (bar "A") (bar "A")
bar x:
|
I've started working on passing arguments to dependencies, see #289, a longstanding feature request.
Open questions to resolve:
Syntax
Lisp can be pretty incomprehensible, for example:
As opposed to:
However, I think in some sense lisp style is more natural, since recipe invocation on the command line doesn't require parenthesis or commas. At the moment I'm leaning towards lisp style.
Repeat dependency invocations
Just, like Make, will only run a recipe once per invocation, even if it appears multiple times in a dependency tree. For example, given the following,
just bob
will runbar
only once, even thoughfoo
andbaz
both depend on it:However, the situation is complicated by arguments. Consider:
Clear, the user intends to run
build
twice, once for "foo" and once for "bar".I think a reasonable approach would be to run recipes once per recipe and combination of arguments. So given the following justfile,
just release
would runbuild "foo"
,build "bar"
andbuild "baz"
:I can't immediately think of any counter-examples where this behavior wouldn't be desirable, so barring any counter examples, this is what I'll implement.
To Do