OSDN Git Service

save point.
authorvisor <visor@users.sourceforge.jp>
Mon, 25 Aug 2014 13:58:07 +0000 (22:58 +0900)
committervisor <visor@users.sourceforge.jp>
Mon, 25 Aug 2014 13:58:07 +0000 (22:58 +0900)
modules/ml-texp.cc
modules/ml-variable.cc

index 04bbf70..3dbee9d 100644 (file)
@@ -496,6 +496,8 @@ MNode*  ml_table_each (MNode* cell, MlEnv* mlenv) {
     if (vkey.size () == 0 || vval.size () == 0) {
        throw (uErrorBadArg);
     }
+    if (isNil (tbl ()))
+       return NULL;
     if (! isTable (tbl ()))
        throw (uErrorWrongType);
     
index 07dbb9c..ec80ca0 100644 (file)
@@ -66,6 +66,13 @@ MNode*  ml_setvar (MNode* cell, MlEnv* mlenv) {
                        nextNode (a1);
                        nextNode (a2);
                    }
+               } else if (a2->isVector ()) {
+                   size_t  i = 0;
+                   while (a1 && a1->isCons ()) {
+                       setvar (a1->car (), a2->vectorGet (i), mlenv);
+                       nextNode (a1);
+                       ++ i;
+                   }
                } else {
                    throw (ustring (CharConst ("setting a scalar value to a list of variables.")));
                }