| Global Index | ||||
|---|---|---|---|---|
| Accrue | conde | doskip | for-every | pif |
| arguments | do-if | dotimes | forline | static |
| case | do-ifn | every | forstep | unless |
| cfor | do-with-data | export | fortype | yield |
| cond | doall | filter | map | |
| Function: Accrue | Top | Globals Index | Next |
|
syntax: Accrue <any-type-start> <series> <function> description: Accumulates values in a block by successively applying the function to each value in Series. example: Accrue 0 [1 2 3 4 5] :+ ==>> 15 Function: takes two parameters, Accumulator and Item. |
| Function: arguments | Top | Globals Index | Back | Next |
|
syntax: arguments <functions> description: Returns the arguments of the function as a block of word! values. |
| Function: case | Top | Globals Index | Back | Next |
|
syntax: case <block-of-cases> Find a condition and evaluates what follows it. Refinement: /default Default case if no others are found. |
| Function: cfor | Top | Globals Index | Back | Next |
|
syntax: cfor <init-block> <test-block> <increment-block> <code-block> description: C-like for function. example: cfor [i: 1] [i <= 2000] [i: i + i] [print i] |
| Function: cond | Top | Globals Index | Back | Next |
|
syntax: cond <block-of-conditions-and-code> description: Control block to process one of logical true. No default block. |
| Function: conde | Top | Globals Index | Back | Next |
|
syntax: conde <block-of-conditions-and-code> <block-default> description: Control block to process one of logical true. Default block. |
| Function: do-if | Top | Globals Index | Back | Next |
|
syntax: do-if <word> <code-block> Evaluate code block if word has a value. |
| Function: do-ifn | Top | Globals Index | Back | Next |
|
syntax: do-ifn <word> <code-block> Evaluate code block if word has none value. |
| Function: do-with-data | Top | Globals Index | Back | Next |
|
syntax: do-with-data <block-cases> description: Evaluates any code following any expression that evaluates to true by the has-data? test. **see docs for has-data?** description: Accumulates return values of code (if set). description: Returns a block if at least one code set is evaluated. description: If no code block is evaluated, returns false. Note: Block returned may be empty if all code blocks evaluated return unset values. |
| Function: doall | Top | Globals Index | Back | Next |
|
syntax: doall <word> <start-index> <code-block> Like foreall, but cumulative description: Evaluates a block for every value in a series. Accumulates results. Return: results, Resets block. needs: starting point of 0 or greater. refinement: /full add none results |
| Function: doskip | Top | Globals Index | Back | Next |
|
syntax: doskip <series-word> <skip-num> <start> <code-block> cumulative forskip description: Evaluates a block for periodic values in a series. return: Accumulated results, resets word to head. refinement: /full accumulate none values |
| Function: dotimes | Top | Globals Index | Back | Next |
|
syntax: dotimes <int-series-none-logic-control> <code-block> description: Evaluates a block a specified number of times, value or length of control. If control is logic or none, do nothing |
| Function: every | Top | Globals Index | Back | Next |
|
syntax: every <block-of-cases> description: Evaluates any code following any expression that is not FALSE or NONE. description: Accumulates return values of code (if set). description: Returns a block if at least one code set is evaluated. description: If no code block is evaluated, returns false. description: Block returned may be empty if all code blocks evaluated return unset values. |
| Function: export | Top | Globals Index | Back | Next |
|
syntax: export <block-of-words> Export local words in the global context. refinement: /to Export to this object instead of SYSTEM/WORDS |
| Function: filter | Top | Globals Index | Back | Next |
|
syntax: filter <function> <series> Filter a block. note: Filtering function must return true for element that should be selected. |
| Function: for-every | Top | Globals Index | Back | Next |
|
syntax: for-every <blk> <code-block> Description: Evaluates a block for each value(s) in one or more series values. A multiple foreach. example: for-every[val vals label labels rj rjs][ do-code] where the first of each pair is an auto-generated pointer and the second is a previously-defined series. |
| Function: forline | Top | Globals Index | Back | Next |
|
syntax: forline <line> <file-str> <code-block> For each line in file do code refinement?: /nobuffer use unbuffered for speed |
| Function: forstep | Top | Globals Index | Back | Next |
|
syntax: forstep <word-block> <skip-num> <code-block> cumulative foreach description: Evaluates a block for periodic values in a series. breaks: if number of elements remaining are less than skip-num Note: Block is reset to head when done. refinement: /even Throw error if length of word not aligned to skip-num refinement: Do nt add none values |
| Function: fortype | Top | Globals Index | Back | Next |
|
syntax: fortype <type-datatype> <block> <function> Description: Evaluate a function for each value of a given datatype in a block example: fortype word! to-block words func [word][set/any in dest word get/any word] |
| Function: map | Top | Globals Index | Back | Next |
|
syntax: map <function-series> <function-series> description: Maps or applies a function to all elements of the series. refinement: /only Inserts the result of the function as a series. refinement: /full Do not ignore none! value. refinement: /with <sep> insert between elements of the series. If block, alternate elements |
| Function: pif | Top | Globals Index | Back | Next |
|
syntax: pif <block> Polymorphic If: lazy evaluation, no default (use True guard instead). description: If/Either compatibility: guard checking (unset not allowed), non-logic guards allowed, block checking (after a guard only a block allowed), computed blocks allowed Return working, Exit working, Break working |
| Function: static | Top | Globals Index | Back | Next |
|
syntax: static <vars-block> <function> description: Create function with block of static vars with initial values example: count: static [n: 0] does [n: n + 1] example: factorial: static [] func [n][either n < 2 [1][n * self n - 1]] |
| Function: unless | Top | Globals Index | Back | Next |
|
syntax: unless <boolean-condition> <code-block> description: Evaluate a block if the condition is *NOT* true |
| Function: yield | Top | Globals Index | Back |
|
syntax: yield <block> Collects the results of block evaluations. Arg: Block to do refinement: /only Inserts the result as a series. refinement: /full Do not ignore none! values. refinement: /initial <type> Specifies the type of the result. refinement: /str Return as string. NOTE: can always rejoin block Result. |