• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing a DSL in Groovy

 
Clifton Craig
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Tug Wilson
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ciff!

I've tried to answer your question in the usr mailing list.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic