v0.3.5: allot
This commit is contained in:
+5
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Clyx is a concatenative, stack-oriented programming language designed for simplicity, minimalism, and metaprogramming capabilities. It uses postfix notation (aka Reverse Polish Notation, RPN), where operations are performed on a global stack. Clyx features homoiconicity: code is structured as Q-forms (special forms to represent data similar to Python or Tcl lists), which can be manipulated as data and executed dynamically.
|
||||
|
||||
This document describes the stack effects and behavior of the **50 primitive core words**, **3 bootstrapped core words**, and **51 standard library words** present in the reference implementation.
|
||||
This document describes the stack effects and behavior of the **50 primitive core words**, **3 bootstrapped core words**, and **52 standard library words** present in the reference implementation.
|
||||
|
||||
The Clyx runtime itself allows the programmer to redefine any already defined word, including the core ones and the ones from the standard library. Unlike e.g. Forth, where words are resolved at compile-time, Clyx words are resolved at runtime, so such redefinitions may affect all previously established behavior. That's why, as a rule, any **predefined** Clyx word, both in the language core and the standard library, must not exceed 6 characters. This is done to encourage programmers to define their own human-readable words (7+ characters long) without any risk of overwriting existing word definitions.
|
||||
|
||||
@@ -542,6 +542,10 @@ These words are defined in the standard library file `lib.clx` and loaded dynami
|
||||
- **Stack Effect**: `( start end -- [q] )`
|
||||
- **Description**: Generates a Q-form containing all integer numbers from `start` to `end` (including `start` but not including `end`). Returns an empty Q-form if `start` is greater than or equal to `end`.
|
||||
|
||||
#### `allot`
|
||||
- **Stack Effect**: `( length -- [q] )`
|
||||
- **Description**: Pops the `length` integer from the stack, creates a contiguous Q-form of that length where every element is the number `0`, and pushes it back onto the stack. If `length` is less than or equal to `0`, returns an empty Q-form.
|
||||
|
||||
### 10.9 Bitwise Operations
|
||||
|
||||
#### `bitnot` (Bitwise NOT)
|
||||
|
||||
Reference in New Issue
Block a user