Vocabulary

infix

Syntax

Word description

Parses the infix code inside the brackets, converts it to stack code and executes it.

Examples

[infix isn't that useful by itself, as it can only access literal numbers and no variables. It is designed to be used together with locals; for example with :: :

Definition

infix

Syntax

[infix ... infix]

Word description

Parses the infix code inside the brackets, converts it to stack code and executes it.

Examples

USING: infix prettyprint ;
IN: scratchpad
[infix 8+2*3 infix] .

14

14

[infix isn't that useful by itself, as it can only access literal numbers and no variables. It is designed to be used together with locals; for example with :: :

USING: infix locals math.functions prettyprint ;
IN: scratchpad
:: quadratic-equation ( a b c -- z- z+ )
[infix (-b-sqrt(b*b-4*a*c)) / (2*a) infix]
[infix (-b+sqrt(b*b-4*a*c)) / (2*a) infix] ;
1 0 -1 quadratic-equation . .

1.0 -1.0

1.0 -1.0

Definition

This documentation was generated offline from a
`load-all`

image. If you want, you can also
browse the documentation from within the UI developer tools. See
the Factor website
for more information.

Factor 0.100 x86.64 (2240, heads/master-adff5af2b7, Sep 20 2023 21:16:03)