#Pattern matching out the very last bit in a bit array.

1 messages · Page 1 of 1 (latest)

warped vessel
#

if you know the size of the bit array, just match size-1 bits followed by matching 1 bit

if you don't know the size, you'll have to external call erlang:bit_size since its not currently in stdlib

harsh rain
#

Ah, I see, what would this look like, I haven't really used Gleam's FFI on the Erlang side of things (I have never written Erlang), only used the JS FFI.

warped vessel
harsh rain
#

cool, and how would i use this in a pattern match to get the tail bit?