From: "Marcel Molina Jr." Date: 2006-11-15T08:08:54+09:00 Subject: Re: Different return values for setter methods On Wed, Nov 15, 2006 at 07:30:38AM +0900, Mauricio Fernandez wrote: > > (P.S. I spent some time mucking around in parse.y and eval.c trying to answer > > this myself and couldn't find any clues. If anyone knows, I'd appreciate > > being directed to the part of the code that makes sure to return the argument > > rather than the result of the method call for setter methods) > > > rb_eval (eval.c) > > case NODE_ATTRASGN: > { > [...] > rb_call(CLASS_OF(recv),recv,node->nd_mid,argc,argv,block,scope,0,self); > result = argv[argc-1]; > ^^^^^^^^^^^^^^^^^^^^^ > ^^^^^^^^^^^^^^^^^^^^^ > } > break; > > instead of result = rb_call(...). Thanks for taking the time to point it out. I suspected it might be that but the -1 wasn't what I was expecting. marcel -- Marcel Molina Jr.