From: "grz01@..." Date: 2008-02-05T20:59:59+09:00 Subject: Re: ruby syntax question On Feb 4, 10:18 pm, Karl von Laudermann wrote: > On Feb 4, 4:01 pm, "gr...@spray.se" wrote: > > > Hi, > > > While debugging some ruby-code, I found a mis-typed construct like the > > following, > > which looks like a syntax error to me, > > but when you run it in irb it evaluates to nil and does NOT raise an > > error: > > > x = def > > puts xyz > > end > > > (where xyz is undefined) > > Anyone can explain what the above code means to ruby? > > I believe that it is being interpreted as defining an empty method > like so: > > def puts(xyz) > end > > and assigning to x the result of the call to "def". Thanks for help guys. Yes, makes sense. /grz01