...
On Wednesday, 27 April 2016 at 18:34:18 UTC, Artur Skawina wrote:
...
ref M() { return matrix.rawArr; }
ref Ex1() { return e1.someProperties.someModulusX; }
...
If the generated code is equal, without relying on too much
optimization, I agree this is close enough, although
On Thursday, 28 April 2016 at 11:39:22 UTC, Seb wrote:
If it's just about syntax sugar, I definitely would prefer to
be able to use alias over ref, e.g.
alias v = el.someProperties.aRatio;
The main issue with this currently is that you can only alias
symbols, but el.someProperties.aRatio is
On Thursday, 28 April 2016 at 11:10:21 UTC, Artur Skawina wrote:
On 04/28/16 10:28, Adrian Matoga via Digitalmars-d wrote:
On Wednesday, 27 April 2016 at 18:34:18 UTC, Artur Skawina
wrote:
[...]
ref Ex1() { return e1.someProperties.someModulusX; }
Unless any of the properties is an en
On 04/28/16 10:28, Adrian Matoga via Digitalmars-d wrote:
> On Wednesday, 27 April 2016 at 18:34:18 UTC, Artur Skawina wrote:
>> [...]
>>
>>ref Ex1() { return e1.someProperties.someModulusX; }
>
> Unless any of the properties is an enum or, well, a @property, and I'd expect
> both in such
On Wednesday, 27 April 2016 at 18:34:18 UTC, Artur Skawina wrote:
[...]
void foo (Matrix matrix, SameType e1, SameType e2)
{
ref M() { return matrix.rawArr; }
ref Ex1() { return e1.someProperties.someModulusX; }
ref Ey1() { return e1.someProperties.someModulusY; }
On 04/27/16 15:55, deed via Digitalmars-d wrote:
>
> A stronger example would be a scope with two similar types, i.e.:
>
> void foo (Matrix matrix, SameType e1, SameType e2)
> {
> with (
> M: matrix.rawArr;
> Ex1 : e1.someProperties.someModulusX,
> Ey1 : e1.someProperties.so
On Tuesday, 26 April 2016 at 12:53:49 UTC, deed wrote:
For example:
A stronger example would be a scope with two similar types, i.e.:
void foo (Matrix matrix, SameType e1, SameType e2)
{
with (
M: matrix.rawArr;
Ex1 : e1.someProperties.someModulusX,
Ey1 : e1.somePropertie
On Tuesday, 26 April 2016 at 12:53:49 UTC, deed wrote:
Would it be possible to extend current with statement's
expressiveness by two lowerings:
1) Alias expression/symbol and replace in macro fashion:
with (a : exprA) { /* use a. will be replaced by exprA by
compiler. */ }
2) Accept a list
Would it be possible to extend current with statement's
expressiveness by two lowerings:
1) Alias expression/symbol and replace in macro fashion:
with (a : exprA) { /* use a. will be replaced by exprA by
compiler. */ }
2) Accept a list of arguments: with (a, b : expr , ...) {} gets
lowered