| Thread overview |
|---|
January 26, 2011 Re: const/immutable member functions | ||||
|---|---|---|---|---|
| ||||
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.
| ||||
January 26, 2011 Re: const/immutable member functions | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Kagamin | 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 } > ReturnType funcAttributes funcName(params) { 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 | |||
January 26, 2011 Re: const/immutable member functions | ||||
|---|---|---|---|---|
| ||||
Posted in reply to spir | spir Wrote: > >> > attribute funcName inputParams -> outputParams { body } > > ReturnType funcAttributes funcName(params) { 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. | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply