From: Rick DeNatale Date: 2010-03-07T05:31:33+09:00 Subject: Re: please help. what does mean << On Sat, Mar 6, 2010 at 2:58 PM, Kalinkin Kirill wrote: > I have to translate code from ruby to .net > And I dont understand what means << in the code. Its simple I know but > please do not delete question and answer the question please > > def eval_op(op, val1, val2, expr1, expr2, source, source_expr) >  result = val1.send(op, val2) >  expr = "(#{expr1} #{op} #{expr2})" >  test(result, expr) >  source << result; source_expr << expr >  find(source, source_expr) >  source.pop; source_expr.pop > end > > Thanks in advance! It depends on what objects source and source_expr are. << is just a message, and different objects can implement it differently. For integers << x means shift left x bits, For arrays << x means append x to the end of the array. Most classes will implement << with something like one of these two meanings in mind. There's no way to tell from that snippet of code whether source and source_expr are instances of standard Ruby classes or classes written as part of the overall application. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale