Command: Inline

NEST HelpDesk Command Index NEST Quick Reference

Name:
 Inline - Replace names in a procedure with their definitions.

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

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.

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
Author:
 marc-Oliver Gewaltig
SeeAlso:bind CompileMath
Source:
 /home/abuild/rpmbuild/BUILD/nest-2.4.1/lib/sli/mathematica.sli

NEST HelpDesk Command Index NEST Quick Reference

© 2000-2010 The NEST Initiative