aviatorscript
viatorScript 5.4.3
English Documentation | Chinese Documentation
AviatorScript
is a high-performance, lightweight scripting language hosted on the JVM (including the Android platform).
It's not a game, it's a programming language. Please refrain from sending me any more unsolicited emails.RTFM
+-*/
to participate in operations.Usage scenarios include:
It is recommended to use version 5.2.6 and above
getFunctionNames
method to obtain the function list and set the evaluation timeout, etc.< dependency >
< groupId >com.googlecode.aviator</ groupId >
< artifactId >aviator</ artifactId >
< version >{version}</ version >
</ dependency >
Available versions can be viewed at search.maven.org.
PATH
environment variable), such as ~/bin/aviator
: $ wget https://raw.githubusercontent.com/killme2008/aviator/master/bin/aviator
$ chmod u+x aviator
aviator
command will automatically download the latest document version aviator jar to the installation directory under ~/.aviatorscript
and run: $ aviator
Downloading AviatorScript now...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 153 100 153 0 0 111 0 0:00:01 0:00:01 --:--:-- 111
100 1373k 100 1373k 0 0 689k 0 0:00:01 0:00:01 --:--:-- 689k
Usage: java com.googlecode.aviator.Main [file] [args]
: java com.googlecode.aviator.Main -e [script]
: java com.googlecode.aviator.Main -v
hello.av
: p ( "Hello, AviatorScript!" ) ;
let a = tuple ( 1 , 2 , 3 , 4 , 5 ) ;
p ( "sum of a is: " + reduce ( a , + , 0 ) ) ;
let date = new java . util . Date ( ) ;
p ( "The year is: " + getYear ( date ) ) ;
p ( "The month is: #{getMonth(date)}" ) ;
For an example of a more complex calculator (evaluating a string of arithmetic expressions) see calculator.av.
$ aviator hello.av
Hello, AviatorScript !
sum of a is: 15
The year is: 120
The month is: 3
Please read the user guide for more details.