fn: =
[contents]

Contents

Syntax

The syntax for = calls is:

f++:  
=(variables, value)

n++:  
@=(variables, value)

Description

= is the assignment operator, it takes at least two input parameters, the last parameter should be the value to be assigned and the preceding parameters should be variables to assign the value to.

Note: It is typically faster to use exprtk for assignment operations, plus the syntax is nicer.

Note: Nift will skip to the first non-whitespace (ie. to the first character that is not a space, tab or newline) after a = call and inject it to the output file where the call started. If you want to prevent Nift from doing this put a '!' after the call, eg.:

@=(x, 12)!

Options

The following options are available for = calls:

option description
b or block call follows with a block of text to assign
!pb do not parse block of text with b/block option
f++ parse block with f++
n++ parse block with n++
option description

f++ example

Examples of = being used with f++:

int a=10, b=12
string str="hello, world!"
=(a, $[b])
=(a, b, 14)
=(str, "hello, mars!")

n++ example

Examples of = being used with n++:

@int a=10, b=12
@string str="hello, world!"
@=(a, $[b])
@=(a, b, 14)
@=(str, "hello, mars!")

Sponsors