Page 1 of 1

Someone can help with classes?

Posted: Wed Feb 11, 2009 3:17 am
by LinaInverse
Hello everone, I'm new here. I have some problems, but the worst is:
I dont know how to use class! You can see in my signature "I'm Programmer", but I'm know only basics of C++(Maybe little more then basics^^), Visual Basic, C# and LUA, but thhis classes just make me so angry... Anyway, Someone can explain for me how to use classes? (I just drank too much coffee today, so I can't say this easier)

Re: Someone can help with classes?

Posted: Wed Feb 11, 2009 3:58 am
by zapwow
Hi LinaInverse, welcome
The crazy thing about lua is that it doesn't have classes. However, it does have tables, which are sort of like arrays. These tables are not limited to data types, and can contain anything you want, including functions. By stuffing tables with functions, it's possible to make one act like a class.

This article has a very good implementation and explanation.

BTW - everything in lua is passed by reference, so it's like these tables contain pointers to their contents. Good to know.

Re: Someone can help with classes?

Posted: Wed Feb 11, 2009 3:52 pm
by LinaInverse
Oh, Big Thanks

Re: Someone can help with classes?

Posted: Thu Feb 12, 2009 2:59 am
by mike
LinaInverse... you claim to be a girl. Because of the fact that I am a male geek and you have ventured into our hunting grounds, I am obligated by the Board of Male Geekyness, led by the honorable XXXJudgeDoomHammerXXX and overseen by JamesTPicard86, to ask you the following question:

a/s/l ?

Re: Someone can help with classes?

Posted: Thu Feb 12, 2009 3:45 am
by Tabasco
Image

Re: Someone can help with classes?

Posted: Thu Feb 12, 2009 5:08 am
by Skofo
Obligatory.
Image

But on a serious note, I say just forget about it. You really don't find people who feel the need to broadcast to everyone their lack of a Y chromosome in their signature annoying?

Re: Someone can help with classes?

Posted: Thu Feb 12, 2009 6:05 am
by Merkoth
MY.FUCKING.EYES
NEED.SPOON.REMOVE.THEM
AGH.

Re: Someone can help with classes?

Posted: Thu Feb 12, 2009 8:11 am
by qubodup
oh $dog you idiot, you walked right into it. dude. how many years have you been on the internet? :?

Re: Someone can help with classes?

Posted: Thu Feb 12, 2009 11:09 am
by mike
I löve this forum. ^^