https://chiselapp.com/user/nektomk/repository/fun/home
project contains classic iterators map,filter,fold and his test-suite;
you can program in Tcl in a functional style:
# simplified "counting lines of code" in given $filename # compose iterators via concatenations set loc [ \ fold { accum x } { # simple, counting elements incr accum # begining from 0 # over other command } 0 [] \ filter { x } { # filter elements set x [ string trim $x ] if { $x == {} || [ string index $x 0 ] == {#} } { # empty lines and lines started from # (comment) # wil drop return false } # return true } <| $filename ]
Use special signs and : for compositions
Another my project:
https://sourceforge.net/projects/mt-atcl/ and http://luxtrade.unaux.com/atcl/start
Tcl/Tk bindings for MQL5 (MetaTrader trading terminal)
You may use Tcl/Tk in any trading software (robots,indicators,services)
Using Tcl/Tk in trading bots :
#include <ATcl/ATcl.mqh> ATcl *tcl=NULL; // tcl // robot initiazation int OnInit() { tcl=new ATcl(); // create interp // check for correct if (tcl==NULL || tcl.OnInit()!=INIT_SUCCESSFUL) { return INIT_FAILED; } // evaluate scripts if (tcl.Eval("info tclversion")!=TCL_OK) { // handle error PrintFormat("info failed: %s",tcl.StringResult()); } else { PrintFormat("tcl version is ",tcl.StringResult()); } EventSetMillisecondTimer(300); // return INIT_SUCESSFUL; } // tick from trade server void OnTick() { tcl.Update(); // update idle tasks and GUI } // timer event void OnTimer() { tcl.Update(); // update idle tasks and GUI } // robot destroyed void OnDeinit(const int reason) { if (tcl!=NULL) { // remove interp tcl.OnDeinit(reason); delete tcl; } EventKillTimer(); }
https://github.com/nektomk/tcl-f
Was temporary frozen :-(
A small patch to TEBCResume(or TclParse) is needed to implement real lazy calculations. These two functions have a hidden conflict and cannot share the stack. Maybe I'll come back to this project later, it takes a lot of time and even more courage to fix TEBC