lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I've found YetAnotherClassImplementation a good OO library.
So I want to use it.

But yaci doesn't look like normal lua module.
It just look like a code block exporting one global function and one table.

I tried to use it in my test code test.lua like shown below.

  4 require("class")                                                                           
  6 A = newclass("A")                                                                          
  8 function A:printAttr()                                                                     
  9   local s                                                                                  
 10   if B:made(self) then s = B:cast(self) print(s.b)                                         
 11   elseif C:made(self) then s = C:cast(self) print(s.c)                                     
 12   elseif D:made(self) then s = D:cast(self) print(s.d)                                     
 13   end                                                                                      
 14 end         

class.lua is in the same directory with test.lua and class.lua points to yaci.lua - the library.

Is the library yaci supposed to be used this way?

I wonder why yaci doesn't look like ordinary lua module.
(yaci doesn't use module(...), or module(...,package.seeall), ...)

And one more important question...

Does yaci support lua 5.1?
Does yaci support lua 5.2?
Does yaci only support lua 5.0?


Journeyer J. Joh
o o s a p r o g r a m m e r
a t
g m a i l  d o t  c o m