[racket-dev] weirdest bug ever

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Jan 17 09:50:54 EST 2013

Dang cute. 


On Jan 17, 2013, at 7:03 AM, Pierpaolo Bernardi wrote:

> Hello,
> 
> try the following in the interaction panel of DrRacket:
> 
> (display (integer->char #x2144))
> 
> Or, just put this character in an editor buffer.
> The character is displayed 3 lines below its proper position.
> 
> AFAIK, this character is a normal ‘Letterlike Symbol’. It shouldn't
> have any misterious formatting properties, and it's a character of
> fundamental importance for writing  ¡uʍop ǝpısdn    8^)
> 
> (latest nightly build, on windows 8)
> 
> Puzzled P.
> 
> ========
> #lang racket
> 
> (provide upside-down)
> 
> (define table
>  (let ()
>    (define (putin t s1 s2)
>      (for/fold ((t t))
>        ((c1 (in-string s1))
>         (c2 (in-string s2)))
>        (hash-set t c1 c2)))
>    (for/fold ((t (hash)))
>      ((pair (in-list '(("abcdefghijklmnopqrstuvwxyz?!’._()[]{}<>;"
>                         "ɐqɔpǝɟƃɥıɾʞןɯuodbɹsʇnʌʍxʎz¿¡,˙‾)(][}{><؛")
>                        ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
>                         "∀qƆpƎℲפHIſʞ˥WNOԀQɹS┴∩ΛMX⅄Z")
>                        ))))
>      (putin t (first pair) (second pair)))))
> 
> (define (upside-down string)
>  (list->string
>   (reverse
>    (for/list ((c (in-string string)))
>      (hash-ref table c c)))))
> 
> ========
> 
> _________________________
>  Racket Developers list:
>  http://lists.racket-lang.org/dev



Posted on the dev mailing list.