[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: creating a new module as an extention of another module
- From: david herviou <herviou@...>
- Date: Fri, 31 Mar 2006 17:27:10 +0200
Hi all,
I'm now using lua 5.1 and migrating my previous package system ('hack'
describes in pil 5.0) to this lua version.
I think it's now very clean with this new package module system but I
have a question on how to do a module
that is an extension of an another module?
for example
--file : rule.lua
module("rule")
function and(r1,r2) ... end
function or(r1,r2) ... end
suppose now you want to extend the previous module with to have a
CompleteRule system
--file completeRule.lua
module("completeRule")
require "rule"
function notUnary(r1) ... end
the question is finally how to push all function of module rule into the
module completeRule. In a way, it's like inheritance for class.
I think I have already seen such mecanism in Ocaml.
Someone as an idea? or is it to basic to ask the question (I'm a newbie
concerning the packaging system)?
Thanks.
dh
begin:vcard
fn:David HERVIOU
n:HERVIOU;David
org;quoted-printable:Ecole Nationale d'Ing=C3=A9nieurs de Brest
adr;quoted-printable;dom:BP 38;;25, rue Claude Chappe;Plouzan=C3=A9;France;29280
email;internet:herviou@enib.fr
title;quoted-printable:Centre Europ=C3=A9en de R=C3=A9alit=C3=A9 Virtuelle
tel;work:+33 (0)2 98 05 89 45
tel;fax:+33 (0)2 98 05 89 79
note;quoted-printable:Doctorant En Informatique au laboratoire LISyC (Laboratoire d'Informatiqu=
e des Syst=C3=A8mes Complexes) dans le cadre du projet AR=C3=A9Vi.
url:http://www.cerv.fr/~herviou
version:2.1
end:vcard