[personal profile] boriskr
I started to read "Scala puzzlers" yesterday evening. This is not as fun as "Java puzzlers", but it was so interesting that when I looked at the time it was 3 am!

There is aсtually a puzzle (Init you, init me):

object XY {
object X {val value: Int = Y.value + 1}
object Y {val value: Int = X.value + 1}
}

I have to figure out, why is it XY.X.value or XY.Y.value throws StackOverflowError, while the book says it should return 2.

In "Count me now, count me later" puzzle explanation it turned out that in order to understand Scala code, I have to know what the "eta expansion" is. This thing is from lambda calculus, which I knew nothing about, but ok, I've also read about alfa conversion and beta reduction too. Who knows what I'll need in the future.
From:
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

Profile

boriskr

January 2017

S M T W T F S
1234567
891011121314
15161718192021
22 232425262728
293031    

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 22nd, 2017 08:15 am
Powered by Dreamwidth Studios