DEV Community

distantfar
distantfar

Posted on

visibility modifiers in coluber.

Visibility modifiers is a method used in programming to specify the specific object for it's as visible or invisible, the purpose of visibility modifier is to define what is able to access or what is not to be able to access the object.

In coluber it's able to define visibility modifier at several objects:

  1. data.
  2. task.

As an example defined:

public data measurement:
    inch: float
    type_meas: string

public task process():
    serve measurements = measurement(inch: 1.5, type_meas: "meter")

Enter fullscreen mode Exit fullscreen mode

public, defined as visibility modifier it can accessed through main.clbr at the root project or across modules in stdlib or library.

private data measurement:
    inch: float
    type_meas: string

private task process():
    serve measurements = measurement(inch: 1.5, type_meas: "meter")

Enter fullscreen mode Exit fullscreen mode

main.clbr or other modules in both are unable to access the objects for as is the private modifier.

Top comments (0)