lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hallo,

On 9/29/06, Glenn Maynard <glenn@zewt.org> wrote:
Not all means of "extending" languages (in the sense you're using here)
are bad; many of them aren't, in fact.  Operator overloading can be
abused (and frequently is), but it isn't defining new tokens and
precedences; I think this is at a new level.


    This is not really new. In Haskell you can define new operators,
which are infix functions, and specify their precedence and
associativity:

infixl 10 ($=)  -- infix operator, associates left, precedence 10
($=) :: Int -> Int -> Int
a $= b = a + b

--
-alex
http://www.ventonegro.org/