(Quick Reference)

4 Invoking Functions - Reference Documentation


Version: 2.0.0.RC2

4 Invoking Functions

Clojure functions may be invocations from Grails artefacts look like normal method calls made on a property named clj.

// grails-app/controllers/demo/DemoController.groovy

package demo

class DemoController {

def add(int x, int y) { // this will invoke the add_numbers clojure function… def sum = clj.add_numbers(x, y)

render "The sum of $x and $y is $sum" } }