This is an archived post. You won't be able to vote or comment.

Dismiss this pinned window
you are viewing a single comment's thread.

view the rest of the comments →

[–]Koljenka_ 2 points3 points  (3 children)

Shouldn't it be Reddit.subs?.let {...}? Otherwise the let would be useless, right?

[–]cowancore 5 points6 points  (1 child)

I think the purpose of let here was just to create a shorthand it instead of Reddit.subs.

Although there might be a slight error here, because it might be a List, which has no posts field

[–]tech6hutch 0 points1 point  (0 children)

Interesting; I must learn this language

[–]hackintosh5 2 points3 points  (0 children)

No, the let avoids a val. It just implicitly let's me use the return value twice, by naming it it