On Wed, 2002-10-30 at 11:41, Nikodemus Siivola wrote:
> Using ruby to solve domain specific issues. For example, 3D stuff need a
> lot of matrices and vecotrs. It would be nice to have literal for those,
> now I need to do
> 
>  Vector.new(3,5,6)
> 
> This can get rather verbose in the long run, defining a literal would allow
> me to do
> 
>  <3,5,6>
> 
> or whatever.

But the former is *far* more readable.

And how would custom literals be scoped?  Suppose one Ruby module
defines <x,y,z> to denote a 3D vector and another defines <r,g,b> to
denote an RGB colour, how would the programmer define which literal is
used?  With classes you can explicitly name a fully qualified class,
import a class by name, or import under a different name by assigning a
class reference to a constant in the local module.  But that cannot be
done at the syntax level.

Cheers,
	Nat.


-- 
Dr. Nathaniel Pryce, Technical Director, B13media Ltd.
Studio 3a, 22-24 Highbury Grove, London N5 2EA, UK
http://www.b13media.com