Hi Antti,
The printf function doesn't seem to work. SeExpr outputs its content to stderr, and in Clarisse we just don't display those. We might have to override the native printf SeExpr function to allow printing to the log, but for now it won't work.
As a side node (related to the comments in your code snippet:
In a SeExpr expression, you have 2 distinct parts: the first part where you declare variables. Each line of this part must end with a comma (;)
and the last part, which is the last statement of the expression, and doesn't end with a comma. This last part is what's used as the result of the expression.
So, in your example, here is what happens:
1.
- Code: Select all
# printf returns 0. It's not documented, even in the official SeExpr site (I had to dig in the code to see that)
# So this line gets evaluated to 0, and the expression is valid and has a value of 0:
printf("foo")
2.
- Code: Select all
# Now, if you add a ; at the end, the line becomes a variable definition, and you have a syntax error
# since variables should be defined like this : 'var_name = ... ;'
printf("foo");
3.
- Code: Select all
# To fix the previous error, you just have to make it so that it's a valid variable def:
a = printf("foo");
# now the previous line compiles. And we still need a last statement so that the expression has a value:
42
# or you could just write:
# a
# Since a is a valid variable, which has the value 0 (remember, printf returns 0 in fact)
We'll have to improve our documentation a bit, and in the meantime I hope this explanation answers a few of your questions.
Regards,
Damien.