Fanx programming language version 3.0 release supports two variable declarations style

Fanx 3.0 release. Fanx is object-oriented general-purpose programming language multi-objective. It offers a series of elegant and concise syntax of the standard library and development framework.

In the next variable declaration syntax, some type of written language in front of the variable names, others written on the back. Fanx 3.0 supports two styles:

Int age = 12
var age: Int = 12

fun foo() : Str { .. }
Str foo() { ... }

fanx members declare keywords include: var, let, const, fun, new. Local variables do not need keywords.

It supports two ways for the convenience of other styles of developers, to respect their habits. Of course, we do not advocate mix in a file inside.

Complete some sample code: 

  class Person {
    var age: Int
    let name: Str

    new make(n: Str) {
      name = n
    }

    fun foo() : Str {
      return name
    }

    static fun main() {
      p : Person = Person("pick")
      s := p.foo
      echo(s)
    }
  }

As the characteristics of the experimental, do you like it?

For details, see: http://fanx.info/

Guess you like

Origin www.oschina.net/news/111956/fanx-3-0-released