From: Rob Marshall Date: 2011-12-09T03:10:41+09:00 Subject: Re: Confusing results from string multiplication Well at least I started a lively discussion :-) And after some thought, I guess this all does make sense in that *obj means: "splat-obj", which means: split obj into its individual components. As pointed out by Robert earlier, *2 (or splat-2) results in a simple '2'. So the syntax: 11.to_s *2 Is really '11.to_s splat-2', or: '11.to_s 2' which does base conversion. It all makes sense now. But, coming from other languages where that's not the behavior, it takes some getting used to. And, Yossef, yes I agree that it probably wouldn't take me all day to figure it out, it's actually pretty obvious with a little help from the forum :-). And, no, my opinion is NOT that methods can't have arguments, it's just that (unless I do what Pete suggested, i.e. run it with warnings turned on) I would not have thought of this particular syntax as ambiguous, especially coming from another language where '* 2' and '*2' both mean: multiply by 2. And, by the way, I still find that, if '11.to_s *2' does base conversion first and then converts the number to a string, then '11.to_s*2', to be consistent, should do that as well. Thanks, Rob -- Posted via http://www.ruby-forum.com/.