Abstract
Groovy is a dynamic language that allows the easy modification of its own behaviour. A simple mechanism to introduce changes in the core language is by using Abstract Syntax Tree(AST) transformations. In this paper we describe two new features added to Groovy: the introduction of Reification, and the enhancement of Groovy Closures. In the first extension we make it possible for the user to know the types of a generic class during runtime. In the second one, Groovy closures were improved with the addition of two methods: one to provide closures return type and another to give the closure’s source code.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
DZone GContracts 1.0, http://groovy.dzone.com/announcements/gcontracts-10-released
First Lambda Expression, http://diarmuidmoloney.wordpress.com/2011/12/10/my-first-java-8-lambda-expression/
GContracts A Programming by Contract Extension for Groovy!, https://github.com/andresteingress/gcontracts/wiki
GPars Groovy Parallel Systems, http://gpars.codehaus.org/
Groovy, http://groovy.codehaus.org/
Java 8 - Closures, Lambda Expressions Demystified, http://frankhinkel.blogspot.pt/2012/11/java-8-closures-lambda-expressions.html
Axelsen, E.W., Krogdahl, S.: Groovy package templates: supporting reuse and runtime adaption of class hierarchies. ACM SIGPLAN Notices 44(12), 15–26 (2009)
Burmako, E.: Scala macros: Let our powers combine. In: Proceedings of the 4th Annual Scala Workshop (2013)
Cazzola, W., Vacchi, E.: Fine-grained annotations for pointcuts with a finer granularity. In: Shin, S.Y., Maldonado, J.C. (eds.) SAC, pp. 1706–1711. ACM (2013)
Cazzola, W., Vacchi, E.: @java: annotations in freedom. In: Shin, S.Y., Maldonado, J.C. (eds.) SAC, pp. 1688–1693. ACM (2013)
Cortinhas, C., Barros, F.: Extending the groovy language using ast transformations to monitor variables and methods. In: Rocha, Á., Correia, A.M., Wilson, T., Stroetmann, K.A. (eds.) Advances in Information Systems and Technologies. AISC, vol. 206, pp. 745–752. Springer, Heidelberg (2013)
Dinkelaker, T., Mezini, M.: Dynamically linked domain-specific extensions for advice languages. In: Proceedings of the 2008 AOSD Workshop on Domain-Specific Aspect Languages, 3 p. ACM (2008)
Heinlein, C.: Most-flexipl: modular, statically typed, flexibly extensible programming language. In: Proceedings of the ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, pp. 159–178. ACM (2012)
König, D., Paul, P.K., Laforge, G., Jon, J.S.: Groovy in Action, 2nd edn. Manning (2011)
Naftalin, M., Wadler, P.: Java generics and collections. O’Reilly (2009)
Wada, H., Suzuki, J.: Modeling turnpike frontend system: A model-driven development framework leveraging uml metamodeling and attribute-oriented programming. In: Briand, L.C., Williams, C. (eds.) MoDELS 2005. LNCS, vol. 3713, pp. 584–600. Springer, Heidelberg (2005)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer International Publishing Switzerland
About this paper
Cite this paper
Cortinhas, C., Barros, F. (2014). Extending Groovy’s Reification and Closures. In: Rocha, Á., Correia, A., Tan, F., Stroetmann, K. (eds) New Perspectives in Information Systems and Technologies, Volume 2. Advances in Intelligent Systems and Computing, vol 276. Springer, Cham. https://doi.org/10.1007/978-3-319-05948-8_1
Download citation
DOI: https://doi.org/10.1007/978-3-319-05948-8_1
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-05947-1
Online ISBN: 978-3-319-05948-8
eBook Packages: EngineeringEngineering (R0)