ForthVM.Words.Logic (ForthVM v0.5.0) View Source

Comparison, logic and bitwise words

Link to this section Summary

Functions

=: ( x y -- bool ) check two values are equal. Works on different types

: ( x y -- bool ) check if x is greater than y

=: ( x y -- bool ) check if x is greater than or equal to y

and: ( x y -- bool ) logical and

<: ( x y -- bool ) check if x is less than y

<=: ( x y -- bool ) check if x is less than or equal to y

<>: ( x y -- bool ) check two values are different. Works on different types

0=: ( x -- bool ) check value is euqal to 0

0>: ( x -- bool ) check if value is greater than zero

0<: ( x -- bool ) check if value is less than zero

Link to this section Functions

Link to this function

b_and(tokens, list, return_stack, dictionary, meta)

View Source

&: ( x y -- v ) bitwise and

Link to this function

b_not(tokens, list, return_stack, dictionary, meta)

View Source

~: ( x -- v ) bitwise not

Link to this function

b_or(tokens, list, return_stack, dictionary, meta)

View Source

|: ( x y -- v ) bitwise or

Link to this function

b_shift_left(tokens, list, return_stack, dictionary, meta)

View Source

<<: ( x y -- v ) bitwise shift left

Link to this function

b_shift_right(tokens, list, return_stack, dictionary, meta)

View Source

: ( x y -- v ) bitwise shift right

Link to this function

b_xor(tokens, list, return_stack, dictionary, meta)

View Source

^: ( x y -- v ) bitwise xor

Link to this function

const_false(tokens, data_stack, return_stack, dictionary, meta)

View Source

false: ( -- bool ) the false constant

Link to this function

const_true(tokens, data_stack, return_stack, dictionary, meta)

View Source

true: ( -- bool ) the true constant

Link to this function

eq(tokens, list, return_stack, dictionary, meta)

View Source

=: ( x y -- bool ) check two values are equal. Works on different types

Link to this function

gt(tokens, list, return_stack, dictionary, meta)

View Source

: ( x y -- bool ) check if x is greater than y

Link to this function

gte(tokens, list, return_stack, dictionary, meta)

View Source

=: ( x y -- bool ) check if x is greater than or equal to y

Link to this function

l_and(tokens, list, return_stack, dictionary, meta)

View Source

and: ( x y -- bool ) logical and

Link to this function

l_not(tokens, list, return_stack, dictionary, meta)

View Source

not: ( x -- bool ) logical not

Link to this function

l_or(tokens, list, return_stack, dictionary, meta)

View Source

or: ( x y -- bool ) logical or

Link to this function

lt(tokens, list, return_stack, dictionary, meta)

View Source

<: ( x y -- bool ) check if x is less than y

Link to this function

lte(tokens, list, return_stack, dictionary, meta)

View Source

<=: ( x y -- bool ) check if x is less than or equal to y

Link to this function

neq(tokens, list, return_stack, dictionary, meta)

View Source

<>: ( x y -- bool ) check two values are different. Works on different types

Link to this function

zeq(tokens, list, return_stack, dictionary, meta)

View Source

0=: ( x -- bool ) check value is euqal to 0

Link to this function

zge(tokens, list, return_stack, dictionary, meta)

View Source

0>: ( x -- bool ) check if value is greater than zero

Link to this function

zle(tokens, list, return_stack, dictionary, meta)

View Source

0<: ( x -- bool ) check if value is less than zero