diff --git a/docs/@call.md b/docs/@call.md index 28a64a2..9cac358 100644 --- a/docs/@call.md +++ b/docs/@call.md @@ -1,9 +1,36 @@ # @call + +## Naming: `@call` vs `@calls` + +TODO ## Do we allow both `@call` and `@depends_on` on the same level? + +```shell +@goal a +@call b +@depends_on c +``` + +We could but the execution model would be this (`@depends_on` go first): +```shell +@goal a +@depends_on c +"$MAKESURE" b +``` + +Answer: No, should result in error in the first iteration. + +## Do we allow both `@call` and non-empty goal body? + +```shell +@goal a +@call b + echo 'a body' +``` -No, should result in error +Should be relatively easy. ## Do we allow `@call goal_name @args 'arg'`? @@ -29,6 +56,26 @@ Maybe, but let's do the easiest for the first iteration In the first iteration let's not generate a subtree. +## `@call` operational semantics + +Let's implement the simplest strategy of passthrough to `./makesure` invocation + +```shell +@goal a +@call b +``` + +desugars to + +```shell +@goal a +"$MAKESURE" [--define ...] b +``` + +Do we need `--file 'path/to/Makesurefile'`? + +No. Even if we run `./makesure path/to/Makesurefile` path resolution is relative to the `Makesurefile` location, so internal makesure invocation now doesn't need explicit Makesurefile reference. But let's add a test for this case. + ## the `@define` inheritance Since we implement this in terms of running the external `./makesure` we need to repeat the variables passed via `-D`. @@ -62,10 +109,10 @@ desugars to echo "a2: $A" @define b - "$MAKESURE" -D A="$A" a1 - "$MAKESURE" -D A="$A" a2 + "$MAKESURE" --define A="$A" a1 + "$MAKESURE" --define A="$A" a2 @define c - "$MAKESURE" -D A="$A" a1 - "$MAKESURE" -D A="$A" a2 + "$MAKESURE" --define A="$A" a1 + "$MAKESURE" --define A="$A" a2 ```