Hi Mason,
That is my fault as the pattern is wrong. A binary constructor/patten consists of a sequence of segments where each segment has the form
(val <specs> ...). A spec is either type (integer,binary,bitstring,float), (size n), big|little-endian, signed|unsigned. The default type is integer. So the pattern should have read
(binary 40 (rest binary)) and the function
(defun foo
([(binary 40 (rest binary))] rest)
([_] 'unmatched))
Sorry about that. A description binaries is at about 2/3 of the file doc/user_guide.txt or in
http://docs.lfe.io/user-guide/diving/3.html .
Robert