[plt-dev] language dialog, some minor changes & bugfixes

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Fri Jan 29 16:40:05 EST 2010

PS: I changed the ^ in the regexp to .* so it works for things like

  ;;;; fdask
  #lang scheme

I assume that's what you'd meant?

Robby

On Fri, Jan 29, 2010 at 3:37 PM, Robby Findler
<robby at eecs.northwestern.edu> wrote:
> On Fri, Jan 29, 2010 at 2:24 PM, Eli Barzilay <eli at barzilay.org> wrote:
>> Here's some rough code that is easy to translate to a port instead of
>> a string:
>>
>>  (define (lang-line str)
>>    (let* ([i (open-input-string str)]
>>           [l (read-language i (lambda () '?))])
>>      (if (eq? '? l)
>>        (values "???" '???)
>>        (values (regexp-replace #rx"^#(?:!|lang ) *"
>>                                (substring str 0 (file-position i))
>>                                "")
>>                (l 'module-language '???)))))
>
> This doesn't work for planet packages, right?
>
> Robby
>


Posted on the dev mailing list.