iterrr icon indicating copy to clipboard operation
iterrr copied to clipboard

add `define`

Open hamidb80 opened this issue 3 years ago • 1 comments

  (1 .. 10) |> define( 
    a = it + 1
    b = a +2
  )
  .map(b)
  .toseq()

hamidb80 avatar Aug 12 '22 19:08 hamidb80

it's really hard to implement, I think saving into tuple next to the iterator variable is good solution

for example instead of above code, you can write:

  (1 .. 10) |> map((it, it+1, it+1+2))
  .map((it, a, b) => b)
  .toseq()

hamidb80 avatar Aug 13 '22 03:08 hamidb80