[racket-users] Re: What do you use macros for?

2016-04-12 Thread George Neuner
On Wed, 13 Apr 2016 06:45:01 +1000, Daniel Prager wrote: >Thanks George > >Of interest to me is that you eschew the use of syntax-parse / -case / >-rules in favour of a straight syntax->datum -> straight racket -> >datum->syntax solution. I suppose this approach trades

Re: [racket-users] Re: What do you use macros for?

2016-04-12 Thread Daniel Prager
Thanks George Of interest to me is that you eschew the use of syntax-parse / -case / -rules in favour of a straight syntax->datum -> straight racket -> datum->syntax solution. I suppose this approach trades away hygiene and error-checking for simplicity. Also, nice trick appropriating

Re: [racket-users] Re: What do you use macros for?

2016-04-12 Thread George Neuner
Hi Dan, On 4/11/2016 6:51 PM, Daniel Prager wrote: On Apr 12, 2016 7:53 AM, "George Neuner" wrote: > > My most common uses are to handle database connections and > to embed free form SQL into Racket code. Care to post one of your examples, with a bit of commentary?

Re: [racket-users] Re: What do you use macros for?

2016-04-11 Thread Benjamin Greenman
Today I decided to convert all structure definitions in a Typed Racket file to lists. For instance, (struct foo ([x : Integer])) would become a tagged list: (define-type foo (Pairof 'foo (List Integer))) along with a constructor, predicate, and accessors. Using a macro, I was able to write

Re: [racket-users] Re: What do you use macros for?

2016-04-11 Thread Daniel Prager
On Apr 12, 2016 7:53 AM, "George Neuner" wrote: > > On Mon, 11 Apr 2016 10:25:46 -0400, Matthias Felleisen > wrote: > > >These days I define little macros inside of loops or methods all the time. > > Same here. My most common uses are to handle

[racket-users] Re: What do you use macros for?

2016-04-11 Thread George Neuner
On Mon, 11 Apr 2016 10:25:46 -0400, Matthias Felleisen wrote: >These days I define little macros inside of loops or methods all the time. Same here. My most common uses are to handle database connections and to embed free form SQL into Racket code. George -- You

[racket-users] Re: What do you use macros for?

2016-04-08 Thread George Neuner
On Fri, 8 Apr 2016 15:49:32 +0200, Jerzy Karczmarczuk wrote: >Le 08/04/2016 15:40, George Neuner a écrit : > >> Macros (at least Lisp and Scheme style macros) can change the nature >> of the eventual runtime evaluation. > >What do you mean by the 'nature' of the

Re: [racket-users] Re: What do you use macros for?

2016-04-08 Thread Jerzy Karczmarczuk
Hi. Le 08/04/2016 15:40, George Neuner a écrit : Macros (at least Lisp and Scheme style macros) can change the nature of the eventual runtime evaluation. What do you mean by the 'nature' of the evaluation? Do you thnk that macro change the operational semantics of the language, or what?...

[racket-users] Re: What do you use macros for?

2016-04-08 Thread George Neuner
On Fri, 08 Apr 2016 12:10:39 +0100, "Norman Gray" wrote: >Quoting Asumu quoting Matthias: > >>> I'd like to propose that there are three disciplined uses of macros: >>> >>> 1. data sublanguages: I can write simple looking expressions and >>> [...] >>> >>> 2. binding