Closed mmatos closed 8 years ago
+1
And we can aim to include open classes (and objects) in Wollok :P It would be very useful for Wollok Game, too.
Another option, I'm brainstorming, can be that Mumuki copy-pastes before exercise's code when current exercise hasn't submits.
Hi,
definitely we need in the future a more sophisticated way of interpolating extra codes into the submission. For example, in Haskell we usually want to add imports in the extra code, but it is not currently possible, since imports can only be in the top of the file.
The same problem applies to Java, for example.
In the case of wollok, interpolating methods is even more complex, since we would need to have multiple non-predefined insertion points, I can't figure out how to solve that without open clases.
Finally, what @PalumboN asks is already reported here #455
To sum up:
Hi @mmatos I am now implementing a advanced interpolation mechanism - initially for wollok, but which is easy to extend to other languages for such situations.
...
-comments. For example: /*...extra...*/
test "...." {
/*...content...*/
}
or
/*...extra...*/
test "...." {
/*...content...*/
}
or
content:
object pepita {
/*...mas metodos...*/
}
extra:
/*<mas metodos#*/
method metodo1() = 4
method metodo2() = 3
/*#mas metodos>*/
test:
/*...content...*/
test "pepita puede volar" {
}
This feature is now available to all languages. Closing
I'm making a guide for Wollok language and it happens a lot that the student needs to copy and paste a lot of code from a previous exercise because the language doesn't have open classes, which means that it's not possible to put in the extra code a class definition with the part of the logic that is required but not requested by the current exercise.
It would be great if it was possible to define a class in the extra code and then incorporate into it the new additions from the solution before appending to the final code that will be used for running the test cases.