From: Martin DeMello Date: 2004-12-13T19:52:20+09:00 Subject: Re: puts / print as method not keyword? zuzu wrote: > > from a language design perspective, or perhaps this is a ruby idomatic > / programmer organization behavior perspective, any clues as to why > nobody uses it? Well, one reason could be that there are two separate objects involved in a display - the object to be displayed and the object doing the displaying. So you can eiher have object.puts(stdout) or stdout.puts(object). Then, again, there could be multiple ways for an object to display itself to various display contexts; the settled-upon ruby way seems to be a method on the object that tells the context how to display it, and a method on the context to do the actual displaying. Thus you'd have svg_canvas.draw(object.to_svg) and stdout.puts(object.to_s). 'puts object' merely leaves the stdout and the to_s implicit, but they're both present behind the scenes. martin