The file test.input contains the following lines from the manual
on acceptable (indented) if-then-else expressions:
cat test.input:
if 1 > 0 then output("positive") else output("nonpositive")
if 1 > 0 then output("positive")
else output("nonpositive")
if 1 > 0 then output("positive")
else output("nonpositive")
if 1 > 0
then output("positive")
else output("nonpositive")
if i > 0
then output("positive")
else output("nonpositive")
Except for the first one-liner, the remaining ones give syntax errors:
(1) -> )r test
if 1 > 0 then output("positive") else output("nonpositive")
positive
if 1 > 0 then output("positive")
positive
else output("nonpositive")
Line 4: else output("nonpositive")
A
Error A: Improper syntax.
1 error(s) parsing
Continuing to read the file...
if 1 > 0 then output("positive")
positive
else output("nonpositive")
Line 7: else output("nonpositive")
A
Error A: Improper syntax.
1 error(s) parsing
Continuing to read the file...
if 1 > 0
Line 8:
Line 9: if 1 > 0
.......A
Error A: syntax error at top level
Error A: Possibly missing a then
2 error(s) parsing
Continuing to read the file...
then output("positive")
Line 10: then output("positive")
A
Error A: Improper syntax.
1 error(s) parsing
Continuing to read the file...
else output("nonpositive")
Line 11: else output("nonpositive")
A
Error A: Improper syntax.
1 error(s) parsing
Continuing to read the file...
if 1 > 0
Line 12:
Line 13: if 1 > 0
.......A
Error A: syntax error at top level
Error A: Possibly missing a then
2 error(s) parsing
Continuing to read the file...
then output("positive")
Line 14: then output("positive")
A
Error A: Improper syntax.
1 error(s) parsing
Continuing to read the file...
else output("nonpositive")
Line 15: else output("nonpositive")
A
Error A: Improper syntax.
1 error(s) parsing
Continuing to read the file...
(4) ->
Thanks,
SWA
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/70970dfe-7750-4125-86b0-4924757498a2n%40googlegroups.com.