On 5/22/18 4:40 AM, Robert M. Münch wrote:
On 2018-05-21 18:55:36 +, Steven Schveighoffer said:
When you use the alias, both are using the same exact lambda.
Ok. I didn't expect that the name is relevant in this case, instead
assumed that only the types need to match.
The type is the p
On Tuesday, May 22, 2018 10:40:55 Robert M. Münch via Digitalmars-d-learn
wrote:
> This would require one wrap function per different lambda, right?
> Assume I have 50-100 of these. Maybe the myMessage value can be given
> as parameter and with this becomes more like a "filter factory". Not
> sure
On Tuesday, May 22, 2018 10:43:38 Robert M. Münch via Digitalmars-d-learn
wrote:
> On 2018-05-21 20:17:04 +, Jonathan M Davis said:
> > On Monday, May 21, 2018 16:05:00 Steven Schveighoffer via Digitalmars-d-
> >
> > learn wrote:
> >> Well one thing that seems clear from this example -- we now
On 2018-05-21 18:55:36 +, Steven Schveighoffer said:
So the issue here is that the lambda function inside myFunc is
DIFFERENT than the one inside b. They are both the same function, but
with essentially different names.
Aha... that explains it pretty good.
When you use the alias, both a
On 2018-05-21 20:17:04 +, Jonathan M Davis said:
On Monday, May 21, 2018 16:05:00 Steven Schveighoffer via Digitalmars-d-
learn wrote:
Well one thing that seems clear from this example -- we now have
__traits(isSame) to tell if lambdas are the same, but it looks like the
compiler doesn't s
On 2018-05-21 18:13:16 +, Ali ehreli said:
Templatized range types work well when they are used as template
arguments themselves.
When you need to keep a single type like 'b' (i.e. b is not a
template), and when you need to set a variable like mySubStream to a
dynamic object, the solut
On Monday, May 21, 2018 16:05:00 Steven Schveighoffer via Digitalmars-d-
learn wrote:
> On 5/21/18 3:22 PM, Jonathan M Davis wrote:
> > That's basically what I was suggesting that he do, but I guess that I
> > wasn't clear enough.
>
> Well one thing that seems clear from this example -- we now have
On 5/21/18 3:22 PM, Jonathan M Davis wrote:
That's basically what I was suggesting that he do, but I guess that I wasn't
clear enough.
Well one thing that seems clear from this example -- we now have
__traits(isSame) to tell if lambdas are the same, but it looks like the
compiler doesn't sub
On Monday, May 21, 2018 11:13:16 Ali Çehreli via Digitalmars-d-learn wrote:
> On 05/20/2018 10:46 AM, Robert M. Münch wrote:
> > But I still don't understand why I can't write things explicitly but
> > have to use an alias for this.
>
> Templatized range types work well when they are used as temp
On Monday, May 21, 2018 14:55:36 Steven Schveighoffer via Digitalmars-d-
learn wrote:
> On 5/20/18 1:46 PM, Robert M. Münch wrote:
> > On 2018-05-20 17:40:39 +, Robert M. Münch said:
> >> Hi Jonathan, great! This got me a step further. So I can declare my
> >> member now. But I get an implict c
On 5/20/18 1:46 PM, Robert M. Münch wrote:
On 2018-05-20 17:40:39 +, Robert M. Münch said:
Hi Jonathan, great! This got me a step further. So I can declare my
member now. But I get an implict cast error when I try:
class a {
... myStream;
}
class b {
typeof(a.myStream.filter!(x =
On 05/20/2018 10:46 AM, Robert M. Münch wrote:
> But I still don't understand why I can't write things explicitly but
> have to use an alias for this.
Templatized range types work well when they are used as template
arguments themselves.
When you need to keep a single type like 'b' (i.e. b is
On 2018-05-20 17:40:39 +, Robert M. Münch said:
Hi Jonathan, great! This got me a step further. So I can declare my
member now. But I get an implict cast error when I try:
class a {
... myStream;
}
class b {
typeof(a.myStream.filter!(x => x == myMessage)) mySubStream;
}
v
On 2018-05-20 14:49:59 +, Jonathan M Davis said:
In cases like this, typeof is your friend. e.g. something like
typeof(myStream.filter!(a => a == myMessage)) mySubStream;
Hi Jonathan, great! This got me a step further. So I can declare my
member now. But I get an implict cast error when
On Sunday, May 20, 2018 16:30:10 Robert M. Münch via Digitalmars-d-learn
wrote:
> I use the D RX lib [1] and can create a filtered stream using the auto
> keyword:
>
> struct a {
> SubjectObject!myType myStream;
> ??? mySubStream;
> }
>
> void myfunc(){
> a myA = new a();
>
> auto mySubStr
I use the D RX lib [1] and can create a filtered stream using the auto keyword:
struct a {
SubjectObject!myType myStream;
??? mySubStream;
}
void myfunc(){
a myA = new a();
auto mySubStream = a.myStream.filter!(a => a == myMessage);
...
}
The problem is,
16 matches
Mail list logo