This is a bug in the optimizer. The `bytes-utf-8-length` function is incorrectly marked as always returning a fixnum. I'll push a repair.
Meanwhile, to work around the bug, use something like this: (define non-broken-bytes-utf-8-length bytes-utf-8-length) ;; To confuse and work around the optimizer: (set! non-broken-bytes-utf-8-length non-broken-bytes-utf-8-length) At Fri, 8 Dec 2017 15:58:32 -0800 (PST), Jonathan Simpson wrote: > Welcome to DrRacket, version 6.11 [3m]. > Language: racket, with debugging; memory limit: 128 MB. > > (if (bytes-utf-8-length (bytes 255)) 1 2) > 1 > > (bytes-utf-8-length (bytes 255)) > #f > > (not (bytes-utf-8-length (bytes 255))) > #f > > Can anyone explain this to me? Surely the output of the last line should be > #t. Is it a bug? > > It happens with both 6.11 and 6.3. I know there must be a rational > explanation, so please enlighten me! > > Thanks, > Jonathan -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.