File: functions1.mvel

package info (click to toggle)
mvel 2.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,316 kB
  • sloc: java: 46,157; xml: 292; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 348 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
 * Sample MVEL 2.0 Script
 * "Functions Demonstration"
 * by: Christopher Michael Brock
 */

def isGood(obj) {
        return !(obj.toLowerCase() contains "evil");
}

def describe(obj) {
        System.out.println(obj + " is " + (isGood(obj) ? "Good" : "Evil"));
}

$test1 = "Mr. Good";
$test2 = "Mr. Evil";

describe($test1);
describe($test2);