user_guide:shell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
user_guide:shell [2019/02/11 16:21] – ↷ Links adapted because of a move operation oroehriguser_guide:shell [2021/01/12 15:55] (current) – [Switching between applications] gawrilow
Line 21: Line 21:
  
 ==== Continuation mode ==== ==== Continuation mode ====
 +
 Each command must be concluded with a semicolon. If you hit ENTER without doing so, polymake supposes that your expression is going to be continued on the next line; you will see this on the changed input prompt, which will contain the continuation number in parentheses. This is useful for typing in conditional blocks or loops over several lines or the input of multi-line constants (e.g. for matrices). You can press Ctrl-C to escape from the continuation mode. Each command must be concluded with a semicolon. If you hit ENTER without doing so, polymake supposes that your expression is going to be continued on the next line; you will see this on the changed input prompt, which will contain the continuation number in parentheses. This is useful for typing in conditional blocks or loops over several lines or the input of multi-line constants (e.g. for matrices). You can press Ctrl-C to escape from the continuation mode.
  
Line 44: Line 45:
   :: appends the commands stored in the given file to the history, rewinds back to the first of them, and turns on the replay mode.  This command is especially useful for making live demos with polymake, as you can prepare and test your input in advance and don't have to waste your time for typing during the presentation.   :: appends the commands stored in the given file to the history, rewinds back to the first of them, and turns on the replay mode.  This command is especially useful for making live demos with polymake, as you can prepare and test your input in advance and don't have to waste your time for typing during the presentation.
      
-Finally, let's mention two [[#Customizing|custom variables]] related to the history handling.+Finally, let's mention two [[user_guide:howto:shell_custom|custom variables]] related to the history handling.
  
   ? ''$history_size''   ? ''$history_size''
Line 50: Line 51:
   ? ''$history_editor''   ? ''$history_editor''
   :: contains the command starting the editor when you call ''history'' The default value is extracted from the environment variables ''VISUAL'' or ''EDITOR''.   :: contains the command starting the editor when you call ''history'' The default value is extracted from the environment variables ''VISUAL'' or ''EDITOR''.
 +
 +===== Most Important Commands =====
 +
 +Precisely speaking, polymake commands are quite normal perl functions, either built-in ones like ''print'' or ''exit'', or specially written for polymake.  As long as you are not concerned about implementation details, you won't feel any difference.  All commands taking arguments may be written in two fashions: with argument list enclosed in parentheses or separated by a blank from the command keyword.  For example:
 +
 +<code>
 +print "dim=", $p->DIM, "\n";
 +print("dim=", $p->DIM, "\n");
 +</code>
 +
 +It's completely up to your taste which fashion to use.  But never forget the trailing semicolon!
 +
 +The first command to learn is ''exit;'' It gets you out from the interactive shell and ends the session, saving all changed objects (those having associated data files) and settings.
 +
 +==== Switching between applications ====
 +
 +Applications are, roughly speaking, collections of object types, functions, and other stuff related to some distinct mathematical subject.  At all times during the interactive session in the polymake shell, there is one //current// application, while other applications are modestly standing on the backstage.  The name of the current application is permanently displayed in the shell prompt.
 +
 +As a matter of fact, the only difference between the current application and the rest is that you can call the functions and object constructors of the former without having to qualify them with the application name as a prefix; however, this is a quite comfortable feature.  When you want to make other application current, you must enter this command: ''%%application "NAME";%%'' To perpetuate your choice for future sessions, you can set the [[user_guide:howto:shell_custom#custom variables|custom variable]] ''$default_application''.
 +
  • user_guide/shell.1549902084.txt.gz
  • Last modified: 2019/02/11 16:21
  • by oroehrig