Giter Club home page Giter Club logo

Comments (2)

marcoromagnolo avatar marcoromagnolo commented on September 22, 2024

Package Var (like Global Var but visible only in package namespace) are declared in the same way as Function Var but in different positions.

Examples:
int a
float b
string c
bool d

from fly.

marcoromagnolo avatar marcoromagnolo commented on September 22, 2024

Global Var can be declared everywhere on top declarations by specifying:

  • Visibility:
    • Public visible out of the current namespace.
    • Private visible only into the current file.
    • Default visible only into the current namespace.
  • Constant: modifiable or not at runtime.
  • Type: the type of the variable.
  • Identifier Name which identifies the var uniquely in the visibility defined.
  • Value: a default assigned value (cannot be an expression**).

Some examples:

public int var1
float var2 = 2.0 (default visibility)
private const bool var3 = false

Function Var can be declared only into functions:

  • Visibility: visible only into function scope.
  • Constant: modifiable or not at runtime.
  • Type: the type of the variable.
  • Identifier Name which identifies the var uniquely in the function scope.
  • Value: a default assigned value, can be an expression**.

Some examples:

int var1 (declared but not assigned)
float var2 = 2.0
const bool var3 = false

**expression: it includes a more or less complex calculation on assignment or instruction.

from fly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.