Ever felt like [].include?(x) was “backwards”? Ever wanted to just go x.in?([]) instead?
[1,2,3].include? 1
1.in? [1,2,3]
post.comments.include?(comment)
comment.in?(post.comments)
In Surrealist Coding that would be something like
| idiom(:include?).reverse - "clude" #~> #in? |
In real coding, well, it’s intuitive. and fun! And Python has in(), so why not Ruby?