Closed mynameisrufus closed 9 years ago
Great stuff. Really look forward to testing it. Is the code stable yet? In the past I've tried keeping the master branch clean and do development on the development branch. Make sure to keep code jtcl compatible.
I have problems with jtcl becuase of dict
and ensemble
, looks stable of tclsh just run make
. I could have a look at getting rid of the jtcl dependency?
I believe there is support for the dict command in jtcl - it was backported - have a look here: https://jtcl.kenai.com/docs/ https://github.com/jtcl-project/jtcl/blob/master/src/main/java/tcl/lang/TclDict.java
The thing is - we have to make sure we support all valid irules (as in we have to support the starts_with etc operators). So, we're left with two alternatives:
I prefixed everything ::tcl::dict
for jtcl but that broke tclsh. I have only looked at tcl for couple of weeks so i'm not sure how to achieve table key
without using ensemble
(args hacks could be used but dirty), the thing is jtcl seems to have implemented ensemble
so i'm not sure what is going on.
I will try and implement starts_with
and friends and update this PR over the next few days or few weeks (about to take a holiday).
How about renaming aliasing ::tcl::dict with dict in case of jtcl? I believe the ensemble command in jtcl is part of itcl and not implemented "natively" or backported, ref: http://wiki.tcl.tk/4302 and https://github.com/jtcl-project/jtcl/blob/master/src/main/java/tcl/pkg/itcl/Ensemble.java
I'm a bit disgruntled with big devices and iRules so will not be doing any more work on this, thanks for looking at my PR.
I changed
event
totrigger
asevent
is used by iRules(tm), I think it's also more common to have the method calledtrigger
.You can now trigger multiple events and see what state your mock table is in:
The table implementation is very naive it only works for this case.
See
test/test_table.tcl
for an example on how this works.Some tests are failing and
jtcl
is not working because of the use ofdict
andensemble
.