From 3ae0c35e27580b247652dff608dd8c4d29f16bff Mon Sep 17 00:00:00 2001 From: Frank Duncan Date: Fri, 13 May 2016 20:09:03 -0500 Subject: [PATCH] Prims - die halts execution --- src/main/nvm/nvm.lisp | 3 ++- src/test/simpletests.lisp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/nvm/nvm.lisp b/src/main/nvm/nvm.lisp index 0981332..c31640e 100644 --- a/src/main/nvm/nvm.lisp +++ b/src/main/nvm/nvm.lisp @@ -91,7 +91,8 @@ DESCRIPTION: See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#die" (when (not (turtle-p *self*)) (error "Gotta call die in turtle scope, dude (~A)" *self*)) (setf (turtle-who *self*) -1) - (setf *turtles* (remove *self* *turtles*))) + (setf *turtles* (remove *self* *turtles*)) + (error (make-condition 'stop))) (defun patches () "PATCHES => ALL-PATCHES diff --git a/src/test/simpletests.lisp b/src/test/simpletests.lisp index 9bf58d3..78293e0 100644 --- a/src/test/simpletests.lisp +++ b/src/test/simpletests.lisp @@ -114,6 +114,9 @@ (defsimplecommandtest "die 1" "crt 10 ask turtles [ die ]" "A665C1BF95E1F9CAAE9B9F8B2FBE3DAA45453136") +(defsimplecommandtest "die 2" "crt 10 ask turtles [ hatch 1 die hatch 1 ]" + "DFB46C61ACB9A24004FF26B04DCB0AC32E90AA36") + (defreportertestwithsetup "any? 3" "crt 10 ask turtles [ die ]" "any? turtles" "false" "A665C1BF95E1F9CAAE9B9F8B2FBE3DAA45453136") -- 2.25.1