Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

29 linhas
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) "-")))))