Jump to content

Burrows–Wheeler transform: Difference between revisions

→‎{{header|TXR}}: Add missing definition of eof!
(→‎{{header|TXR}}: Replace collect-each in bwt with mapcar.)
(→‎{{header|TXR}}: Add missing definition of eof!)
Line 2,666:
We use the U+DC00 code point as the EOF sentinel. In TXR terminology, this code is called the <i>pseudo-null</i>. It plays a special significance in that when a NUL byte occurs in UTF-8 external data, TXR's decoder maps it the U+DC00 point. When a string containing U+DC00 is converted to UTF-8, that code becomes a NUL again.
 
<syntaxhighlight lang="txrlisp">(defundefvarl bwteof (str"\xDC00")
 
(defun bwt (str)
(if (contains eof str)
(error "~s: input may not contain ~a" %fun% eof))
543

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.