Lua implementation of Design By Contract
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Lua implementation of Design By Contract

Started by Mardeg, 02 September, 2006, 05:30:44

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mardeg

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?

Herodes

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,...

SMF spam blocked by CleanTalk