expands-to checkers with gensym

64 views
Skip to first unread message

Giorgio Valoti

unread,
Aug 2, 2012, 3:31:04 AM8/2/12
to mi...@googlegroups.com
Hi,
I’m testing a macro expansion with =expands-to=>. The macro being tested uses gensym, though.

Is there a way to ignore the generated symbols within =expands-to=> ?

Thank you
--
Giorgio Valoti

Alex Baranosky

unread,
Aug 3, 2012, 4:14:50 AM8/3/12
to mi...@googlegroups.com
Not really.  :)

I'd recommend you just test the result of *using* the macro instead.

Good luck.

Brian Marick

unread,
Aug 3, 2012, 11:11:11 AM8/3/12
to mi...@googlegroups.com

On Aug 3, 2012, at 3:14 AM, Alex Baranosky wrote:

> I'd recommend you just test the result of *using* the macro instead.

+1.

I have a project that uses macros fairly heavily. It in fact has macros that call functions that write macros. Some of the tests are fairly decently documented for a package that no one uses, and they might serve as examples.

https://github.com/marick/peano



-----
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Occasional consulting on Agile


Giorgio Valoti

unread,
Aug 3, 2012, 12:16:53 PM8/3/12
to mi...@googlegroups.com

Il giorno 03/ago/2012, alle ore 17:11, Brian Marick ha scritto:

>
> On Aug 3, 2012, at 3:14 AM, Alex Baranosky wrote:
>
>> I'd recommend you just test the result of *using* the macro instead.
>
> +1.
>
> I have a project that uses macros fairly heavily. It in fact has macros that call functions that write macros. Some of the tests are fairly decently documented for a package that no one uses, and they might serve as examples.
>
> https://github.com/marick/peano

Sounds like the correct way to handle it. Thank you all for the help.


--
Giorgio Valoti

Giorgio Valoti

unread,
Aug 4, 2012, 3:40:55 AM8/4/12
to mi...@googlegroups.com

Il giorno 03/ago/2012, alle ore 17:11, Brian Marick ha scritto:

>
> On Aug 3, 2012, at 3:14 AM, Alex Baranosky wrote:
>
>> I'd recommend you just test the result of *using* the macro instead.
>
> +1.
>
> I have a project that uses macros fairly heavily. It in fact has macros that call functions that write macros. Some of the tests are fairly decently documented for a package that no one uses, and they might serve as examples.
>
> https://github.com/marick/peano

This package seems very useful and I was wondering what is the relation with Midje, if any. Do you have any plans to fold Peano back into Midje?


Ciao
--
Giorgio Valoti

Brian Marick

unread,
Aug 4, 2012, 10:59:31 AM8/4/12
to mi...@googlegroups.com

On Aug 4, 2012, at 2:40 AM, Giorgio Valoti wrote:
> This package seems very useful and I was wondering what is the relation with Midje, if any. Do you have any plans to fold Peano back into Midje?

I wrote this up as a proof of concept and to give me a better (more compelling) example of logic programming to use in my Software Craftsmanship North America talk.

I think Peano is a good idea -- I sure wish I'd had it on the last two Rails projects I've been working on -- but it won't go any further until and unless I get some Clojure work that needs something like it.

I'd be reluctant to put it in Midje core mainly because it doesn't work "out of the box". In order to use it on your own data, you have to write "selector and generator" code that isn't trivial.
Reply all
Reply to author
Forward
0 new messages