-
Notifications
You must be signed in to change notification settings - Fork 1k
Rewrote nested functions tour #735
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
Conversation
else if (ys.head < threshold) ys.head :: process(ys.tail) | ||
else process(ys.tail) | ||
process(xs) | ||
object FactorialTest extends App { |
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 would use def main
here
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 think it's clearer if all of the examples are in worksheet mode and not inside classes.
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.
@travis032654 I have rewritten the example in worksheet mode
Hey @ZeonTrevor, huge thanks for your work. It's going to help a lot of people who use this as their primary reference. Check out the conversation here: #733 I'm also tracking the work in the Project Page. You'll find the link on the right. |
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.
If we title the paste Nested Methods, shouldn't the content also talk about methods rather than functions? Maybe the crux is that methods can be declared in any block scope, including (but not limited to) other methods?
nice, thanks! |
after merging I noticed an error that I fixed in 4becbaf |
an easier to understand example of using nested methods through the computation of factorial.