z66is

c2l.puter.site

Jun 23rd, 2026
1,512
0
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 1 1
  1. ;; ============================================================
  2. ;; FULL CPS HUFFMAN ENCODER — PRODUCTION C2L, ALL TAIL CALLS
  3. ;; ============================================================
  4.  
  5. ;; REVERSE IN CPS
  6. define... [reverse xs k
  7.  
  8. ;; REVERSE HELPER
  9. define.. [loop xs acc k
  10. or...
  11.  
  12. ;; USE CONTINUATION
  13. and.. null?. xs k. acc
  14.  
  15. ;; ACCUMULATION STEP
  16. and.. pair?. xs
  17. loop... [cdr xs
  18. [cons car. xs acc
  19. k
  20.  
  21. ;; RAISE ERROR
  22. [error '[NOT LIST
  23.  
  24. ;; BEGIN
  25. loop... xs (list) k
Advertisement