]> www.ginac.de Git - ginac.git/blobdiff - ginac/wildcard.cpp
- Cleanups: My evil plot of making ex::bp private may finally be carried
[ginac.git] / ginac / wildcard.cpp
index 0d782622975ff773c63d5cb1af7875b9cc291c73..f203c5f09d8d56b1ab5d5f6d8e8c667a5105644d 100644 (file)
@@ -77,12 +77,12 @@ void wildcard::archive(archive_node &n) const
 DEFAULT_UNARCHIVE(wildcard)
 
 //////////
-// functions overriding virtual functions from bases classes
+// functions overriding virtual functions from base classes
 //////////
 
 int wildcard::compare_same_type(const basic & other) const
 {
-       GINAC_ASSERT(is_of_type(other, wildcard));
+       GINAC_ASSERT(is_a<wildcard>(other));
        const wildcard &o = static_cast<const wildcard &>(other);
 
        if (label == o.label)
@@ -91,11 +91,11 @@ int wildcard::compare_same_type(const basic & other) const
                return label < o.label ? -1 : 1;
 }
 
-void wildcard::print(const print_context & c, unsigned level = 0) const
+void wildcard::print(const print_context & c, unsigned level) const
 {
        debugmsg("wildcard print", LOGLEVEL_PRINT);
 
-       if (is_of_type(c, print_tree)) {
+       if (is_a<print_tree>(c)) {
                c.s << std::string(level, ' ') << class_name() << " (" << label << ")"
                    << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
                    << std::endl;
@@ -115,10 +115,10 @@ unsigned wildcard::calchash(void) const
 
 bool wildcard::match(const ex & pattern, lst & repl_lst) const
 {
-       // Wildcards must match exactly (this is required for subs() to work
-       // properly because in the final step it substitues all wildcards by
-       // their matching expressions)
-       return is_equal(*pattern.bp);
+       // Wildcards must match each other exactly (this is required for
+       // subs() to work properly because in the final step it substitutes
+       // all wildcards by their matching expressions)
+       return is_equal(ex_to<basic>(pattern));
 }
 
 } // namespace GiNaC