Repository navigation
Conversation
Bug fixes: - REPL and --exec passed the input text as GC root instead of gc_root, crashing as soon as a GC happened. - MINILISP_ALWAYS_GC was never honored (flags were only read inside gc()); they are now read in gc_init(). This exposed more stale-pointer bugs: init_minilisp used a NULL root, symbol->string and string->symbol copied from a moved object, and load kept a pointer to the filename in the heap and dropped the caller's root chain. - Arithmetic: division by zero, (+), (-) and untyped first argument no longer crash; overflow wraps instead of being undefined behaviour. - Numbers >= 2^31 were truncated by the reader (int accumulator); detect overflow instead. - atom now evaluates its argument; reverse no longer modifies its arguments (lists and strings); (car), (cdr), (println) and (load) with missing arguments no longer crash; extra function arguments are an error. - eval_list no longer clobbers the caller's list slot (line numbers in error messages were 0). - Reader: correct line counting for CRLF files, EOF/NUL handling, bad dot syntax, improper argument lists. - Recursion that is too deep reports a Lisp error instead of SEGV. - repl: options may follow file names (-r was loaded as a file), Ctrl-D exits the REPL instead of looping forever. Performance: - Look up the head symbol once per call instead of twice. - while uses progn instead of building a throwaway list. - Preallocated small integers (-128..1023); eq compares integers by value. - GC keeps two semi-spaces instead of mmap/munmap on every collection, and grows the heap when more than half is live after a GC. - Reader works on a buffer instead of stdio/fmemopen/stdin hijacking. - string-concat is linear. error() is now noreturn and checked as a printf-like function. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A relative path given to (load ...) is first looked up in the directory of the file being loaded, then in the current directory, so that examples can load their library regardless of where minilisp is started from. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
print and println now print all their arguments separated by a space, as documented in the original README, instead of ignoring all but the first one. Tests added for both. README: document strings, *, /, mod, the command line options, the REPL commands, the load path resolution, the stack overflow error and the GC debugging variables; fix outdated or wrong statements (eq, if, reverse, recursion limits, load example path) and unbalanced examples. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…/tasks.json to be relative to the workspace folder instead of the current file. This allows the tasks to work when the workspace is opened from a different location.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fixes and optimizations by Claude Code.