simple.scm 588 B

12345678910111213141516171819202122
  1. ;;; Sometimes it makes sense to use the simplest means
  2. ;;; possible to get input from command line arguments. For
  3. ;;; example when you have a script, which only takes 1 or 2
  4. ;;; arguments, which are quite clear in their meaning from
  5. ;;; the context, in which the script is used. The simplest
  6. ;;; way in GNU Guile is using the command-line procedure.
  7. (import
  8. (except (rnrs base) let-values map)
  9. (only (guile)
  10. lambda* λ
  11. ;; printing
  12. display
  13. simple-format
  14. command-line))
  15. (display
  16. (simple-format
  17. #f "command line arguments: ~a\n"
  18. (command-line)))