-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add code tabs for _tour/higher-order-functions #2525
Conversation
_tour/higher-order-functions.md
Outdated
|
||
{% tabs map_example_1 class=tabs-scala-version %} | ||
|
||
{% tab 'Scala 2' for=map_example_1 %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surely this tab could be Scala 2 and 3? (scala 2 supports underscores in numeric literals)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have try, but it was refused by mdoc
step (see 8e87cbb) if I understand well...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right I didn't check the other commits, that's unfortunate, perhaps the mdoc configuration is outdated. However I'd still prefer to have 1 tab without the underscores - I don't think they are a fundamental improvement because at least for now our syntax highlighting doesn't support it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. If fact, mdoc look like to check with scala 2.12.4, that does not support such constant...
We just have to not use "mdoc". I will perform the change.
_tour/higher-order-functions.md
Outdated
|
||
{% tabs map_example_2 class=tabs-scala-version %} | ||
|
||
{% tab 'Scala 2' for=map_example_2 %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, one tab please
_tour/higher-order-functions.md
Outdated
Notice how `x` is not declared as an Int in the above example. That's because the | ||
compiler can infer the type based on the type of function map expects (see [Currying](/tour/multiple-parameter-lists.html)). An even more idiomatic way to write the same piece of code would be: | ||
|
||
{% tabs map_example_3 class=tabs-scala-version %} | ||
|
||
{% tab 'Scala 2' for=map_example_3 %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here, you can have underscores in scala 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
updated #2481 |
No description provided.