l3 - interpret l3 programs


l3 [-f FILE] [-l STATE_LOAD] [-s STATE_SAVE] [-i] [-d] [-h]


The l3(1) command executes l3lang(1) scripts in files and provides an interactive toplevel for expression evaluation via -i.

This command-line version is best used for unattended execution; to fully use l3 requires the graphical interface; see l3gui(1).

3.1. Batch mode

When a FILE argument is present (-f), the FILE is executed. Execution continues until the end-of-file is reached, or an error is encountered. In both cases a state file is produced (either FILE.l3s, or STATE_SAVE from -s) along with whatever output FILE produced.

When a STATE_LOAD argument is given (-l), the state is loaded. This implicitly loads the script FILE that originally produced STATE_LOAD. Then, this original script is scanned and new expressions are executed. Expressions previously executed successfully are not executed again. The final state is written back to STATE_LOAD, or STATE_SAVE if -s was given.

3.2. Interactive mode

When -i is given, any files specified are executed first, and the toplevel started after. If any error occurs, the error is printed and the toplevel is entered immediately, even if unread files remain.

Expressions entered at the toplevel are executed immediately. The expressions are appended to the current FILE if present, otherwise they form a new script. On end-of-file, the the state is saved in one of STATE_SAVE, STATE_LOAD, FILE.l3s, or st.l3s (in that order), and the interpreter exits.

Errors simply cause a return to the toplevel.


—help, -h

Print help and exit.


show program's version number and exit

-h, —help

show this help message and exit

-f FILE, —file=FILE

Execute this script in l3.

-l STATE_LOAD, —state_load=STATE_LOAD

Start l3 from this state file.

-s STATE_SAVE, —state_save=STATE_SAVE

Save l3 state to this file.

-i, —interactive

Go to Python console on exit. This allows moving between Python and l3. To restart, use l3.run()

-d, —developer

Import all l3 modules (from … import *) when using -i. Allows for interactive Python code updates.


L3HOME The path to the l3 installation root.


l3lang(1), l3gui(1).


Michael Hohn, mhhohn@users.sf.net


Copyright © 2004-8 Lawrence Berkeley National Laboratory

l3 is released under the BSD license. See license.txt for details.