uqbar-project / wollok

Wollok Programming Language
GNU General Public License v3.0
60 stars 16 forks source link

Introduce wollok.lang.Closure #369

Closed javierfernandes closed 8 years ago

javierfernandes commented 8 years ago

I believe that this requires either having many classes like Closure0, Closure1, Closure2, Closure3.. .etc.. for different numbers of parameters, either supporting varargs for the "apply method"

method apply(arguments...) {
}
npasserini commented 8 years ago

I like the varargs!

javierfernandes commented 8 years ago

Varargs already implemented in #371 Now we just need to model the wollok.lang.Closure and remove the 100% native class and refactor the whole interpreter

javierfernandes commented 8 years ago

Done !

For the moment, it just has this

    /**
     * @author jfernandes
     * @since 1.3
     * @noInstantiate
     */
    class Closure {
        method apply(parameters...) native
        method toString() native
    }