Hacker News new | past | comments | ask | show | jobs | submit login

expr is horrible though. but i love tcl.



It's easy to alias expr to =, which enhances write- and readability :

  % interp alias {} = {} expr
  =
  % set x [= 2 + 3]
  5
Also aliasing lindex to @ is nice

  % interp alias {} @ {} lindex
  % set a {1 2 3}
  1 2 3
  % @ $a 1
  2


Also, if you set your namespace path like so:

namespace path {::tcl::mathop ::tcl::mathfunc}

Then you get very LISP like math operators

  % set x [+ 2 3 [- 5 20]]
  -10
and math functions

  % set x [abs -12]
  12




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: