Hi
I prefer using the words not, or, and instead of !, ||, &&. Personally i think they are easier to type and read.
Is there a simple way to do this myself?
using compile time string substitution
or
reopening a class and adding three instance methods
or
any other solution?
def not(thing)
!thing
end
puts(not true)
class Object
def or(other)
self || other
end
def and(other)
self && other
end
end
puts false.or true
puts "hi".and "hello"
It looks funny, and probably doesn’t work in all cases, but that’s about as close as you might get