Skip to content

Methods

Martin S. edited this page Oct 8, 2026 · 2 revisions

What is method?

Definition

accessor method Name():
end

Returning value

Definition:

  • This although throws exception as no value is thrown.
accessor method returns Type Name():
end

Example:

public method returns Int GetOne():
    return 1
end

Arguments

Definition:

accessor method Name(type name, type anotherName, type thirdName):
end

Example:

public method returns Int PowerTwo(Int n):
    return n * n;
end

Creates

Creates is special method that allocates targeted class into new object.

  • Usually defined inside object that is allocated by calling this method.
  • [Constructor] is used for runtime, so it map new keyword to Ipsum class resulting in new Ipsum(int)

Definition

public static method creates TargetedClass Name(args):
end

Example

module Lorem:
    public class Ipsum:
        public int Dolor
        [Constructor]
        public static method creates Ipsum Ctor(int dolor):
            self.Dolor = dolor
            return self
        end
    end
end

Clone this wiki locally