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