Strc hides the output of the C compiler if there is no error, which is a bit of a problem, since the C compiler is currently the only way in which an incorrect order of strategy arguments is reported.
Example:
--------------------------------------
module foo
imports list-cons
strategies
main =
foo(ho(![]))
strategies
foo(arg: (t -> t) * t -> t) =
arg(![])
strategies
ho(s) =
s
--------------------------------------
--------------------------------------
martin@linux:~> strc -i foo.str
[ strc | info ] Compiling 'foo.str'
[ strc | info ] Front-end succeeded : [user/system] = [0.41s/0.92s]
[ strc | info ] Optimization succeeded -O 2 : [user/system] = [0.01s/0.10s]
[ strc | info ] Back-end succeeded : [user/system] = [0.19s/0.23s]
[ strc | info ] C compilation succeeded : [user/system] = [0.30s/0.14s]
[ strc | info ] Compilation succeeded : [user/system] = [0.91s/1.39s]
martin@linux:~>
--------------------------------------
Only at verbosity level 2, the output of the C compiler is reported:
--------------------------------------
[ strc | notice ] Compiling C code
[ strc | notice ] Command: gcc -I /pkg/strategoxt/2005-12-12-16-32/include -I /pkg/strategoxt/2005-12-12-16-32/include -I /home/martin/.nix-profile/include -c foo.c -o foo.o
foo.c: In function `main_0_0':
foo.c:23: warning: passing arg 1 of `foo_1_0' from incompatible pointer type
[ strc | notice ] Linking object code
--------------------------------------
Possible solutions:
* pass -Werror the C compiler
* implement a type-checker for the order of strategies in Stratego (and base the renaming on information produced by this type checker)
----
main = l3(l2)
l0 = !5
l1(s0 : a -> a) = s0
l2(s1 : (a -> a) * a -> a) = s1(l0)
l3(s2 : ((a -> a) * a -> a) * a -> a) = s2(l1)
----
Replacing the last def with:
l3(s2 : ((a -> a) * a -> a) * a -> a) = s2(l1(!6))
should fail to compiler. Even if it succeeded, it should still give the result 5, but the standalone compiler will swallow this code silently, and erroneously result in the term 6.