PasteRack.org
Paste # 58172
2020-05-10 03:41:49

Forked from paste # 81764.

Fork as a new paste.

Paste viewed 266 times.


Embed:

  1. #lang racket
  2. (require racket/generator)
  3. (define id (generator (op)
  4.               (let loop ([p op])
  5.                 (let loop ([a (car p)]
  6.                            [b (cdr p)])
  7.                         (loop (yield a b)))))
  8.                   )
  9.  
  10. (display (id (cons 2 3)))
  11. (display (id (cons 3 4)))

=>

result arity mismatch;

 expected number of values not received

  expected: 1

  received: 2

  values...:

   2

   3

loop: arity mismatch;

 the expected number of arguments does not match the given

number

  expected: 2

  given: 1

  arguments...:

   '(3 . 4)