Re: [racket-users] Struggling with macros

2015-04-13 Thread Matthias Felleisen
Take a look at the PLAI language and define-type. I recommend you elaborate your syntax into PLAI constructs. On Apr 13, 2015, at 12:40 PM, Nils Van Geele wrote: > On Monday, April 13, 2015 at 6:26:38 PM UTC+2, Alexis King wrote: >> What exactly is the difference here between your define-o

Re: [racket-users] Struggling with macros

2015-04-13 Thread Nils Van Geele
On Monday, April 13, 2015 at 6:26:38 PM UTC+2, Alexis King wrote: > What exactly is the difference here between your define-opcode macro and > Racket’s define-struct form? For example, simply doing (define-struct A2 > result left right relop) would generate make-A2, A2? A2-result, A2-left, etc. >

Re: [racket-users] Struggling with macros

2015-04-13 Thread Alexis King
What exactly is the difference here between your define-opcode macro and Racket’s define-struct form? For example, simply doing (define-struct A2 result left right relop) would generate make-A2, A2? A2-result, A2-left, etc. What you describe is certainly possible, but I don’t think it’s currentl

[racket-users] Struggling with macros

2015-04-13 Thread Nils Van Geele
Hey all, Bit of context: I'm writing a compiler for a course and decided to use Racket. I'm translating an AST to three address code-like instructions. Because I do not want to manually write a great deal of boilerplate code for each opcode, I figured I could use macros. I have a struct `instr