Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 12 Apr 2012 04:18 PM |
| Can somebody give me a use of metatables? I can't think of a single one that I'd ever use... |
|
|
| Report Abuse |
|
|
GCgame
|
  |
| Joined: 29 Feb 2012 |
| Total Posts: 3 |
|
|
| 12 Apr 2012 04:23 PM |
| Metatables were only added to allow for OOP inside of lua. However since roblox is already set up in an OOP manner, there is rarely ever a need for them unless you want to just look cool. |
|
|
| Report Abuse |
|
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 12 Apr 2012 04:25 PM |
OOP? :o Would you mind explaining? |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 12 Apr 2012 04:26 PM |
| Object-oriented Programming. |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2012 04:27 PM |
FredFishy...YOU ASKED A QUESTION?!? Strangeeeee.......I thought you were pro!
The only reason I use them is to make my tables in scripts look "more complicated than what it is." :P
|
|
|
| Report Abuse |
|
|
gergy008
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 7039 |
|
|
| 12 Apr 2012 04:28 PM |
| Lua is multi-paradigm, the 3 main paradigms are Procedural programming, Object-oriented programming and event driven. Metatables allow you to use lua in your own preferred style of the 3 available. |
|
|
| Report Abuse |
|
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 12 Apr 2012 04:29 PM |
| Does that mean all the Instance.new("Part") stuff, and all the classes and stuff we have? And then all the hierarchy. |
|
|
| Report Abuse |
|
|
Fredfishy
|
  |
| Joined: 21 Mar 2009 |
| Total Posts: 4197 |
|
|
| 12 Apr 2012 04:32 PM |
"I thought you were pro!" Haer Haer Haer
Anyway, it doesn't seem there's much point in learning them then :P |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 12 Apr 2012 04:34 PM |
| Metatables are used behind the scenes of roblox objects. Very useful when creating a class or a library. |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 12 Apr 2012 04:35 PM |
Also, it lets you do stuff with a weird syntax.
class 'Name' : structual { --stuff for class def } |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2012 04:41 PM |
Custom Methods Pseudo events Pseudo objects Add use to operators with Tables |
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
| |
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 12 Apr 2012 05:24 PM |
| And nobody has said anything that wasn't mentioned in the first post. |
|
|
| Report Abuse |
|
|