Go to file
Brian Picciano c5aa582226 Improve semantics of tokens and values obtained from them.
Now gg.Values can carry the token used to parse them, which will be
useful later when generating errors.
2021-12-28 09:49:02 -07:00
gg Improve semantics of tokens and values obtained from them. 2021-12-28 09:49:02 -07:00
gim rename Junction to Tuple, update syntax, rename Null to ZeroGraph 2021-08-26 21:26:24 -06:00
sandbox rename Junction to Tuple, update syntax, rename Null to ZeroGraph 2021-08-26 21:26:24 -06:00
.gitignore gitignore 2016-08-07 09:06:36 -06:00
go.mod make into a module 2021-08-26 21:27:47 -06:00
go.sum make into a module 2021-08-26 21:27:47 -06:00
README.md Remove a bunch of old code, update the README 2021-08-26 21:25:39 -06:00

Ginger

Fibonacci function in ginger:

fib {
    decr { out add(in, -1) }

    out {
        n 0(in),
        a 1(in),
        b 2(in),

        out if(
            zero?(n),
            a,
            recur(decr(n), b, add(a,b))
        )

    }(in, 0, 1)
}

Usage of the function to generate the 6th fibonnaci number:

fib(5)