Input-output

MAGMA is entirely a command-line driven interface. There are no mouse buttons or pop-down menus or graphics in MAGMA.

You will notice that most MAGMA commands have a lot of capital letters (like GAP and MATHEMATICA but unlike MAPLE). If you, like me, tend to forget to capitalize a letter occuring in the middle of a command MAGMA will be completely unforgiving. I may have sympathy for you but MAGMA will not!

The syntax of MAGMA is not as ``loose'' as MAPLE's, in some sense. However, there are some similarities. For example, each command must end in a ;, as in MAPLE (though MAPLE allows : as well).

One difference is that MAGMA will not print an output if you enter a command which simply defines a variable. For example, >a:=2+3; will not have any output displayed, unlike MAPLE (which will print out a:=5). As you might expect, if you next simply type >a;, MAGMA (and MAPLE) will output 5. Similar to MAPLE, MAGMA has a command called SetVerbose which prints out more detailed outputs, but we shall not consider that here.

Usually, if you enter a command with poor syntax, MAGMA will simple issue an error message and then wait for your next command. Sometimes, if you forget to enter a ;, MAGMA will simply not respond or it will give you an error message after the next command. In this respect, it might be a bit nicer than GAP (if you've ever dealt with it) but similar to MAPLE.

command-line history Here's a very handy feature, expecially when correcting typos or re-entering commands. MAGMA not only has a command line history but you can look up any command you typed by its first few letters. For example, suppose you type

>a:=2;
>b:=3;
>c:=4;
>d:=5;
Now hit the up arrow key at the next > prompt. MAGMA will automatically enter the previous command >d:=5;. If you hit the up arrow key twice, MAGMA will automatically enter the command >c:=4;. If you type >a (do not hit return) and then hit the up arrow key, MAGMA will automatically enter the previous command which started with an a, namely >a:=2;.

Comments in MAGMA are either multi-line and have /* to begin and */ to end, or are single line and follow //. For example, in

>a:=2+3; //this defines a
>b:=3*a; /* this
>c:=b^2; defines b*/
> c;

>> c;
   ^
User error: Identifier 'c' has not been declared or assigned
> b;
15
MAGMA will ignore the definition of $ c$, hence the error, but computed $ a,b$.

To stop a MAGMA command from executing after it is entered (say it is taking more time that you want to wait for it to finish), type CTL-c. This will sometimes exit MAGMA as well.

To quit MAGMA, type CTL-d or quit;.



Subsections

David Joyner 2007-09-03