Guest User

Untitled

a guest
Apr 1st, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. (defun dpbs (initial-value
  2. &rest where-and-what)
  3. (loop
  4. :for (where what) :on where-and-what :by (function cddr)
  5. :do (setf initial-value (dpb what where initial-value))
  6. :finally (return initial-value)))
  7.  
  8.  
  9. (let ((n #xA1B2C3D4))
  10. (format t "~x~%" (dpbs (ldb (byte 8 24) n)
  11. (byte 8 8) (ldb (byte 8 16) n)
  12. (byte 8 16) (ldb (byte 8 8) n)
  13. (byte 8 24) (ldb (byte 8 0) n))))
  14. --> D4C3B2A1
  15. nil
Advertisement
Add Comment
Please, Sign In to add comment