digitalmars.D - Re: const/immutable member functions
- Kagamin <spam here.lot> Jan 26 2011
- spir <denis.spir gmail.com> Jan 26 2011
- Kagamin <spam here.lot> Jan 26 2011
foobar Wrote:This "problem" happens because D belongs to the C-family of languages which puts the return type _before_ the function name. Languages that don't follow this syntactic convention (some would call it a mistake) have it very consistent and readable: attribute funcName inputParams -> outputParams { body }
ReturnType funcAttributes funcName(params) { body } BTW the problem is in separation of function attributes from return type attributes. I'm afraid, your example doesn't solve it.
Jan 26 2011
On 01/26/2011 11:02 AM, Kagamin wrote:This "problem" happens because D belongs to the C-family of languages which puts the return type_before_ the function name.Languages that don't follow this syntactic convention (some would call it a mistake) have it very consistent and readable: attribute funcName inputParams -> outputParams { body }
So what?BTW the problem is in separation of function attributes from return type attributes. I'm afraid, your example doesn't solve it.
??? what do you /actually/ mean? attribute funcName inputParams -> attribute outputParams { body } Denis -- _________________ vita es estrany spir.wikidot.com
Jan 26 2011
spir Wrote:attribute funcName inputParams -> outputParams { body }
So what?
So there's no need for FP-style syntax to just disambiguate attribute placing.BTW the problem is in separation of function attributes from return type attributes. I'm afraid, your example doesn't solve it.
??? what do you /actually/ mean? attribute funcName inputParams -> attribute outputParams { body }
Look at the return type attribute. Whether it's a function attribute or type constructor? Both come first.
Jan 26 2011