3 ms·
I like that question and that distinction, and I think the answer is I'd give is "yes". Tcl's flexible, to the degree of being able to define new language cons
by Frondo 11y ago
I like that question and that distinction, and I think the answer is I'd give is "yes".
Tcl's flexible, to the degree of being able to define new language constructs or redefine built-ins (e.g. you can redefine the basic if-then if you want), which is great in some ways.
But it always seemed to me like the language culture is so deep in the mentality of "if you need, implement it yourself," that the flexibility becomes a crutch for the language developers.
What I mean is.. well, the basic data structure is the list, and you get built-ins for adding to a list (lappend), reversing a list (lreverse), but removing an element from a list (what would be 'lremove')? You've got to code it yourself.
Hey, the man page for 'lreplace' even gives an example! http://www.tcl.tk/man/tcl/TclCmd/lreplace.htm http://www.tcl.tk/man/tcl/TclCmd/lreplace.htm
Why isn't that built in? The common answers are, it's so simple you can code it yourself, or you might want an lremove with different behavior than me. To the second answer, realistically, if the language had a built-in lremove, most people would just express their programs to use it, and those who needed a different one could still write it. To the first, yes, it's simple, but it's just a little bit of sand in the underwear--unpleasant friction you'd like to ignore but keeps popping up.
Lack of built-in OO was the same way until relatively recently in the language history. Lots of people made home-brew ones, and there were several common OO systems, but what's a newbie to do? Research all the different OO systems to make a decision first? More sand in the underwear. Run into enough of that stuff and it just drives you crazy and makes you want to stop using the language.