First THINK C Program (2020)
beyondloom.com
beyondloom.com
(n > 0) && printf("0 ", 0);
Never saw something like this. A conditional execution without an if?I remember following a really old Python tutorial that suggested the way to write inline if/else statements was
C and A or B
which makes use of similar short-circuiting behavior. Nowadays this is written as A if C else B
The and/or version depends on A being truthy, otherwise it evaluates both A and B, giving the value of B.Think C was a fast compiler I used briefly as “Think C With Objects”. Objects were done with Handles so you had to lock an object before using it. The OS could move the backing memory of a Handle around as memory demands required.
Nice use of the vMac emulator.
[1] https://stackoverflow.com/questions/1642028/what-is-the-oper...
https://developer.apple.com/library/archive/documentation/ma...
https://developer.apple.com/library/archive/documentation/ma...
For a more directed and more C-oriented walkthrough, the Macintosh C Programming Primer was a pretty common go-to. It's been out of print for ages, of course, but there's a PDF available at:
https://vintageapple.org/macprogramming/pdf/Macintosh_C_Prog...
Vintage Macintosh Programming Book Library - https://vintageapple.org/macprogramming/