From 7f3460152325f6185642edad13df9dd0968b727a Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Sat, 14 Mar 2026 16:58:55 +0000 Subject: [PATCH] Well, that was easy! Stack limit now working. --- Makefile | 2 +- docs/State-of-play.md | 11 +++++++++++ lisp/documentation.lisp | 2 +- src/memory/stack.c | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7c55be3..5691f29 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ test: $(TESTS) Makefile $(TARGET) .PHONY: clean clean: - $(RM) $(TARGET) $(OBJS) $(DEPS) $(SRC_DIRS)/*~ $(SRC_DIRS)/*/*~ $(TMP_DIR)/* *~ core + $(RM) $(TARGET) $(OBJS) $(DEPS) $(SRC_DIRS)/*~ $(SRC_DIRS)/*/*~ $(TMP_DIR)/* *~ core.* repl: $(TARGET) -p 2> psse.log diff --git a/docs/State-of-play.md b/docs/State-of-play.md index 1d8bbfd..c619b55 100644 --- a/docs/State-of-play.md +++ b/docs/State-of-play.md @@ -1,5 +1,16 @@ # State of Play +## 20260314 + +When I put a debugger on it, the stack limit bug proved shallow. + +I'm tempted to further exercise my debugging skills by having another go at +the bignum arithmetic problems. + +However, I've been rethinking the roadmap of the project, and written a long +[blog post about it](https://www.journeyman.cc/blog/posts-output/2026-03-13-The-worlds-slowest-ever-rapid-prototype/). +This isn't a finalised decision yet, but it is something I'm thinking about. + ## 20260311 I've still been having trouble with runaway recursion — in `member`, but diff --git a/lisp/documentation.lisp b/lisp/documentation.lisp index b303856..271700d 100644 --- a/lisp/documentation.lisp +++ b/lisp/documentation.lisp @@ -12,7 +12,7 @@ (item collection) "`(member item collection)`: Return `t` if this `item` is a member of this `collection`, else `nil`." (print (list "In member? item is " item "; collection is " collection)) - ;; (println) + (println) (cond ((= 0 (count collection)) nil) ((= item (car collection)) t) diff --git a/src/memory/stack.c b/src/memory/stack.c index cff1ece..70c07f9 100644 --- a/src/memory/stack.c +++ b/src/memory/stack.c @@ -130,7 +130,7 @@ struct cons_pointer make_empty_frame( struct cons_pointer previous ) { uint32_t depth = ( nilp( previous ) ) ? 0 : ( get_stack_frame( previous ) )->depth + 1; - if ( stack_limit > 0 && stack_limit > depth ) { + if ( stack_limit == 0 || stack_limit > depth ) { result = in_make_empty_frame( previous, depth ); } else { result =