2 scalar.hh -- declare Scalar
4 source file of the Flower Library
6 (c) 1997--1999 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 (long l) { *this = to_str (l); }
22 Scalar (char c) { *this = to_str (c); }
23 Scalar (char const *c) : String (c) {}
24 Scalar (String s) : String (s) {}
33 bool to_bool () const;
34 Rational to_rat () const;
39 /** perl -like string to bool conversion.
41 operator bool() const;