You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
372B

  1. (module util (curry applied thunk just perhaps)
  2. (import scheme)
  3. (define (curry fn a)
  4. (lambda (b)
  5. (fn a b)))
  6. (define (applied fn)
  7. (curry apply fn))
  8. (define-syntax thunk
  9. (syntax-rules ()
  10. ((_ exp ...)
  11. (lambda () exp ...))))
  12. (define (just fn)
  13. (lambda args
  14. (fn)))
  15. (define (perhaps fn arg)
  16. (if arg
  17. (fn arg)
  18. arg)))