[racket-dev] [plt] Push #23249: master branch updated

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Aug 14 22:46:42 EDT 2011

On Sun, Aug 14, 2011 at 9:29 PM,  <matthias at racket-lang.org> wrote:
> collects/lang/htdp-langs-save-file-prefix.rkt
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --- OLD/collects/lang/htdp-langs-save-file-prefix.rkt
> +++ NEW/collects/lang/htdp-langs-save-file-prefix.rkt
> @@ -1,11 +1,16 @@
>  #lang racket/base
> -(require racket/contract
> +
> +;; ---------------------------------------------------------------------------------------------------
> +;; exports the header for a file saved from a drracket buffer in a menu-selected teaching language
> +
> +(require racket/contract
>          racket/port)

The above stuff is explained in the documentation, no? (If you think
it wasn't clear enough, then an edit belongs in the docs, not here,
imo)

Thanks for the fix below.

>  (provide/contract
>  [htdp-save-file-prefix (listof string?)]
>  [htdp-file-prefix? (-> input-port? boolean?)])
>
> +
>  (define htdp-save-file-prefix
>   (list ";; The first three lines of this file were inserted by DrRacket. They record metadata"
>         ";; about the language level of this file in a form that our tools can easily process."))
> @@ -27,8 +32,7 @@
>     (cond
>       [(null? prefix)
>        (define l (read-line port 'any))
> -       (and (string? l)
> -            (regexp-match #rx"^#reader" l))]
> +       (and (string? l) (pair? (regexp-match #rx"^#reader" l)))]
>       [else
>        (define l (read-line port 'any))
>        (and (string? l)
>



Posted on the dev mailing list.