apoch / epoch-language

Home of the Epoch Programming Language Project
Other
72 stars 3 forks source link

Constructors need to be reimplemented #146

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Aggregate type constructors need to be built back into the compiler:

structure foo :
    integer mandatory,
    integer optional

foo : integer mandatory -> foo ret = mandatory, 999 [constructor]

entrypoint :
{
    foo simple = 42
    foo complex = 666, 777

    assert(simple.mandatory == 42)
    assert(simple.optional == 999)

    assert(complex.mandatory == 666)
    assert(complex.optional == 777)

    print("Pass")
}

Anonymous temporaries should be considered separately; they rely on this 
functionality but comprise a distinct feature.

Original issue reported on code.google.com by don.ap...@gmail.com on 2 Apr 2012 at 3:40

GoogleCodeExporter commented 9 years ago

Original comment by don.ap...@gmail.com on 2 Apr 2012 at 3:42

GoogleCodeExporter commented 9 years ago
Assigned to Release 12.

Original comment by don.ap...@gmail.com on 2 Apr 2012 at 4:16

GoogleCodeExporter commented 9 years ago
Implemented; all compiler tests pass.

Original comment by don.ap...@gmail.com on 19 Apr 2012 at 3:06