News for hackers. Stuff that matters.
Re:Reading a Programmer's Guide to Common Lisp by kazinator on Thursday February 22, 2024 @04:46PM (#39473743)
Since (preamble) cannot possibly perform a side effect which affects the initializing expression 5, it can be moved:

  (if (cond)
    (let ((a 5))
      (preamble)
      (do-stuff a))
    (do-stuff 6))
You can work in side effects into the expressions of a let or let*:

  (let* ((x (progn (widget-lock w)
                   (widget-x w)))
         (y ...))
     (...)
     (widget-unlock w))
If lock-widget returns the widget, it can look like this:

  (let* ((w (widget-lock w))
         (x (widget-x x))
         (y ...))
    ...
    (widget-unlock w))

There are no comments on this comment yet.