I confess — I am a traitor. Over a week ago I enrolled in Coursera course “Discrete Optimization” by Prof. Pascal Van Hentenryck and it is frustratingly interesting if I may say that. Since I love computational challenges I was hooked in since the first assignment. I tried to keep the weekend only for Skila, but I failed — writing one thing, and thinking about other makes no sense, so I switched and worked on DO almost entire Sunday. But don’t despair, I am a thorough guy, I wrote down how many hours I borrowed from Skila.
It doesn’t mean I did nothing — however only a little additions and improvements:
- I optimized backend in case of non-virtual types (simply no virtual table),
- in backend layer interfaces are classes with empty methods — this allows to safely call a method when derived class hides it,
- I added standalone functions — this required surprisingly some work,
- I already mentioned covariance when it comes to polymorphic methods,
- Skila supports 4 types of expressing the base for numbers like in Python — “
124
” for decimal, “0xCAFE
” for hexadecimal, “0o57
” for octal and “0b010101
” for binary, - numbers can be expressed with padding as in Ruby — “
450_010
” is exactly the same as “450010
” only reading is easier,
Next point is exposing back shadowed methods — I have in mind three cases:
using base::foo(Int); using base::foo(*); using base::foo;
The first one brings up method foo
with given signature, joker “*
” in the second line brings all foo
methods. And third one is a shortcut — if there is only one method foo
in inherited class it will be brought up. If there are more — compiler will give you an error.
And that’s all for the Saturday, I am running back to DO assignments…