From: Alex Young Date: 2006-10-07T00:48:51+09:00 Subject: Re: What is the reason for this syntax? Sorry for jumping in mid-thread, but... Kevin Olemoh wrote: > People really should be able to write code in the way that they > understand they shoulf not need to concern themselves with wrapping > their minds around a contrivance of the language they happen to be > using to get something done. *Everything* is a contrivance of the language you're using in some respect, no matter which language you're talking about. > Things like requiring the use of the > ternary operator (A special form of if in c/c++) in certain situations > are just mistakes on the part of the people who created the language. Where are ternary operators required? > I'm very glad I bothered to bring this up since at least now I have a > workaround until such time that the defacto requirement for K&R style > indentation with respect to blocks is removed. Why would it be removed? The current situation is consistent, clear and easy to understand. > It really does not matter how neat syntactically a language is if you > do not explain what your code is doing especially in a language such > as this that does not require explicit declaration of variables as > well as support (to an extent at least.) for implicit conversion of > data types. I *think* what you're saying is that if you don't understand a language, it won't be obvious what's going on. Welcome to the learning curve! I'm not sure if you're arguing for type coercion or not here, but that way lies (more or less) religious arguments in which Ruby's position is clear and well-known. > I was also wondering is there a way to *not* have to write the following: > > magick::fobar.blah > or simillar when using libraries? > further more what exactly is magick:: supposed to be called? In this case, Magick would be a module. The same syntax can be used for classes, though. If you want to short-cut it, you can say: include Magick Fobar.blah The 'include Magick' line adds the Magick module to the list of places that are searched for the Fobar class. -- Alex