+//////////
+// archiving
+//////////
+
+/** Construct object from archive_node. */
+numeric::numeric(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
+{
+ debugmsg("numeric constructor from archive_node", LOGLEVEL_CONSTRUCT);
+ value = new cl_N;
+#if 0 //!!
+ // This is how it should be implemented but we have no istringstream here...
+ string str;
+ if (n.find_string("number", str)) {
+ istringstream s(str);
+ s >> *value;
+ }
+#else
+ // Workaround for the above: read from strstream
+ string str;
+ if (n.find_string("number", str)) {
+ istrstream f(str.c_str(), str.size() + 1);
+ f >> *value;
+ }
+#endif
+ calchash();
+ setflag(status_flags::evaluated|
+ status_flags::hash_calculated);
+}
+
+/** Unarchive the object. */
+ex numeric::unarchive(const archive_node &n, const lst &sym_lst)
+{
+ return (new numeric(n, sym_lst))->setflag(status_flags::dynallocated);
+}
+
+/** Archive the object. */
+void numeric::archive(archive_node &n) const
+{
+ inherited::archive(n);
+#if 0 //!!
+ // This is how it should be implemented but we have no ostringstream here...
+ ostringstream s;
+ s << *value;
+ n.add_string("number", s.str());
+#else
+ // Workaround for the above: write to strstream
+ char buf[1024];
+ ostrstream f(buf, 1024);
+ f << *value << ends;
+ string str(buf);
+ n.add_string("number", str);
+#endif
+}
+