On Tue, Oct 11, 2016 at 2:16 PM, Philip McGrath <phi...@philipmcgrath.com>
wrote:

> This doesn't address functions vs macros, but have you considered
> call-with-transaction
> <http://docs.racket-lang.org/db/query-api.html?q=call-with-transaction#%28def._%28%28lib._db%2Fbase..rkt%29._call-with-transaction%29%29>
> ?
>

*headdesk*

Yes, I have absolutely considered that.  In no way did I read through the
docs, note that function, think "oh, that's handy", and then promptly
forget its existence.  I chose not to use it because...reasons?


>
> On Tue, Oct 11, 2016 at 1:10 PM Greg Hendershott <
> greghendersh...@gmail.com> wrote:
>
>> 1. "Both" is sometimes a good answer: Write the function. Then maybe
>> write a macro to do only what only a macro can do -- here, the
>> "de-lambda" sugar, and just call the function to do the real work.
>>
>
So, basically, the macro just wraps the 'thunk' around whatever statements
are provided and then passes the thunk to the function.  That makes sense,
thanks.


>
>> 2. Maybe `with-handlers` would work better?
>>
>>
Work better to pass state between body and after-function?  Or work better
than dynamic-wind?  I thought the advantage of dynamic-wind is that you can
guarantee the after-function will be called regardless of use of
continuations or anything else?


> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to