-constant::constant(string const & initname, ex (*efun)()) :
- basic(TINFO_constant), name(initname), ef(efun),
- number(0), fct_assigned(true), serial(next_serial++)
+constant::constant(const std::string & initname, evalffunctype efun, const std::string & texname)
+ : basic(TINFO_constant), name(initname), ef(efun), number(0), serial(next_serial++)
+{
+ debugmsg("constant ctor from string, function",LOGLEVEL_CONSTRUCT);
+ if (texname.empty())
+ TeX_name = "\\mbox{" + name + "}";
+ else
+ TeX_name = texname;
+ setflag(status_flags::evaluated | status_flags::expanded);
+}
+
+constant::constant(const std::string & initname, const numeric & initnumber, const std::string & texname)
+ : basic(TINFO_constant), name(initname), ef(0), number(new numeric(initnumber)), serial(next_serial++)
+{
+ debugmsg("constant ctor from string, numeric",LOGLEVEL_CONSTRUCT);
+ if (texname.empty())
+ TeX_name = "\\mbox{" + name + "}";
+ else
+ TeX_name = texname;
+ setflag(status_flags::evaluated | status_flags::expanded);
+}
+
+//////////
+// archiving
+//////////
+
+constant::constant(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
+{
+ debugmsg("constant ctor from archive_node", LOGLEVEL_CONSTRUCT);
+}
+
+ex constant::unarchive(const archive_node &n, const lst &sym_lst)