[plt-dev] Racket web page

From: Jon Rafkind (rafkind at cs.utah.edu)
Date: Tue May 25 16:51:15 EDT 2010

Since all the code is extremely public can I make a strong request that 
variable names not be single letter characters? Some short word would be 
preferable.

I'm willing to fix all the code (assuming its in svn/git somewhere) if 
no one feels like updating the examples.

On 05/25/2010 02:43 PM, Guillaume Marceau wrote:
> ;; Indents a multi-line string by n spaces
> #lang racket
> (define (indent str n)
>    (define blanks (make-string n #\space))
>    (string-join
>     (for/list ([line (regexp-split #"\n" str)])
>       (format "~a~a" blanks line))
>     "\n"))
>
>
> ;; Another attempt at shrinking the google query example. Is this
> still too wide?
> #lang racket
> (require net/url net/uri-codec)
> (define (google-query q)
>    (let ([g "http://www.google.com/search?q="]
>          [u (string-append g (uri-encode q))]
>          [rx #rx"(?<=<h3 class=\"r\">).*?(?=</h3>)"])
>      (regexp-match* rx (get-pure-port (string->url u)))))
> _________________________________________________
>    For list-related administrative tasks:
>    http://list.cs.brown.edu/mailman/listinfo/plt-dev
>    



Posted on the dev mailing list.