You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unary operator (like ~ or !) defined for all stock types as producing a string. e.g.:
int n = 3;
string s1 = $n; // s == "3"vector v = Vector(1.0, 2.0, 3.0);
string s2 = $v; // s == "{1.0, 2.0, 3.0}"string s = "hello";
string s3 = $s; // s3 == "hello"
This would allow you to print a variable as string regardless of its actual input type, which allows for better code reuse, especially if coupled with a macro system of sorts.
As a stretch goal, it could support custom types too, as:
Unary operator (like
~
or!
) defined for all stock types as producing a string. e.g.:This would allow you to print a variable as string regardless of its actual input type, which allows for better code reuse, especially if coupled with a macro system of sorts.
As a stretch goal, it could support custom types too, as:
Would need VM changes, but the bulk is compiler-side
The text was updated successfully, but these errors were encountered: