Author Topic: Lua implementation of Design By Contract  (Read 3530 times)

0 Members and 1 Guest are viewing this topic.

Offline Mardeg

  • Forum Ace
  • *****
  • Posts: 75
  • Karma: +7/-1
    • The most bloated human-readable email hider in the world!
Lua implementation of Design By Contract
« on: 02 September, 2006, 05:30:44 »
DBC wiki article: http://en.wikipedia.org/wiki/Design_by_contract

Looks like it's a way to generically verify that a call to a function guarantees that it's sending any/the correct input and also that the function called guarantees to return correct output.
Possibly also a way to correctly throw an error accurately pinpointing the source of the error, instead of just having the error pointing to the location of the DBC verification code.

An example using the Javascript language is at http://weblogs.mozillazine.org/weirdal/archives/016921.html

Can anyone think of a possible use of this which isn't just an unnecessary extra layer of abstraction? If so, how to implement?

PtokaX forum

Lua implementation of Design By Contract
« on: 02 September, 2006, 05:30:44 »

Herodes

  • Guest
Re: Lua implementation of Design By Contract
« Reply #1 on: 02 September, 2006, 22:31:50 »
first think that we need to get a grasp of the Object Oriented programming that Lua may offer ( using the tables (the skeleton) and the functions (the muscles), but also the module system in Lua 5.1) for orchestrating actions for using within PtokaX (this is a direct implication that PtokaX may need a more accessible-open-alterable API,... so maybe forget about it cause I think that it is more trouble that its worth for PPK (doing the business may not mean reinventing the wheel))....

seconldy I think that things should get  any more complicated in PtokaX,.. since this is a Lua proposal that should be posted in the respective mailing list and get the feedback from the people that know Lua's guts and skin and comprehend them better than anyone of us since they do it for a living nad we do it as a hobby,...

One the other hand maybe you are right and that we need some more science,.. but gimme profit and I'll do my studies,...

PtokaX forum

Re: Lua implementation of Design By Contract
« Reply #1 on: 02 September, 2006, 22:31:50 »