case MNode::MC_DOUBLE:
return cell;
case MNode::MC_VECTOR:
- return vectorEval (cell, mlenv);
+// return vectorEval (cell, mlenv);
+ return cell;
case MNode::MC_TABLE:
- return tableEval (cell, mlenv);
+// return tableEval (cell, mlenv);
+ return cell;
default:
assert (0);
}
}
/*DOC:
+===vector===
+ (vector OBJ ...) -> VECTOR
+
+*/
+//#AFUNC vector ml_vector
+//#WIKIFUNC vector
+MNode* ml_vector (MNode* cell, MlEnv* mlenv) {
+ MNode* arg = cell->cdr ();
+ int n;
+ MNodePtr ans;
+
+ ans = newMNode_vector ();
+ while (arg) {
+ ans ()->vectorPush (eval (arg->car (), mlenv));
+ nextNode (arg);
+ }
+ return ans.release ();
+}
+
+/*DOC:
===vector-get===
(vector-get N VECTOR) -> VALUE
}
/*DOC:
+===table===
+ (table CONS ...) -> TABLE
+
+*/
+//#AFUNC table ml_table
+//#WIKIFUNC table
+MNode* ml_table (MNode* cell, MlEnv* mlenv) {
+ MNode* arg = cell->cdr ();
+ int n;
+ MNodePtr ans;
+ MNodePtr v;
+
+ ans = newMNode_table ();
+ while (arg) {
+ v = eval (arg->car (), mlenv);
+ nextNode (arg);
+ if (v () && v ()->isCons ()) {
+ ans ()->tablePut (to_string (v ()->car ()), v ()->cdr ());
+ } else {
+ throw (uErrorWrongType);
+ }
+ }
+ return ans.release ();
+}
+
+/*DOC:
===table-get===
(table-get NAME TABLE) -> VALUE
MNode* ml_setevar (MNode* cell, MlEnv* mlenv);
MNode* ml_let (MNode* cell, MlEnv* mlenv);
MNode* ml_getvar (MNode* cell, MlEnv* mlenv);
+MNode* ml_vector (MNode* cell, MlEnv* mlenv);
MNode* ml_vector_get (MNode* cell, MlEnv* mlenv);
MNode* ml_vector_put (MNode* cell, MlEnv* mlenv);
MNode* ml_vector_push (MNode* cell, MlEnv* mlenv);
MNode* ml_vector_pop (MNode* cell, MlEnv* mlenv);
MNode* ml_vector_resize (MNode* cell, MlEnv* mlenv);
+MNode* ml_table (MNode* cell, MlEnv* mlenv);
MNode* ml_table_get (MNode* cell, MlEnv* mlenv);
MNode* ml_table_put (MNode* cell, MlEnv* mlenv);
MNode* ml_push (MNode* cell, MlEnv* mlenv);