2023-11-10 20:44:03 -05:00
|
|
|
================================================================================
|
2023-10-31 03:17:58 -04:00
|
|
|
Simple Reduce Loop
|
2023-11-10 20:44:03 -05:00
|
|
|
================================================================================
|
2023-10-31 01:09:29 -04:00
|
|
|
|
|
|
|
reduce i to acc in [1, 2, 3] {
|
|
|
|
acc += i
|
|
|
|
}
|
|
|
|
|
2023-11-10 20:44:03 -05:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-31 01:09:29 -04:00
|
|
|
|
|
|
|
(root
|
2023-11-10 20:44:03 -05:00
|
|
|
(statement
|
|
|
|
(reduce
|
|
|
|
(identifier)
|
|
|
|
(identifier)
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(list
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer))))))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(assignment
|
|
|
|
(identifier)
|
|
|
|
(assignment_operator)
|
|
|
|
(statement
|
2023-10-31 09:31:10 -04:00
|
|
|
(expression
|
2023-11-10 20:44:03 -05:00
|
|
|
(identifier)))))))))
|
2023-10-31 01:09:29 -04:00
|
|
|
|
2023-11-10 20:44:03 -05:00
|
|
|
================================================================================
|
2023-10-31 03:17:58 -04:00
|
|
|
Nested Reduce Loop
|
2023-11-10 20:44:03 -05:00
|
|
|
================================================================================
|
2023-10-31 01:09:29 -04:00
|
|
|
|
2023-10-31 03:17:58 -04:00
|
|
|
reduce i to acc in ["one", "two", "three"] {
|
2023-10-31 01:09:29 -04:00
|
|
|
acc += i
|
|
|
|
}
|
|
|
|
|
2023-11-10 20:44:03 -05:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-31 01:09:29 -04:00
|
|
|
|
|
|
|
(root
|
2023-11-10 20:44:03 -05:00
|
|
|
(statement
|
|
|
|
(reduce
|
|
|
|
(identifier)
|
|
|
|
(identifier)
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(list
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(string)))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(string)))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(string))))))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(assignment
|
|
|
|
(identifier)
|
|
|
|
(assignment_operator)
|
|
|
|
(statement
|
2023-10-31 09:31:10 -04:00
|
|
|
(expression
|
2023-11-10 20:44:03 -05:00
|
|
|
(identifier)))))))))
|