Re: [racket-users] When to use functions vs macros

2016-10-11 Thread David Storrs
On Tue, Oct 11, 2016 at 2:16 PM, Philip McGrath wrote: > This doesn't address functions vs macros, but have you considered > call-with-transaction >

Re: [racket-users] When to use functions vs macros

2016-10-11 Thread Philip McGrath
This doesn't address functions vs macros, but have you considered call-with-transaction ? On Tue, Oct 11, 2016 at 1:10 PM Greg Hendershott

Re: [racket-users] When to use functions vs macros

2016-10-11 Thread Greg Hendershott
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. 2. Maybe `with-handlers` would work better? -- You received this message because you are

[racket-users] When to use functions vs macros

2016-10-11 Thread David Storrs
The general question is "when should I prefer functions versus macros?" but a specific example would be this: I'm doing some database programming and I wanted a thing that would handle transactions for me. Doing it as a function would look something like this: (define (in-transaction dbh body)