UI/Model Parse - Sliders - WIP
[clnl] / src / main / nvm / nvm.lisp
index 7927909859eed04ba570018eb03a133c8003aef3..96d57894b0d61b7a02fb7720e783e1cdc8cbf090 100644 (file)
@@ -76,7 +76,7 @@ DESCRIPTION:
      ((= i (length copy)) (incf i) (car (last copy)))
      (t (let ((result agent)) (fetch) result)))))))
 
-(defun create-world (&key dims globals turtles-own-vars patches-own-vars breeds)
+(defcommand create-world (&key dims globals turtles-own-vars patches-own-vars breeds)
  "CREATE-WORLD &key DIMS GLOBALS TURTLES-OWN-VARS PATCHES-OWN-VARS BREEDS => RESULT
 
   DIMS: (:xmin XMIN :xmax XMAX :ymin YMIN :ymax YMAX)
@@ -84,11 +84,11 @@ DESCRIPTION:
   TURTLES-OWN-VARS: TURTLES-OWN-VAR*
   PATCHES-OWN-VARS: PATCHES-OWN-VAR*
   BREEDS: BREED*
+  RESULT: :undefined
   GLOBAL: (GLOBAL-NAME GLOBAL-ACCESS-FUNC)
 
 ARGUMENTS AND VALUES:
 
-  RESULT: undefined
   XMIN: An integer representing the minimum patch coord in X
   XMAX: An integer representing the maximum patch coord in X
   YMIN: An integer representing the minimum patch coord in Y
@@ -153,7 +153,13 @@ DESCRIPTION:
      :color (patch-color patch)
      :xcor (patch-xcor patch)
      :ycor (patch-ycor patch)))
-   *patches*)))
+   *patches*)
+  (mapcar
+   (lambda (global)
+    (list
+     :name (car global)
+     :value (funcall (cadr global))))
+   *globals*)))
 
 ; These match netlogo's dump
 (defgeneric dump-object (o))