- Void Function Support:
- Fixed critical bug where functions with no return value would crash with
IndexError - Introduced
VOIDsentinel value to distinguish void functions from functions returningNone - Void functions no longer pollute the stack with unnecessary values
- Recursive void function calls no longer require
dropoperator - Example:
{msg} {msg echo} print defunnow works without crashing
- Fixed critical bug where functions with no return value would crash with
- Function Return Value Behavior:
- Functions that produce no stack values now return
VOIDinstead of crashing VOIDis not pushed to the stack, keeping stack clean- Explicit
Nonevalues can still be used and will be pushed to stack normally
- Functions that produce no stack values now return
-
Parentheses
()for Code Blocks:()can now be used in place of{}for code blocks- Example:
(1 2 +) eval,(x y) (x y *) mul defun
-
Variable Prefix
$is Optional:- Variables can be used without
$prefix (old syntax$xstill works) =operator added as an alias forset- Example:
5 x =andx echo
- Variables can be used without
-
Global Variables:
- New
globalkeyword for global variable declaration - Syntax:
value variable global - Example:
0 counter global
- New
-
VSCode Syntax Highlighting:
- Syntax highlighting extension for
.stkfiles - Auto-closing pairs, code folding, comment toggling
- Installation:
cp -r .vscode-extension ~/.vscode/extensions/stacker-language
- Syntax highlighting extension for
-
Performance Optimization:
- Improved function call performance with scope chain implementation
-
Examples Directory:
- Reorganized into categories:
basics/,functions/,algorithms/,advanced/ - Updated to use new syntax (no
$prefix)
- Reorganized into categories:
- Fixed comment parsing when
#appears mid-line - Enhanced error messages
- Fixed multiline
()code blocks in script files
-
Fixed File Naming Typos:
- Renamed
stacker/exec_modes/excution_mode.pytoexecution_mode.py - Fixed method name typo:
disp_all_valiables()→disp_all_variables() - Fixed attribute name typo:
self.oprerators→self.operators(affected 16+ locations in core.py)
- Renamed
-
Code Cleanup:
- Removed unused file
stacker/valiable.py(all content was commented out)
- Removed unused file
- Improved Package Configuration:
- Updated
pyproject.tomlto properly specify all subpackages - Added explicit Python version requirement:
requires-python = ">=3.10" - Updated dependency specification:
prompt-toolkit>=3.0.0 - Corrected
package-datato only include actual data files
- Updated
-
Changed
Stopped using the deprecated pkg_resources module in favor of standard library alternatives.
- Increased Maximum Regression Iterations: The maximum number of regression iterations has been increased.
- Improved Token Interpretation: Tokens enclosed in
{}are now correctly interpreted even when there are no spaces between them. Example:{x} {x 2 ^} lambdais now interpreted as{x}{x 2 ^}lambda.
fracCommand: Example:3 4 fracreturnsFraction(3, 4)and displays as3/4.- File Commands:
write-to-file: Writes specified content to a file. Example:"This is a test file." "test.txt" write-to-fileappend-to-file: Appends specified content to a file. Example:"This is a test file." "test.txt" append-to-fileread-from-file: Reads content from a file. Example:"test.txt" read-from-filefile-exists: Checks if a file exists. Example:"test.txt" file-exists
- Fixed incorrect explanation for the
readcommand inREADME.md.
-
Breaking Changes
-
Modified ifelse Syntax:
Before: condition ifelse After: condition ifelse
Note: This change is not backwards compatible with previous versions.
-
Modified if Syntax:
Before: condition if After: condition if
Note: This change is not backwards compatible with previous versions.
-
-
Bug Fixes
Fixed variable scope handling in recursive function processing
-
Support for Lambda Functions:
- Lambda functions are now supported, enabling inline definitions and executions of anonymous functions.
- Example:
stacker:0> {x} {x 2 *} lambda
-
Enforced Symbol Naming Conventions:
- Symbols used as arguments in
set,defun, anddefmacronow require a$prefix to improve clarity and prevent naming conflicts. - Example:
stacker:0> 123 $a set
- Symbols used as arguments in
-
New Stack Manipulation Commands:
- n listn: Converts the top n elements from the stack into a list.
- extend: Expands list objects onto the stack.
-
Input/Output Enhancements:
- read: Reads data from standard input.
- read-from-string: Interprets a string as RPN expressions and reads it.
-
Bug Fixes:
- Resolved an issue where unnecessary values were being pushed onto the stack during function execution in sub-blocks, causing unexpected errors during recursive operations.
-
Display Command Improvement:
- The
dispcommand has been updated to omit commas between elements, aligning with REPL mode display conventions.
- The
-
New Command:
- abort: Immediately terminates the program with an exit status of 1, equivalent to
exit(1).
- abort: Immediately terminates the program with an exit status of 1, equivalent to
-
Unified Line Endings:
- Line endings across files have been unified;
.gitattributeshas been updated with* text=auto.
- Line endings across files have been unified;
-
Comment Handling Improvement:
- Fixed an oversight where text following a
#in the middle of a line was not being recognized as a comment.
- Fixed an oversight where text following a
- Resolved an issue where passing arrays to user-defined functions resulted in errors.
- Changed the macro definition command from
aliastodefmacro.- Rationale: This change aligns the macro definition syntax with the function definition syntax (
defun). - Note: This modification is not backwards compatible with previous versions.
- Rationale: This change aligns the macro definition syntax with the function definition syntax (
Users will need to update their existing macro definitions:
- Old syntax:
alias - New syntax:
defmacro