Login
7 branches 0 tags
Ben (X13/Void) Fixed setting array members to #nil 8a33363 4 years ago 287 Commits
nujel / stdlib / binary.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

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

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

[defun bit-clear?! [i]
       [def mask [ash 1 i]]
       [λ [α] [zero? [logand α mask]]]
]