need examples to understand postfix expression grammar

Bastiaan Veelo Bastiaan at Veelo.net
Sun Apr 16 19:41:19 UTC 2023


On Sunday, 16 April 2023 at 16:59:21 UTC, FabArd wrote:
> Hi,
>
> I have trouble understanding these two rules of grammar :
>
> PostfixExpression:
> - PostfixExpression ( ArgumentList<sub>opt</sub> )
> - TypeCtorsopt BasicType ( ArgumentList<sub>opt</sub> )
>
> It seems to me that the first rule corresponds to a function 
> call expression.
> Is my analysis correct?

I think it is.

> As for the second one, I don't understand how to use it.
> Can you give me examples of how to use it?

I think `double(2)` would be an example, as in

```d
assert(1 / double(2) == 0.5);
```

-- Bastiaan.


More information about the Digitalmars-d mailing list