[plt-scheme] Resources in the transformer environment

From: Jon Zeppieri (zeppieri at gmail.com)
Date: Thu Oct 26 23:12:54 EDT 2006

On Fri, 27 Oct 2006 08:13:22 0800, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> Would it make sense to have a form like
>
>  (with-database
>   "host.domain.foo" 3306 "my_username" "my_password" "my_schema"
>   <body>)
>
> that opened the database both a compile time and at run time? The macro
> might be implemented as mostly
>
>   (dynamic-wind
>    (lambda () <...open the database...>)
>    (lambda () ... (local-expand <body> ...) ...)
>    (lambda () <...close the database...>))
>
> but the expansion of <body> would also be wrapped with a similar
> `dynamic-wind' to perform the same DB open and close.


Yes.  This is exactly the sort of thing I was looking for.  Thanks, Matthew.

-Jon



>
>
> Matthew
>
>


Posted on the users mailing list.