Skip to content



Multiple calls, member accesses, and indexed accesses can be chained together. Let us first look at the declaration of the class we need for the example:

class LinearRegression() {
    fun drawAsGraph()

This is a class LinearRegression, which has a constructor and an instance method called drawAsGraph.

We can then use those declarations in a segment:

segment mySegment(regressions: List<LinearRegression>) {

This segment is called mySegment and has a parameter regressions of type List<LinearRegression>.

In the body of the segment we then

  1. access the first instance in the list using an indexed access,
  2. access the instance method drawAsGraph of this instance using a member access,
  3. call this method.