Arc Forumnew | comments | leaders | submitlogin
2 points by jsgrahamus 2878 days ago | link | parent

Looking at this code segment:

   (do
     (let (diagonals2 result2 total2)
  	(print-result diagonals2 result2 total2)
  	(= diagonals diagonals2 result result2 total total2)))
There must be a way for the system to realize I expect (print-result) to update diagonals, result and total, so it automatically creates diagonals2/result2/total2, puts them in a let statement as the receivers of the return value of (print-result) and upon coming back from (print-result) automatically the system automatically sets diagonals/result/total to each element of the return list.

Perhaps a macro could do such?



2 points by akkartik 2878 days ago | link

Yeah, you're bringing up an interesting pattern: how to update variables from a function when it returns multiple values. Let me think about it.

-----

2 points by rocketnia 2872 days ago | link

I was working on a response to this thread, but I decided to make it a thread of its own: http://arclanguage.org/item?id=19763

-----