Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

29 lines
550B

  1. (module util (curry applied thunk just perhaps compose-symbols)
  2. (import scheme)
  3. (import chicken.base)
  4. (import srfi-13)
  5. (define (curry fn a)
  6. (lambda (b)
  7. (fn a b)))
  8. (define (applied fn)
  9. (curry apply fn))
  10. (define-syntax thunk
  11. (syntax-rules ()
  12. ((_ exp ...)
  13. (lambda () exp ...))))
  14. (define (just fn)
  15. (lambda args
  16. (fn)))
  17. (define (perhaps fn arg)
  18. (if arg
  19. (fn arg)
  20. arg))
  21. (define (compose-symbols . ln)
  22. (string->symbol (string-concatenate (intersperse (map symbol->string ln) "-")))))