main.scm 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. (import (rnrs base)
  2. (only (guile)
  3. lambda* λ)
  4. ;; GNU Guile batteries
  5. (ice-9 exceptions)
  6. ;; custom libraries
  7. (command-line)
  8. (vocabulary-data)
  9. (json-reader)
  10. (json-writer)
  11. (print-utils)
  12. (interact)
  13. ;; custom helper libraries
  14. (list-procs)
  15. (alist-procs)
  16. ;; SRFIs
  17. ;; SRFI 43 - vector procs
  18. (srfi srfi-43)
  19. ;; SRFI 69 - hash tables
  20. (srfi srfi-69)
  21. ;; other libs
  22. (json))
  23. ;; ==========
  24. ;; ENTRYPOINT
  25. ;; ==========
  26. (define main
  27. (λ (options)
  28. (let ([vocabulary
  29. (read-vocabulary
  30. (hash-table-ref/default options
  31. "vocabulary"
  32. "default-vocabulary.json"))])
  33. ;; (print-limited vocabulary)
  34. ;; (print-limited (get:vocabulary/nth-entry vocabulary 0))
  35. (interactive-loop vocabulary options))))
  36. (let ([options (parse-arguments (program-arguments))])
  37. (simple-format #f "~a\n" options)
  38. (main options))