6. b2mdl_expand

The command-line utility b2mdl_expand reads parametric MDL input and writes non-parametric MDL output. It is intended for debugging and helping to understand the parametric features of MDL.

It is invoked on the shell command line either by giving a filename

$ b2mdl_expand filename

or by using the shell's pipe (|) operator. For example:

$ cat filename | b2mdl_expand 

or

$ echo "(a=2) (b=3) (a**b)" | b2mdl_expand 
8

The latter form, using the shell's echo command, is especially useful for trying out things.

A possible pitfall is the use of quotes (with text strings). The command

$ echo "(a="abc") (a<"def")" | b2mdl_expand 
In file "<stdin>", at line 1: Identifier 'abc' is not defined.

will result in an error, because the shell has interpreted the quotes ("). This can be avoided by using single quotes:

$ echo '(a="abc") (a<"def")' | b2mdl_expand 
true