Skip to content

Instantly share code, notes, and snippets.

@devth
Created October 31, 2011 23:15
Show Gist options
  • Save devth/1329375 to your computer and use it in GitHub Desktop.
Save devth/1329375 to your computer and use it in GitHub Desktop.
Convert Map[String, String] to a sequence and zipWithIndex in order to have a sequential "index" available in scala's for comprehension
- for (((url, source), i) <- similarSources.toSeq.zipWithIndex)
a(href="#{url}" target="_blank")><= source
span><
- if (i < (similarSources.size - 2))
| ,
- else if (i == (similarSources.size - 2))
| and
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment