From: Frank Duncan Date: Sat, 14 May 2016 01:09:03 +0000 (-0500) Subject: Prims - die halts execution X-Git-Tag: v0.1.0~12 X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?a=commitdiff_plain;h=3ae0c35;p=clnl Prims - die halts execution --- 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")