Skip to content

Feedback from 2-26 #2

@mike-north

Description

@mike-north
  • Example of the effect of mutating state on an outer closure
  outer = -1
  IO.puts "BEGIN: outer=#{outer}"
  [1, 2, 3]
  |> Enum.each fn i ->
    IO.puts "BEFORE: i=#{i}, outer=#{outer}"
    outer = i
    IO.puts "AFTER:  i=#{i}, outer=#{outer}"
  end
  IO.puts "END: outer=#{outer}"

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