Tagged Questions
6
votes
6answers
1k views
Would a “downcast if block” be a reasonable language feature?
Consider the following "if cast":
class A { public void f1() { ... } }
class B : A { public void f2() { ... } }
A a = foo(); // might return A or B
if ( a is B ) {
// Inside block, ...
3
votes
2answers
267 views
Variable declaration versus assignment syntax
Working on a statically typed language with type inference and streamlined syntax, and need to make final decision about syntax for variable declaration versus assignment. Specifically I'm trying to ...
6
votes
1answer
5k views
A combined if/switch statement syntax with exception handling for a C#-inspired language
It is sometimes necessary to try/catch exceptions inside the "if" condition, but not the body that follows. In C#, this is really rather cumbersome, requiring locals and code that isn't entirely ...
3
votes
5answers
999 views
Which programming languages doesn't use operator precedence besides Lisp like languages? [closed]
And what do you think about operator precedences? Would be harder programming in language where the operations are executed in sequential order?
Ex.:
2 + 3 * 4 == 20
2 + (3 * 4) == 24
Ok, Lisp ...