wood burning stoves 2.0*
The moose likes Groovy and the fly likes Writing a DSL in Groovy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Writing a DSL in Groovy" Watch "Writing a DSL in Groovy" New topic
Author

Writing a DSL in Groovy

Clifton Craig
Ranch Hand

Joined: May 26, 2006
Posts: 103
I'm sorry for cross posting on the mailing list but I just saw the blurb on aboutgroovy.com about the contest and, well shucks, I want that book! My question: I'm looking all over the Groovy site for answers on how to add methods and properties globally to all objects defined in a scope and so far I've come across a link regarding writing DSLs. Since that is what I'm doing (with my experimental GSpec stuff) I followed the link and it pointed me to the GroovyObject interface, saying that implementing this interface could be a way of defining a DSL. If I implement a custom GroovyObject how do I make plug it in to be used for a chunk of code? What I'm trying to do (initially) is add properties and methods to all objects within a script. I'm not really sure if my approach is right so feel free to offer alternative approaches.

Cliff
Tell me what's up...
http://codeforfun.wordpress.com


Holla at me...<br /><a href="http://codeforfun.wordpress.com" target="_blank" rel="nofollow">http://codeforfun.wordpress.com</a>
Tug Wilson
Ranch Hand

Joined: Dec 12, 2006
Posts: 33
Hi Ciff!

I've tried to answer your question in the usr mailing list.
 
Don't get me started about those stupid light bulbs.
 
subject: Writing a DSL in Groovy