Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby uses ===, not ==, in case statements #1247

Closed
dfhoughton opened this issue Mar 14, 2017 · 4 comments
Closed

Ruby uses ===, not ==, in case statements #1247

dfhoughton opened this issue Mar 14, 2017 · 4 comments
Labels
docs Documentation issue (primary issue type)

Comments

@dfhoughton
Copy link

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.

@dfhoughton
Copy link
Author

I'd add the "docs" label, but it seems no labels are available to me.

@Altai-man Altai-man added the docs Documentation issue (primary issue type) label Mar 14, 2017
@Altai-man
Copy link
Member

Altai-man commented Mar 14, 2017

If I remember correctly, it was @awwaiid who was an author of Ruby-related document.
@awwaiid, what do you think about it?

@coke coke assigned coke and unassigned awwaiid and coke Aug 8, 2017
@zoffixznet
Copy link
Contributor

@dfhoughton I sent you an invite to Perl 6 GitHub org; you can accept it on https://github.com/perl6/

Would you be able to fix the docs and close this issue? I'm assuming you're talking about Ruby-to-Rakudo page, in which case you can just edit this file directly on GitHub: https://github.com/perl6/doc/edit/master/doc/Language/rb-nutshell.pod6

@JJ JJ closed this as completed in 60e8595 Mar 16, 2018
@awwaiid
Copy link
Contributor

awwaiid commented Mar 17, 2018

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type)
Projects
None yet
Development

No branches or pull requests

5 participants