(defun create-proc-body (proc prims)
`(,(intern (string-upcase (car proc)) *model-package*) ()
- ,@(cdr ; remove the progn, cuz it looks nicer
- (clnl-transpiler:transpile (cadr proc)
- (mapcar
- (lambda (prim)
- (if (getf prim :macro) ; The reason we do this is because with macros, we want to evaluate them in
- ; this scope while preserving them for the generational purposes below
- (append (list :macro (eval (getf prim :macro))) prim)
- prim)) prims)))))
+ (clnl-nvm:with-stop-handler
+ ,@(cdr ; remove the progn, cuz it looks nicer
+ (clnl-transpiler:transpile (cadr proc)
+ (mapcar
+ (lambda (prim)
+ (if (getf prim :macro) ; The reason we do this is because with macros, we want to evaluate them in
+ ; this scope while preserving them for the generational purposes below
+ (append (list :macro (eval (getf prim :macro))) prim)
+ prim)) prims))))))
(defun model->single-form-lisp (model &key (seed 15) initialize-interface netlogo-callback)
(multiple-value-bind
end"
"setup go"
"2614B99F64ACFA2BD64D66B129C0A17F2150FADD")
+
+(defmodelcommandtest "procedures stop"
+ "to setup
+ create-turtles 5
+ stop
+ create-turtles 5
+end
+
+to go
+ if 5 < count turtles [ stop ]
+ crt 1
+end"
+ "setup go go"
+ "438848EF35C6B0D28D50961072C70FCC02BB4FD8")