alcides / aeon

Aeon programming language
https://alcides.github.io/aeon/
8 stars 3 forks source link

Syntax: Function arguments #43

Closed alcides closed 6 months ago

alcides commented 6 months ago

Right now the syntax for arguments is:

def my_function (x:Int, y:Int) : Int { x + y }

To be consistent with lean4, and to avoid confusion with function calls (we call my_function 3 4 and not my_function(3,4)), it would be better to support the following syntax:

def my_function (x:Int) (y:Int) : Int { x + y }

This syntax has another big advantage:

We can now replace refined types {x:Int | x > 0} with (x:Int | x > 0)

def my_function (x:Int | x > 0) (y:Int | y > x) : (z:Int | z < 1000) { x + y }

How to implement this feature: