[plt-scheme] let-values/invoke-unit?
On 3/8/07, Ryan Culpepper <ryan_sml at yahoo.com> wrote:
>
> You can use 'define-values/invoke-unit' as an internal definition,
> like this:
>
> (let ()
> (define-values/invoke-unit my-unit@ (import sig1^) (export sig2^))
> do-some-things)
>
> In fact, you can write 'let-values/invoke-unit' as a macro yourself,
> in terms of internal 'define-values/invoke-unit'. Here's how it would
> look, using a syntax I just made up:
>
> (define-syntax let-values/invoke-unit
> (syntax-rules ()
> [(let-values/invoke-unit ((sig ...) unit-expr import-sig ...) .
> body)
> (let ()
> (define-values/invoke-unit unit-expr
> (import import-sig ...)
> (export sig ...))
> (begin . body))]))
>
> Hope that helps!
>
Then I guess you can just access the exported values in the let
namespace by their exported names. Thank you.
Cheers,
Paulo matos
> Ryan
>
>
> >
> > Cheers,
> > --
> > Paulo Jorge Matos - pocm at soton.ac.uk
> > http://www.personal.soton.ac.uk/pocm
> > PhD Student @ ECS
> > University of Southampton, UK
> > _________________________________________________
> > For list-related administrative tasks:
> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> >
>
>
>
>
> ____________________________________________________________________________________
> The fish are biting.
> Get more visitors on your site using Yahoo! Search Marketing.
> http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
>
>
>
--
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK