Skip to content

do for item in list ? #2518

Closed
Closed
@jashkenas

Description

@jashkenas

An interesting proposal raised by @lehni, here:

#2382 (comment)

... is to somehow combine the do and for keywords to give you a quick and easy way to write a loop that closes over its variables ... without hiding the fact that you're working with an implied inner function, and all of the scope changes that involves. I think it might work out nicely.

do for num in [1, 2, 3]

... becomes the equivalent of:

for num in [1, 2, 3]
  do (num) ->

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions