lua-users home
lua-l archive

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


Rici Lake wrote:
But mine is still 25% faster, and can be improved even more by memoising:

rlake@freeb:~$ time lua511 -l 'Memoise' -e 'local rep = Memoise(function(n) return ("%d"):rep(n) end); for i = 1, 1e5 do local t = {1,2,3,4,5,6,7}; local a = rep[#t]:format(unpack(t)) end'

It was explained in this very list a long time ago, but I can't memorize what memoise is... :-)

That leads me to a slightly off-topic field -- but of interest for most programmers, I think.

I am a procedural programmer by experience (lot of Basic, C, assembly language...) and habits. I trained myself on OO design, concepts that were hard to assimilate until I read OReilly's Head On Java, which explains clearly this stuff.

I am starting to get used to think OO, although not necessarily convinced that it is the ultimate methodology. I discovered in this list functional programming, elsewhere other philosophies/methodologies like Xtreme programming (I feel I am mixing up stuff here :-) ).

One question is: is there a good tutorial on functional programming, ideally not relying too much on a given language. I don't have time to re-learn Lisp or to study Scheme.

That said, a colleague lent me a copy of Head First Patterns. I have base knowledge of (GoF) patterns, but again, it is not obvious to assimilate them fully (no Borg here).

This brings me back to Lua. Do you think (some of) these patterns can apply to this language? I mean, in its "purest" form, ie. without OO system built above it.

And are they usable in functional programming? Or do this methodology (?) has patterns of its own?

Just curious, I learned so much from this list!

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --