Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Add a short example of varargs in action signature (issue sarl/sarl#1).
Browse files Browse the repository at this point in the history
  • Loading branch information
gallandarakhneorg committed May 15, 2014
1 parent 7f21582 commit 3ad20cb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/sarl/io/sarl/demos/basic/iddle.sarl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.sarl.demos.basic

import io.sarl.core.Initialize
import java.util.Arrays

/*
* An agent that does nothing.
Expand All @@ -9,6 +10,12 @@ agent IddleAgent{

on Initialize {
System.out.println("I'm alive!")
aFunction(true, 3, 4, 5)
}

def aFunction(arg1 : boolean, arg2 : int...) {
System.out.println(arg1)
System.out.println(Arrays.toString(arg2))
}

}

0 comments on commit 3ad20cb

Please sign in to comment.