lua-users home
lua-l archive

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

Sebastian Rasmussen wrote:
> I got my code to work with your changes, but the code I sent was just an 
> abstraction of the real code I have problems with.I thought the problem 
> stemmed from my erroneous referencing of functions, but maybe it doesn't

I am not a specialist of this "OO" notation. Far from it, I don't use it
(yet) in my own little programs.
I scratched my head looking at your code which seems correct.
A direct call like print(self.htmlize_link("foo")) gives the same result, so
obviously it is not a problem with gsub.

Running out of experiments, I tried the alternative syntax:
--  function instance:htmlize_link(link)
  instance.htmlize_link = function (link)

And it works! Both in Lua 4.0 and Lua 4.1-work4. You should indicate the
version you use in your messages, some subtle problems can rise depending on the
version (not here).

Now, don't ask me why it works. I will reread the Lua doc...

> Oh, and I'm sorry if I pollute some developer-only list, but as far as I
> tell this list is also suitable for lua-users...?

Yes, an sample of code is always welcome, at least by beginners like me. And
beside licence discussions (good choice, BTW), the list is quite quiet these
times anyway...


Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist

GMX - Die Kommunikationsplattform im Internet.