diff src/ov-list.cc @ 4513:508238e65af7

[project @ 2003-09-19 21:40:57 by jwe]
author jwe
date Fri, 19 Sep 2003 21:41:21 +0000
parents af308ca1a354
children 2c9de1be042a
line wrap: on
line diff
--- a/src/ov-list.cc
+++ b/src/ov-list.cc
@@ -33,6 +33,7 @@
 #include "lo-sstream.h"
 #include "lo-utils.h"
 
+#include "Cell.h"
 #include "defun.h"
 #include "error.h"
 #include "ov-list.h"
@@ -42,6 +43,17 @@
 
 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_list, "list");
 
+octave_list::octave_list (const Cell& c)
+  : octave_base_value (), lst ()
+{
+  int n = c.length ();
+
+  lst.resize (n);
+
+  for (int i = 0; i < n; i++)
+    lst(i) = c(i);
+}
+
 octave_value
 octave_list::subsref (const std::string& type,
 		      const std::list<octave_value_list>& idx)