Version 35 of CMP

Updated 2008-05-30 14:23:28 by escargo

My name is Camiel Plevier.

At Dutch Space, Leiden, the Netherlands, in 2005 I worked on a test program for the Herschel and Planck satellite's attitude control system. The test scripts needed to be written in TCL 8.3. Several times the discussions on these pages helped me to work around the unnatural quirks of TCL. So I felt I had to contribute as well.


RS: Welcome! But could you elaborate on what "unnatural quirks" you mean?

What someone regards as "unnatural quirks" is relative to his background and viewpoint. Any examples given by one person will be debated by others. My contributions to several pages should give a clue on my particular vantage point.

OK... One example (TCL 8.4 and older):

  % expr 1<<31
  -2147483648

Martyn Smith: Strangely, this is exactly what I get from the following C code !

 main (int argc, char* argv)  {
    printf ("1<<31 %d", 1<<31);
 }

 $ a.out
  1<<31 -2147483648

CMP Thanks for living up to the prediction! :^) ...and to continue the debate: 1) So, and what does this tell us about C, 2) And what about expr 0x80000000? How does C handle that?

Martyn Smith: So using signed 32-bit arithmetic is unnatural and quirky? Once you know what size integers you're using the quirks become natural.

I've seen many programs fail when int's automatically change from 16 -> 32 bits.