Re:Open-sourcing MonkeyType – Let your Python code type-hint...
by nickelbox on Friday December 22, 2017 @05:12PM
(#15991336)
The macro would only be used to generate k for convenience. It could be all implemented in straight, macro-less C++98 in O(minutes).
My point was just that you can implement almost whatever you want (even without macros, they'll just expand the design space).
Re:Open-sourcing MonkeyType – Let your Python code type-hint...
by joshuamorton on Friday December 22, 2017 @05:18PM
(#15991378)
I don't see how you could implement the (k.attr).for_(k) part. That's essentially an assignment, a macro could maybe convert it to a lambda, but I don't see how it would be done macro-free.
The other thing to note is that
is essentially already typechecked: The above code now has all the same type guarantees as your c++, actually maybe more since the macros you use are going to be...uhhh, mysterious.