Skip to content

386Kite

Latest

Choose a tag to compare

@callmesalmon callmesalmon released this 20 Nov 21:38
· 29 commits to main since this release

This is a new release. Has been brewing for two weeks now, but not much work. Has been kind of... DEAD. But
now, we are back with a brand new release.

New features

  • Brand new module; func. Named after
    functional programming as it uses that.
    Includes the following functions:
    • loop(func, times, until) - Loops a function (loop->params->index(2) has to be 0)(if you aren't stupid).
  • Syntax changes.

Examples

    let loop = fun(func, times, until)
        if times < until do @(func, times + 1, until)
        else func

    let incr = fun(num)
        num + 1

    let mainloop = fun(k, j, i)
        loop(incr(k), j, i)

    loop(mainloop(1, 5, 25), 0, 10)
    write(tostring(100)

    import io
    io.print(100)

    writeln(tostring(100))

    import io
    io.println(100)
    let println = fun(v)
        writeln(tostring(v)

    let sum = fun(x)
        if x < 2 do x
        else x + sum(x - 1)

    println(sum(3))
    let println = fun(v)
        writeln(tostring(v))

    println((fun(x) if x < 2 do x else x + @(x - 1))(3))
    import io
    io.print(10)
    io.println(20)
    io.print(30)
    let export print = fun(val)
        write(tostring(val))
    let export println = fun(val)
        writeln(tostring(val))
    import func

    let test = fun()
        writeln(tostring(100))

     func.loop(test(), 0, 10)