Skip to content

Releases: eobrain/funcgo

Double-space reguired around infix function calls

19 Oct 00:17

Choose a tag to compare

This release is mostly a change to the parser to handle whitespace in a uniform way.

The major change that is that the infix function-calling syntax requires two spaces around the function name. For example note the two spaces around str below:

    greeting := "Hello "
    name := "Eamonn"
    greeting  str  name

=> "Hello Eamonn"

which is equivalent to

    greeting := "Hello "
    name := "Eamonn"
    str(greeting,  name)

=> "Hello Eamonn"

Operator Overloading and new Clojure Escape Syntax

17 Jul 06:11

Choose a tag to compare

You can now name your functions to be the same as the built-in operators like + and *, allowing a simple form of overloading.

This release also introduces a new syntax using pairs of \ characters to literally include Clojure code.

See the Operator Overloading section in the reference doc.

:= Specifies Constant

07 Jul 04:38

Choose a tag to compare

The major change in this release is that the := operator now defines a constant (which compiles to a let binding in Clojure).

In Version 0.2.7 and earlier:

  • constants were specified with const
  • vars were specified with either var or :=

In Version 0.3.0 and later:

  • constants are specified with const or :=
  • vars are specified with var

This may cause breaking changes to your code because:

  1. Any := that are not at the top of a block will now cause a syntax error.
  2. The scope of the identifier is now only the block it is defined in. (Before it was either global or file-scope.)

The reason for this change is to encourage functional programming with immutable values as much as possible, by making the syntax for constants to be the less-verbose form. Also this syntax is more consistent with the other uses of := in for loops and if-else expressions.

For more details see the Const section of the language reference