3 ms·
Tcl is a functional programming language in the sense that every value in Tcl is an immutable string (the legacy arrays excluded) and as a result you are able
by networked 11y ago
Tcl is a functional programming language in the sense that every value in Tcl is an immutable string (the legacy arrays excluded) and as a result you are able and encouraged to build Tcl applications mostly out of pure functions. Where mutability comes into the picture is through the state maintained by Tcl extensions written in C, such as SQLite, TclCurl, TclOO (the standard object system) and Tk (the GUI toolkit). You might use the same immutable strings as handles for the objects maintained by these extensions but the internal state of the objects is mutated. Besides that mutability there is (immutable string-based) state in the form of global/namespace-local variables that you can reassign.
- SFjulie1 11y agoOk, I was a tad lacking of precision. Tk not tcl because it is event driven relies heavily on a mutable called time/clock. And there also always states every time you do asynchronuous to handle the status of things (connection, ....). And since you can manipulate them, you have to deal with states. And you cannot "snapshot them". Basically modern web is just using browsers like an asynchronous GUI it was my thesis. And indeed, in other contexts tcl can map to functional paradigm. I really don't care in fact of FP. At one point it is like monads, string theory & a lot of very interesting theories that are very enjoyable to learn but for which the cognitive burden to respect the purity of the theory outweigh for my pooor brain in real life application. It reminds me of my teachers being pissed when I could solve their problem faster with an easier personal ways when I could use my tools. And even more pissed when I was framed to use their tools and failing. They thought I was doing it on purpose like other kids ... to shame them publicly. No I must be kuku. What protects the international conventions on Intellectual Property anyway? The originality of the way of solving a problem. So I always thought that making myself my own tools and thinking was a necessary risk in order to be truly innovative one day. That is also why I dropped the consulting bullshit to test my theories in the grunt job. I also do a lot of other stuff like testing my greatfathers ratio of KNOP in fertilizer, music, knitting, cycling 50km/h in the city, cider, bread, emulsions (béarnaise, béchamel, vinaigrette...) to challenge my knowledge. Stuff that must work. And I pride myself in some successes. (at the price of a lot of failures).