[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [plt-scheme] Re: webserver and print-struct

Have you tried generating an executable from DrScheme? 
If you are within a teaching language, your exectuable
should in principle have the exact same behavior as 
from within DrScheme. You can inspect the launcher (unless
you compile it) easily and figure which language is being 
require'd and then construct mzscheme scripts in the future
without the luxury of DrScheme. -- Matthias

At Thu, 2 May 2002 23:25:35 +0200, Jens_Axel_Søgaard wrote:
> Paul Graunke wrote:
> > Check help-desk for print-convert.  You might get it to do what you
> > need with the right hooks installed (current-print-convert-hook
> > [hook]).
> This is quite clever. I will add it to the good old bag'o'tricks.
> But - I still have problems now. I end up with stuff like this in output
> file
> (quasiquote ((unquote #<struct:entry>) (unquote #<struct:entry>)))
> The #<struct:entry> ought to be (make-struct ..)-thingies.
> Now the behaviour in DrScheme and in the web-server are not the same.
> It has proably something to do with language settings or parametrizations.
> Reading the manual the solution ought to be to use (print-struct #t),
> but for some reason the web-server does not respect it.
> (Or at least: that's way it seems - I could have missed something)
> My functions are
> (define (load-book)
>   (let* ([port (open-input-file filnavn)]
>          [book (eval (read port))])
>     (close-input-port port)
>     (map convert-entry book)))
> (define (save-book)
>   (let ([port (open-output-file filename 'replace)])
>     ;  (print-struct #t)
>     (write (print-convert book) port)
>    ; (pretty-print (print-convert bog) port)  ; this is no better
>     (close-output-port port)))
> [ The pconvert.ss documentation has a small bug:
>    "In addition to print-convert, this library provides print-convert, ...
> " ]
> --
> Jens Axel Søgaard