tstrict
2 years agoDocummentation update (table patching) master table_library v0.4
Christian Thaeter [Wed, 6 Sep 2017 01:08:08 +0000 (03:08 +0200)]
Docummentation update (table patching)

2 years agohandle 'final' tables in the table library
Christian Thaeter [Wed, 6 Sep 2017 01:05:30 +0000 (03:05 +0200)]
handle 'final' tables in the table library

2 years agoWIP: table lib, basic functionality
Christian Thaeter [Tue, 5 Sep 2017 02:40:14 +0000 (04:40 +0200)]
WIP: table lib, basic functionality

patching the table lib to refer to the metatables tstrict_array when
available. More strict checking is not implemented yet.

2 years agomove the 'array' reference into the metatable
Christian Thaeter [Tue, 5 Sep 2017 00:41:40 +0000 (02:41 +0200)]
move the 'array' reference into the metatable

For the upcoming table library (monkey-)patching the 'array' must be
accessible from the outside. Add it as 'tstrict_array' to the
metatable.

2 years agochange license to MIT/X11, include COPYING file
Christian Thaeter [Mon, 4 Sep 2017 20:07:24 +0000 (22:07 +0200)]
change license to MIT/X11, include COPYING file

2 years agoDocumentation update
Christian Thaeter [Mon, 4 Sep 2017 18:34:12 +0000 (20:34 +0200)]
Documentation update

Notes about the Infrastructure and pointers to repository and webpage

2 years agogitignore update
Christian Thaeter [Mon, 4 Sep 2017 18:16:49 +0000 (20:16 +0200)]
gitignore update

2 years agoremove rockspec files, no need for versioning
Christian Thaeter [Mon, 4 Sep 2017 18:15:07 +0000 (20:15 +0200)]
remove rockspec files, no need for versioning

2 years agoFIX: ipairs was broken v0.3.1
Christian Thaeter [Mon, 4 Sep 2017 17:56:22 +0000 (19:56 +0200)]
FIX: ipairs was broken

somehow the ipairs handler got lost

2 years agoNew documentaton, add generated .html devel v0.3
Christian Thaeter [Sun, 3 Sep 2017 13:35:54 +0000 (15:35 +0200)]
New documentaton, add generated .html

2 years agosome cosmetics
Christian Thaeter [Sun, 3 Sep 2017 13:34:28 +0000 (15:34 +0200)]
some cosmetics

- rename 'kind' to 'mode'
- add a table check to the tests

2 years agoimplement promotion/demotion of strictness kinds
Christian Thaeter [Sun, 3 Sep 2017 03:46:24 +0000 (05:46 +0200)]
implement promotion/demotion of strictness kinds

2 years agoFix array handling and copy init table
Christian Thaeter [Sat, 2 Sep 2017 22:07:01 +0000 (00:07 +0200)]
Fix array handling and copy init table

The array handling made some wrong assumption about the lua
implementation. Now a array is only checked for continous once and is
handled as non continous on a first violation.

Also at initializaton time members must be copied instead swapping
tables to retain identity of the origin table.

2 years agoimprove testsuite
Christian Thaeter [Wed, 30 Aug 2017 03:37:52 +0000 (05:37 +0200)]
improve testsuite

some FIXME's left for still known bugs

2 years agodefault and force definitions
Christian Thaeter [Tue, 29 Aug 2017 00:08:23 +0000 (02:08 +0200)]
default and force definitions

- in table ctor constraints are selected by a function instead 'CONSTRAIN'
- passing a new 'default' argument will select the default definition kind
  when keywords are ommitted. These can be 'TYPED', 'CONST' or a function
  for constrained types. Or 'FINAL' to make the table immutable.
- a 'force' parameter enforces the default. explicit defnitons by keyword are
  then disabled.

new aliases for table ctors:

typed_def :: typed tables w/o need for keyword definitions
const_def :: makes all new entries const
final :: readonly table

2 years agolet the module function return a rather common interface table
Christian Thaeter [Sun, 27 Aug 2017 22:00:15 +0000 (00:00 +0200)]
let the module function return a rather common interface table

2 years agoallow redefinition to the same value for any kind of definiton
Christian Thaeter [Sun, 27 Aug 2017 17:10:01 +0000 (19:10 +0200)]
allow redefinition to the same value for any kind of definiton

this makes the common 'x = x or init' idiom work with tstrict definitons.

2 years agoallow erasing consts
Christian Thaeter [Sun, 27 Aug 2017 15:11:47 +0000 (17:11 +0200)]
allow erasing consts

rejecting it turned out to be a bad decision, fells not lua'ish

2 years agov0.2-1 rockspec
Christian Thaeter [Sat, 26 Aug 2017 03:05:17 +0000 (05:05 +0200)]
v0.2-1 rockspec

2 years agofix barf un url v0.2
Christian Thaeter [Sat, 26 Aug 2017 12:45:40 +0000 (14:45 +0200)]
fix barf un url

2 years agov0.2-1 rockspec
Christian Thaeter [Sat, 26 Aug 2017 03:05:17 +0000 (05:05 +0200)]
v0.2-1 rockspec

2 years agoSupport for arrays/sequences
Christian Thaeter [Sat, 26 Aug 2017 03:01:03 +0000 (05:01 +0200)]
Support for arrays/sequences

2 years agowrap constraint function calls in a pcall
Christian Thaeter [Sat, 26 Aug 2017 02:58:44 +0000 (04:58 +0200)]
wrap constraint function calls in a pcall

2 years agosome redesign
Christian Thaeter [Fri, 25 Aug 2017 16:33:47 +0000 (18:33 +0200)]
some redesign

- Definition keywords are now uppercase
- The interface function returns a list of functions
- Constraint functions get the table and key passed too

Arrays handling is broken and will be fixed next

2 years agorockspec update v0.1
Christian Thaeter [Fri, 25 Aug 2017 10:12:22 +0000 (12:12 +0200)]
rockspec update

2 years agofix rockspec v0.1
Christian Thaeter [Fri, 25 Aug 2017 01:52:43 +0000 (03:52 +0200)]
fix rockspec

2 years agoadd .gitignore
Christian Thaeter [Fri, 25 Aug 2017 01:51:10 +0000 (03:51 +0200)]
add .gitignore

2 years agoadd rockspec
Christian Thaeter [Fri, 25 Aug 2017 01:50:28 +0000 (03:50 +0200)]
add rockspec

2 years agoadd constrain definiton, simplify the check for defined vars constrain
Christian Thaeter [Fri, 25 Aug 2017 00:22:51 +0000 (02:22 +0200)]
add constrain definiton, simplify the check for defined vars

2 years agofactor out 'defined()' check
Christian Thaeter [Thu, 24 Aug 2017 23:16:21 +0000 (01:16 +0200)]
factor out 'defined()' check

2 years agomake the 'var', 'const' and 'typed' members constant
Christian Thaeter [Thu, 24 Aug 2017 23:00:24 +0000 (01:00 +0200)]
make the 'var', 'const' and 'typed' members constant

2 years agoinitial implementation, works, maybe bugs
Christian Thaeter [Thu, 24 Aug 2017 22:33:10 +0000 (00:33 +0200)]
initial implementation, works, maybe bugs