Inline

Command: Inline


Synopsis

{proc} <> Inline -> {proc'}

File
lib/sli/mathematica.sli
Parameters

{proc} - procedure to be transformed
<> - dictionary with names and definitions for the names to be inlined.
{proc'} - the transformed procedure with all names replaced.

Author
marc-Oliver Gewaltig
Description


Transform the input procedure {proc} such that all names that are
defined in <> are placed by their definitions.

Inline can be used to inline the code of procedures or to replace
names of constants with their literal values. All names that are not
defined in <> are unchanged.

Inline is particularly useful in combination with CompileMath.

Inline is similar to bind but there are two big differences:
1. bind uses the current dictstack to determine which names are placed.
2. bind only replaces names that refer to C++-functions or tries.

Examples

SLI ] {a b add} <> Inline ==
{1 2 add}

SLI ] {1 2 3 stack} << /stack dup load >> Inline ==
{1 2 3 0 1 -count- 3 -sub_ii- /{-index- =} -for-}

Version: January 19 2008

SeeAlso