Apply.yqls 542 B

12345678910111213141516171819202122232425
  1. (
  2. #comment
  3. (let config (DataSource 'config))
  4. (let res_sink (DataSink 'result))
  5. (let f1 (lambda '(x y) (block '(
  6. (return (+ x y))
  7. ))))
  8. (let f2 (lambda '(x) (block '(
  9. (return (Apply f1 x (Uint64 '2)))
  10. ))))
  11. (let writer (lambda '(world data) (block '(
  12. (let world (Write! world res_sink (Key) data '()))
  13. (let world (Commit! world res_sink))
  14. (return world)
  15. ))))
  16. (let data1 (Apply f2 (Uint64 '3)))
  17. (let data2 (Apply f2 (Uint64 '4)))
  18. (let world (Apply writer world data1))
  19. (let world (Apply writer world data2))
  20. (return world)
  21. )