Calc Update

I’ve written before that I’ve started learning Calc. That last post was after I’d worked through the introductory material (which is, itself, quite dense). I’ve now completed the first three sections of the tutorial covering

  • Basic Tutorial (RPN, stack, algebraic notation, Undo/Redo, Modes)
  • Arithmetic Tutorial (arithmetic and scientific functions)
  • Vector/Matrix/List Tutorial (operations on vectors and matrices)

It may seem that my progress is slow—that last post was two weeks ago—but there’s a huge amount of material, especially in the last section. The basic and arithmetic tutorials are pretty much what you’d expect although you’d probably be surprised at how many different functions there are. The last section is astounding. For example, there is a function to calculate the dot product of two vectors but even if there weren’t you could do the same operation using the map and reduce functions. In Elisp (but not Calc) terms that would be

(reduce #'+ (cl-mapcar #'* V1 V2))

There are lots of examples that don’t have a simple, single command so these functions turn out to be really powerful and useful.

The tutorial has exercises, some of which could be from the Euler Project. They’re not all that hard, thankfully, but some of them require careful thinking about before you can solve them. They’re really useful for helping to cement some of the functions and techniques in your head.

I’ve already started using Calc in my day-to-day work. Where before I’d bring up a Lisp REPL or try to make do with Elisp, I now just pop into Calc and perform whatever calculations I need. It’s nice that I don’t have to worry about overflow and things like that. The only downside is that I still haven’t internalized all the function codes. They are generally one or two characters and while some—like *, +, …—are obvious others are less so. For example VC is the cross product of two vectors and HL is \(\log_{10}\). Fortunately, there’s a cheat sheet that lists the most common commands.

I’m really enjoying working through the tutorial and am learning a lot. I’ll post another status report when I’ve worked through more of the tutorial.

This entry was posted in General and tagged , . Bookmark the permalink.