digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 31 Mar 2013 10:36 AM |
I'm asking this question because I'm not fully sure.
I've found pages on it in lua.org, and the ROBLOX wiki, but apparently to someone else Lua is NOT Object Oriented.
So here's my question: Is Lua Object Oriented, or not?
Also, if wanted, you can discuss Object Oriented Programming here. |
|
|
| Report Abuse |
|
|
dekkonot
|
  |
| Joined: 22 Dec 2010 |
| Total Posts: 6685 |
|
|
| 31 Mar 2013 10:37 AM |
| I'm going to say yes, because even in normal Lua there isn't really much you can do without objects. |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 31 Mar 2013 10:38 AM |
| No. Lua is procedural (I think?) but as the creators said, it has few but powerful constructs to allow many different paradigms. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 31 Mar 2013 10:45 AM |
I'm at the Lua About page (http://www.lua.org/about.html) and it says this:
"For example, although Lua is not a pure object-oriented language, it does provide meta-mechanisms for implementing classes and inheritance." (Under "Lua is powerful (but simple)") |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2013 10:45 AM |
| Depends what the Lua's being used for, in ROBLOX's case - yes it would be because it's scripting that is orientated around objects. |
|
|
| Report Abuse |
|
|
MrChubbs
|
  |
| Joined: 14 Oct 2010 |
| Total Posts: 4969 |
|
|
| 31 Mar 2013 10:54 AM |
| RBX.Lua certainly, your average Lua I would still say yes because it has much of the capability to be implemented as such. |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2013 10:58 AM |
@MrChubbs Happy 2333th post!
@thread Yes and no. Lua has the potential to be OOP and un-OOP.
See: Roblox and LOVE |
|
|
| Report Abuse |
|
|
MrChubbs
|
  |
| Joined: 14 Oct 2010 |
| Total Posts: 4969 |
|
|
| 31 Mar 2013 10:59 AM |
| Lol, I didn't even notice. :D |
|
|
| Report Abuse |
|
|
SN0X
|
  |
| Joined: 24 Oct 2011 |
| Total Posts: 7277 |
|
|
| 31 Mar 2013 11:36 AM |
yes it is
just because it doesnt have classes doesnt mean its not object oreinted
local object = {}
metatables and blah blah make up for no classes |
|
|
| Report Abuse |
|
|
coplox
|
  |
| Joined: 07 Jun 2008 |
| Total Posts: 3252 |
|
| |
|
lombardo2
|
  |
| Joined: 30 Nov 2008 |
| Total Posts: 1604 |
|
|
| 31 Mar 2013 12:05 PM |
| Lua is object oriented, but it's not class based, it's prototype based. Like JavaScript |
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 31 Mar 2013 12:58 PM |
local object = { property1 = "white" property2 = "tall" property3 = "skinny" }
I do. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 01 Apr 2013 06:41 AM |
Nice opinions, people.
I know Lua can be used to make games, but I wondered how as Lua (at the time I knew) wasn't Object Oriented. |
|
|
| Report Abuse |
|
|
|
| 01 Apr 2013 07:38 AM |
| @UnAdmin You forgot your separators, that table would error. |
|
|
| Report Abuse |
|
|
UnAdmin
|
  |
| Joined: 10 Jul 2012 |
| Total Posts: 4706 |
|
|
| 01 Apr 2013 03:43 PM |
| Hmm. And after working all day with them :P |
|
|
| Report Abuse |
|
|