2 scalar.hh -- declare Scalar
4 source file of the Flower Library
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
17 /// Perl -like scalar type.
18 struct Scalar : public String
20 Scalar (Real r) { *this = to_str (r); }
21 Scalar (int i) { *this = to_str (i); }
22 Scalar (char c) { *this = to_str (c); }
23 Scalar (char const *c) : String (c) {}
24 Scalar (String s) : String (s) {}
31 bool to_bool () const;
34 urg, these are bit silly; perhaps should make "Print_string" class
37 Scalar (Vector v) { *this = v.str (); }
38 Scalar (Matrix m) { *this = m.str (); }
40 /** perl -like string to bool conversion.
42 operator bool() const;