Idea : Expression Type

Xinok xnknet at gmail.com
Fri Feb 2 11:17:54 PST 2007


Functions aren't powerful enough to be used in place of expressions.

-- Functions can't return references, which prevents you from using them as l-values. The best you can do is return a pointer, which you have to manually dereference.
-- All of the types in an expression are automatic, including the return type. Getting the parameter types for a function can be simple, but the return type can be difficult.
-- Functions can't take full advantage of features like conditionals, because conditionals can have two or more possible 'return types'. Functions can only return a single type.



More information about the Digitalmars-d mailing list