“for” comprehensions

You cannot view this unit as you're not logged in yet. Go to Account to login.

2 Comments

  1. Zac B on May 3, 2023 at 9:14 am

    This might be a little bit more concise (and especially with particularly large ranges). Took a few minutes to get it right as I don’t work with bitstring syntax much.

    for x <- ?a..?h,
    y <- 1..8 do
    %{col: "#{<>}”, row: y, name: “#{<>}#{y}”}
    end
    end

  2. Zac B on May 3, 2023 at 9:15 am

    Well that got munched. Should be (without extra spaces), < > (for example). Hopefully that doesn’t get munched…

Leave a Comment

You must be logged in to post a comment.