Skip to content

"For Expressions" section needs a few simple examples to start off with #70

Open
@rzats

Description

@rzats

The section jumps right into advanced examples (multiple generators and filters) without explaining the for syntax, generators or filters. It would be nice to start off with a few easier examples:

  • Simple Java-style for loop:
for (i <- 1 to 15) { ... }
  • Simple Java-style 'foreach" loop:
for (element: Int <- someIntArray) { ... }
  • A loop with a single generator and filter:
for (element: Int <- someIntArray if element % 2 == 0) { ... }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions