-
Notifications
You must be signed in to change notification settings - Fork 37
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
input format, ";", ":", ";\" #274
Comments
Yeah, this is a bit of a weird left-over from the days that Cadabra did not use Python for its programming language. If I ever find a few hours of spare time just sitting in a corner, I'll clean this up :-( |
Another related thing: ";" in the beginning of a line produces strange results.
does not work as expected, replacing ";" with ":" or adding space before ";" changes things. |
Potentially related. Running the below script
outputs
So the command "A;" prints two different outputs Ubuntu, Cadabra 2.3.6 (build private dated 2022-01-31) (edit: clearer variable names) |
The first issue is, on second thought, actually intended. The logic is that if you use
That is: set the 'last expression' variable '_' manually. The other issues are now solved in 2248d92 (on the microtex branch, will become master soon). |
The cadabra book says
Lines always have to be terminated with either a “;” or a “:”
.In cadabra2-cli 2.4.2 this works with expressions "a:=something", but not with algorithms.
Algorithm with ":" produces an "invalid syntax" error.
Algorithm with ";" works as expected, with output.
Algorithm without ";" or ":" works without output, but does not modify "_" expression:
Output ('_' contains result of first substitute, not last one):
Adding '\' after
substitute($b=b1$, $b1=b2$);
suppresses output of this line and makes the next line to set "_". This is the only way I found to stack multiple algorithms with using "_" and without producing output.It would be good to have better documentation to understand this behaviour...
The text was updated successfully, but these errors were encountered: