Standard class API

General discussion about LÖVE, Lua, game development, puns, and unicorns.

What features need to be in the API

Poll ended at Wed Jun 22, 2011 12:19 pm

Single-class inheritance
11
14%
Constructors
11
14%
Instance methods
10
13%
Polymorphism
10
13%
Getting the class of an instance
7
9%
Getting the name of a class
6
8%
Read-only classes (fully define them when calling the class creation function)
7
9%
R/W classes (modify at any time) (choose either this or read-only)
2
3%
Total voters count (always tick this, please)
12
16%
 
Total votes: 76

User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Standard class API

Post by bartbes »

Alright, I took the results from the poll, updated the wiki page and created a github repo where we can work on it.

Everyone who wants to participate, preferably people who write publicly available class libraries, just ask if you want in, I'll get you listed and repo access.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Standard class API

Post by Robin »

Although I haven't written one of the class libraries, I'd like to help on this project.

As for the function name, we can't use Class or class, since both are used by one or more of the libraries. Perhaps the library could provide a table "common", with a function "class", so the example could be: Tree = common.class("Tree", Tree).
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Standard class API

Post by bartbes »

I actually used common-class in the example in the repo :P.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Standard class API

Post by Robin »

bartbes wrote:I actually used common-class in the example in the repo :P.
I know, I read that. :P But common-class is not a valid identifier, while common.class is (well, not really, but you know what I mean).

EDIT: BTW, how is the actual back end selected? Automatically? Explicitly specified by the lover?
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Standard class API

Post by bartbes »

Back-end? The front end is provided by one of the libs, so slither, for example, could have a switch that would make it export this.
User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: Standard class API

Post by Ensayia »

Is there any way someone could break down exactly what all of this means for a semi-newbie programmer like myself? What exactly is this doing for LOVE?

Perhaps I am being thrown off by the use of the word 'class', which I've only seen in Object oriented languages. It's my understanding that Lua is not OOP.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Standard class API

Post by Robin »

Ensayia wrote:Is there any way someone could break down exactly what all of this means for a semi-newbie programmer like myself? What exactly is this doing for LOVE?
It means that libraries don't have to pick a class system, which would otherwise result in needing to have a ton of class systems for large projects using multiple libraries
Ensayia wrote:It's my understanding that Lua is not OOP.
Lua is object oriented, but it doesn't provide a standard way of making classes and objects. That is where the lover-made libraries come in (SECS, MiddleClass, Slither, hump.class, ...). The thing is, they each have different syntax and ways of doing things, which means problems if you have to use more than one at the same time.
Help us help you: attach a .love.
gfreak
Prole
Posts: 29
Joined: Wed Jan 04, 2012 5:32 pm

Re: Standard class API

Post by gfreak »

dead?

i want to use it :-)
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Standard class API

Post by bartbes »

It was implemented in MiddleClass, hump.class, SECS and Slither.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests