3 ms·
The problem with this is print is a macro and that macros are expanded before the type checker. This makes it impossible to know if something can be copied or n
by JelteF 10y ago
The problem with this is print is a macro and that macros are expanded before the type checker. This makes it impossible to know if something can be copied or not, because this is type information.
- acqq 10y agoI believe it could be a solvable problem? Imagine that the macro expands every parameter x to some language construct f( x ) where f( x ) has access to the type of x and the type of its result is different depending of the type of x, returning a value for for int and float-like variables, and the reference for others.