Quantcast
Channel: User CPlus - Programming Language Design and Implementation Stack Exchange
Viewing all articles
Browse latest Browse all 66

Types and variables in a different namespace

$
0
0

What would it take to design a language that permitted construct such as below?

int int = 10;

Such a language would need to be able to infer contextually whether a type name or an expression is expected. Are there any constructs in a C++ or Java style language that would be equally valid whether a type name or an expression is used in any particular place, making them truly ambiguous if the identifier was both defined as an expression and a type? How can they be worked around syntactically?


Viewing all articles
Browse latest Browse all 66

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>