top of page
The environment

As with any other shell, marcel has environment variables. In Python terms, these variables exist in a Python namespace that is made available to marcel commands. So, for example, you can examine the value of the HOME variable as follows:

Screenshot from 2020-08-14 09-41-10.png

The parentheses delimit the Python expression HOME. That symbol is located in marcel's namespace (the environment), and the value is printed.

You can create or modify environment variables by using conventional assignment syntax. The following example assigns the integer 123 to the variable x, and then prints out the value of the variable.

Screenshot from 2020-08-14 09-46-30.png

Your environment variables can store structured types too. For example, you can assign a list:

Screenshot from 2020-08-14 09-49-25.png

[1, 'two', 4-1] is a list, and by enclosing this expression in parentheses, the value of the list can be assigned to the variable x.

Some Python types, like lists, can be modified, and this can be done through marcel. For example, to append to x's list:

Screenshot from 2020-08-14 09-51-47.png

Finally, environment variables can be deleted:

Screenshot from 2020-08-14 10-03-27.png
bottom of page