Skip to content

Syntax isn't introduced #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ejflick opened this issue Dec 10, 2017 · 6 comments · Fixed by #79
Closed

Syntax isn't introduced #23

ejflick opened this issue Dec 10, 2017 · 6 comments · Fixed by #79

Comments

@ejflick
Copy link

ejflick commented Dec 10, 2017

There's no point where the following syntax is introduced:

Even trying to scour the internet, it's difficult to find the solution that's expected.

@sreenathchary
Copy link

I am facing the same problem here.....cond: (Int, Int) => Boolean = (...). seems to be the function to check if the first parameter is less than the second and if yes return true, else false....but how the hell do i reference the parameters in the function...all it needs is (x <=y) ...terrible way to learn Scala from here

@albertocamposblanco
Copy link

albertocamposblanco commented Oct 29, 2018

You need to make a statement similar to a map:

(x,y) => (x<y)

You assign x,y as your two parameters and map them to the comparison you want to run later.

Hope this helps.

@17hao
Copy link

17hao commented Jan 27, 2019

I think (Int,Int) => Boolean means a type

You can understand it like a type(Int,Double,Long...)

the right answer is: val cond:(Int,Int)=>Boolean = (x:Int,y:Int)=>x<y

@milan-marinov-usu
Copy link

I had the same problem, this syntax is not previously introduced in the tutorial. Really not a good way to teach Scala. Thanks a lot to @albertocamposblanco, his solution was the key to complete the exercise: (x,y) => (x<y)

@tulth
Copy link

tulth commented Aug 17, 2019

As a scala newbie, I found this confusing as well.
I expected the answer to be:

val cond: (Int, Int) => Boolean = <

Is there a way of referring to the lessThan operator function in the built-ins?

@Nboaram
Copy link

Nboaram commented Sep 17, 2019

Yeah, I found this incredibly confusing as well, maybe an example of a similar condition being used earlier would help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants