&gt; Swift is the first language I&#x27;ve encountered that works this way; are there others?<p>Lisp, of course :-)  Common Lisp&#x27;s SETF and related macros work this way.  E.g.,<p><pre><code>  (incf (ldb (byte 3 5) x))
</code></pre>
would increment the &quot;byte&quot; (CL&#x27;s term for an arbitrary bit field) of width 3 at offset 5 of X.<p>INCF is defined in terms of SETF.  Of course, the set of macros that can update a place is user-extensible.  So if you wanted one that multiplies the value in the place by two, you could just write something like this (the trailing &quot;f&quot; in the name, as you might guess, is the convention for such a macro):<p><pre><code>  (define-modify-macro doublef () (lambda (x) (* x 2)))
</code></pre>
then you could call it like this:<p><pre><code>  (doublef (ldb (byte 3 5) x))
</code></pre>
to double the value in the bit field.<p>(EDIT: used lambda expression instead of helper function.)