lua-users home
lua-l archive

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


On the subject of requests. Use of pattern matching in definitions of lua functions 
would be nice. I was thinking of something of the order of the following:

function fib(0) return 1 end

function fib(1) return 1 end

function fib(n)
	return fib(n-1)+fib(n-2)
end

print fib(5)

It's easy to write a preprocessor to do the transformation but it would be nice if it fit 
into the base language.

MvH Dan Andersson