You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the comparison of Perl 6 with Ruby, it says Ruby lacks a smart match operator and uses == instead. This isn't quite right. Ruby uses the === method, which performs a similar function to ~~. So Class === foo matches if foo is a Class, /rx/ === foo matches if the regular expression matches foo, 1 === foo matches if foo equals 1, 'string' === foo matches ... In general === delegates to ==, but it is overridden in Class and regular expressions, and can be overridden as needed to make case statements work more intuitively in other ways.
The text was updated successfully, but these errors were encountered:
In the comparison of Perl 6 with Ruby, it says Ruby lacks a smart match operator and uses == instead. This isn't quite right. Ruby uses the
===method, which performs a similar function to~~. SoClass === foomatches iffoois aClass,/rx/ === foomatches if the regular expression matchesfoo,1 === foomatches iffooequals 1,'string' === foomatches ... In general===delegates to==, but it is overridden inClassand regular expressions, and can be overridden as needed to make case statements work more intuitively in other ways.The text was updated successfully, but these errors were encountered: