Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 May, 2013, 18:47:46 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: Lua Classes and OOP Tutorial -  (Read 2625 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: Today at 00:38:33
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1196


Topic starter
Total Post Ratings: +185

View Profile WWW
« on: 25 August, 2011, 16:22:06 »
0

Hey guys !

As you may or may not know, Inspired Lua had a nice tutorial about Classes and OOP in Lua for the Nspire, but it was not translated into English (only French was available).
This time is over and I'm proud to announce a complete tutorial in English Tongue

Here's the link : http://www.inspired-lua.org/2011/05/5-object-classes/

Please comment so we can improve the tutorial even more !

Thanks !
« Last Edit: 25 August, 2011, 16:23:09 by adriweb » Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: Today at 10:41:34
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #1 on: 25 August, 2011, 16:41:47 »
0

Nice adriweb, this should help beginners.

Just two remarks:
- I fear that the introduction and the "myTable.A.C.D.var" example may lose the reader, since this syntax will never be used, and is just a symbolic representation which doesn't really support inheritance anyway.
- Could you provide examples of inheritance with the TI-Nspire class API?
« Last Edit: 25 August, 2011, 16:57:58 by ExtendeD » Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: Today at 00:38:33
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1196


Topic starter
Total Post Ratings: +185

View Profile WWW
« Reply #2 on: 25 August, 2011, 16:44:31 »
0

Thanks Extended.

I will try to make something up for the 2nd point.

About that 1st point, I understand your concern since I myself was not sure how to introduce it correctly. (the original tutorial was made by Levak, and I translated it).
I might make chapters and a Table of contents saying that some introductory points can be skipped.
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
Levak
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 18:06:57
Date Registered: 04 April, 2010, 23:42:49
Location: France
Posts: 833


Total Post Ratings: +148

View Profile WWW
« Reply #3 on: 25 August, 2011, 16:52:30 »
0

- I fear that the introduction and the "myTable.A.C.D.var" example may lose the reader, since this syntax will never be used, and is just a symbolic representation which doesn't really support inheritence anyway.

Well ... I have no words to answer you on that point. I felt it was important to show the flexibility of Lua tables, that it can handle multi-type elements, such as tables, functions and "objects" (tables indeed).
« Last Edit: 25 August, 2011, 16:53:36 by Levak » Logged

Human always wants to survive and that's why he will fall one day.
My website - TI-Planet - iNspired-Lua
ExtendeD
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: Today at 10:41:34
Date Registered: 02 January, 2010, 13:03:41
Location: France
Posts: 765

Total Post Ratings: +151

View Profile
« Reply #4 on: 25 August, 2011, 16:57:17 »
0

I see.

Maybe this introduction could be modify by:
- Removing inheritance here that doesn't really make sense
- Showing that this standard syntax can be used to define object-oriented singletons with a example similar to the existing one
- Explaining that a more advanced syntax is needed to define real usable classes: either Lua's metatable or the TI-Nspire's class() function
« Last Edit: 25 August, 2011, 16:57:41 by ExtendeD » Logged

ndlessly - Progress and insights on Ndless
Ndless / Hackspire - Third-party TI-Nspire development
Levak
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 18:06:57
Date Registered: 04 April, 2010, 23:42:49
Location: France
Posts: 833


Total Post Ratings: +148

View Profile WWW
« Reply #5 on: 25 August, 2011, 17:16:33 »
0

Yeah, thanks you for feedback.
We will work on that =)
Logged

Human always wants to survive and that's why he will fall one day.
My website - TI-Planet - iNspired-Lua
Levak
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 18:06:57
Date Registered: 04 April, 2010, 23:42:49
Location: France
Posts: 833


Total Post Ratings: +148

View Profile WWW
« Reply #6 on: 18 September, 2011, 14:45:05 »
0

Updated =)
http://www.inspired-lua.org/?p=172

PS : Adriweb hasn't corrected English mistakes yet x)
« Last Edit: 18 September, 2011, 14:45:21 by Levak » Logged

Human always wants to survive and that's why he will fall one day.
My website - TI-Planet - iNspired-Lua
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.286 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.