How to redefine != method?

  • Thread starter Iñaki Baz Castillo
  • Start date
I

Iñaki Baz Castillo

Hi, I can redefine =3D=3D method by doing:

def =3D=3D(string)

but it gives me an error if I try:

def !=3D(string)

=2D----------
SyntaxError: compile error
(irb):2: syntax error, unexpected tNEQ
def !=3D(string); "hello" ; end
^
(irb):2: syntax error, unexpected kEND, expecting $end
from (irb):2
=2D---------

How could I solve it?

Thanks a lot.


=2D-=20
I=C3=B1aki Baz Castillo
 
D

Dave Thomas

Hi, I can redefine =3D=3D method by doing:

def =3D=3D(string)

but it gives me an error if I try:

def !=3D(string)

!=3D is simply a negated call to =3D=3D, so defining =3D=3D also changes =
the =20
definition of !=3D.

Regards


Dave Thomas=
 
I

Iñaki Baz Castillo

El Lunes, 11 de Agosto de 2008, Dave Thomas escribi=F3:
!=3D is simply a negated call to =3D=3D, so defining =3D=3D also changes = the
definition of !=3D.

Great to know, thanks a lot.


=2D-=20
I=F1aki Baz Castillo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top