Liking cljdoc? Tell your friends :D

fif.stdlib.conditional

For the if-else-then fif functionality

For the if-else-then fif functionality
raw docstring

arg-else-tokenclj/s

source

arg-if-tokenclj/s

source

arg-then-tokenclj/s

source

condition-true?clj/s

(condition-true? x)

Determines whether the given value is true or false

Notes:

  • is true if it is a non-zero number
  • is false if it is the number zero
  • is true if (boolean x) is true
Determines whether the given value is true or false

Notes:

- is true if it is a non-zero number
- is false if it is the number zero
- is true if (boolean x) is true
sourceraw docstring

conditional-modeclj/s

(conditional-mode sm)

Primitive if-else-then statements

Implementation Details:

  • entire control structure is placed in a sub-stack stored on the stash. Any inner control structures are processed by inner-conditional-mode

  • after being stored, the flag is processed, the stack machine is placed in either truth-condition-mode (flag was true) or dump-truth-condition-mode (flag was false), and the stashed condition body is placed back in the code queue, and the stash is cleared.

  • while in truth-condition-mode, args are processed naturally until a then statement pops it out of truth-condition-mode

  • while in dump-truth-condition-mode, args are dumped until the else (false condition) is reached, which places the stack machine in false-condition-mode.

Primitive if-else-then statements

Implementation Details:

- entire control structure is placed in a sub-stack stored on the
stash. Any inner control structures are processed by
inner-conditional-mode

- after being stored, the flag is processed, the stack machine is
placed in either truth-condition-mode (flag was true) or
dump-truth-condition-mode (flag was false), and the stashed
condition body is placed back in the code queue, and the stash is
cleared.

- while in truth-condition-mode, args are processed naturally until
a then statement pops it out of truth-condition-mode

- while in dump-truth-condition-mode, args are dumped until the
else (false condition) is reached, which places the stack machine
in false-condition-mode.  

sourceraw docstring

conditional-mode-flagclj/s

source

doc-stringclj/s

source

dump-condition-modeclj/s

(dump-condition-mode sm)

Dumps the code stack, but stops upon reaching the end of the condition body (then).

Dumps the code stack, but stops upon reaching the end of the
condition body (then).
sourceraw docstring

dump-condition-mode-flagclj/s

source

dump-false-condition-modeclj/s

source

dump-false-condition-mode-flagclj/s

source

dump-truth-condition-modeclj/s

(dump-truth-condition-mode sm)

Dumps the code stack, but stops upon reaching an else condition or upon reaching the end of the condition body (then). Nested conditionals are passed to dump-condition-mode.

Notes:

  • This mode is assumed to be a truth content dump, in order to process the false conditional body
Dumps the code stack, but stops upon reaching an else condition or
upon reaching the end of the condition body (then). Nested
conditionals are passed to dump-condition-mode.

Notes:

- This mode is assumed to be a truth content dump, in order to process the
false conditional body
sourceraw docstring

dump-truth-condition-mode-flagclj/s

source

false-condition-modeclj/s

(false-condition-mode sm)

Called when the code queue includes falsy content. This is normally called after the 'else clause.

Called when the code queue includes falsy content. This is normally
called after the 'else clause.
sourceraw docstring

false-condition-mode-flagclj/s

source

import-stdlib-conditional-modeclj/s

(import-stdlib-conditional-mode sm)

Stack Machine imports for if-else-then functionality

Stack Machine imports for if-else-then functionality
sourceraw docstring

inner-conditional-flagclj/s

source

inner-conditional-modeclj/s

(inner-conditional-mode sm)

For handling any inner if-else-then tokens, this tracks and converts them into a representation which won't impede parsing.

Notes:

  • additional nested conditionals are tracked by pushing and popping additional :inner-conditional-mode flags
For handling any inner if-else-then tokens, this tracks and converts
them into a representation which won't impede parsing.

Notes:

- additional nested conditionals are tracked by pushing and popping
additional :inner-conditional-mode flags
sourceraw docstring

start-ifclj/s

(start-if sm)

Word Definition: ? if <truth body> else <false body> then ? if <truth body> then

Word Definition:
? if <truth body> else <false body> then
? if <truth body> then
sourceraw docstring

truth-condition-modeclj/s

(truth-condition-mode sm)

Called when the code queue contains truthy content within the code queue. This is normally at the beginning of the conditional after the 'if clause.

Called when the code queue contains truthy content within the code
queue. This is normally at the beginning of the conditional after
the 'if clause.
sourceraw docstring

truth-condition-mode-flagclj/s

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close