Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun dpbs (initial-value
- &rest where-and-what)
- (loop
- :for (where what) :on where-and-what :by (function cddr)
- :do (setf initial-value (dpb what where initial-value))
- :finally (return initial-value)))
- (let ((n #xA1B2C3D4))
- (format t "~x~%" (dpbs (ldb (byte 8 24) n)
- (byte 8 8) (ldb (byte 8 16) n)
- (byte 8 16) (ldb (byte 8 8) n)
- (byte 8 24) (ldb (byte 8 0) n))))
- --> D4C3B2A1
- nil
Advertisement
Add Comment
Please, Sign In to add comment