recentpopularlog in

kme : tcl   26

Checking if an array key exists - Tcl example | http://www.wellho.net/
<code class="language-tcl">
if {[info exists capital($where)]}
</code>
tcl  syntax  arrays 
january 2019 by kme
Enhanced Tk Console: tkcon | http://tkcon.sourceforge.net/
Minimal ~/.tkconrc for a decent font and window size:

<code class="language-tcl">
tkcon font mononoki 14
set ::tkcon::OPT(cols) 100
set ::tkcon::OPT(rows) 25
</code>
tcl  tk  console  cli  repl  history  readline 
january 2019 by kme
scripting - How to get Command history by cursor key in Linux tclsh - Stack Overflow | https://stackoverflow.com/
Also, install the 'tkcon' package, from ActiveState.
You want access to the readline library, you can do that with rlwrap:
<code class="language-bash">
rlwrap tclsh
</code>

Useful options are -c for file name completion, and -f to add words from a file to the completion list:
<code class="language-bash">
rlwrap -cf my_complete_file tclsh
</code>

Since you almost always want to use rlwrap, adding a shell alias is useful:
<code class="language-bash">
alias tclsh='rlwrap tclsh'
</code>
tcl  tclsh  commandline  history  readline  solution 
january 2019 by kme
python - how to load virtualenv using environmental module file (tcl script)? - Stack Overflow | https://stackoverflow.com/
I don't think the semicolon is "essential" as the poster notes. You can also 'source /path/to/script.sh' and the changes to the environment seem to be preserved.

<code class="language-tcl">if { [ module-info mode load ] } {
puts stdout "/programs/program-env/bin/activate;"
} elseif { [ module-info mode remove ] } {
puts stdout "deactivate;"
}</code>
environmentmodules  modules  modulefile  tcl  solution  sysadmin 
april 2018 by kme
I've talked and written recently about why "just pick[ing] up Lua or Python" was... | Hacker News | https://news.ycombinator.com/
JS, in contrast, after stagnation, has emerged with new, often rapidly interoperating, de-facto (getters, setters, array extras, JSON) and now de-jure (ES5) standards, the latter a detailed spec that far surpasses C and Scheme, say, in level of detail (for interop -- C and Scheme favor optimizing compiler writers and underspecify on purpose, e.g. order of evaluation).
javascript  lua  python  tcl  theweb  history 
november 2017 by kme
Where Tcl and Tk Went Wrong (2010) | Hacker News | https://news.ycombinator.com/
I've read that he'd wanted to just use Scheme, but that they needed the language to have "Java" in the name, as well as curly braces. So, we got Javascript.

Also, given that DSSSL was an early contender against CSS (and a great deal more powerful), we could have basically had Scheme there too. https://blog.cloudflare.com/the-languages-which-almost-becam...

Lastly, because S-expressions can represent everything that is representable in SGML/XML/(X)HTML, but more succinctly, we could have basically had Scheme instead of HTML.

Imagine if, instead of JS/HTML/CSS, we had... Scheme. I'm pretty sure that the alter universes where this happened also all have peace, warp drives, and working cold fusion.


From Eich:
Study history or you, too, may be doomed to repeat it:

https://devchat.tv/js-jabber/124-jsj-the-origin-of-javascrip... (transcript at bottom)

https://brendaneich.com/2012/04/the-infernal-semicolon/#comm...

Netscape management gave "make it look like Java" orders. There was no time, on top of this. Last (more below in another reply) no extant command line interpreter was ready to be put in a browser. Way too many non-portable OS dependencies, unsafe FFI, etc. It was JS or bust (aka VBScript).

Thats actually not totally true. Internally, Tcl has two value types, string representation and actual value representation. Everything DOES have a string-representation though- some are made up (like file handles, fileX) and some are just ASCII forms of the values underneath (like integers).

Tcl is cool because you can manipulate the string form of values incredibly easily, but people confused this with "Everything is a string". It should be "Everything can be manipulated like a string".
tcl  programming  scripting  language  thestoryof  alsoran  vs  javascript  theweb 
november 2017 by kme
5.6. Tcl Extensions
I kept wondering what 'xinstall' was in the portfile for OpenLDAP, and this was the answer. A portfile is Tcl script, and 'xinstall' is a Tcl extension (like a function, I guess).

In any case, it didn't do what it was supposed to do, because the/opt/local/var/openldap-data directory wasn't owned by the 'ldap' user like it was a'sposed to be, and 'slapd' didn't even complain when run with the '-u ldap' option, it just died. Silently.
macports  tcl  sysadmin  openldap  solution 
february 2016 by kme

Copy this bookmark:





to read