Login
7 branches 0 tags
Ben (Win10) Moved more parts over use bytecode 0ab59cf 3 years ago 597 Commits
nujel / stdlib / bitmanip.nuj
; Nujel - Copyright (C) 2020-2021 - Benjamin Vincent Schulenburg
; This project uses the MIT license, a copy should be included under /LICENSE

;; Some functions manipulating binary date

[defn lognand l
      "Returns the Nand of its arguments"
      [lognot [apply logand l]]]

[defn bit-set?! [i]
      [def mask [ash 1 i]]
      [fn [α]
          [not [zero? [logand α mask]]]]]

[defn bit-clear?! [i]
      [def mask [ash 1 i]]
      [fn [α]
          [zero? [logand α mask]]]]