<div dir="ltr">Hi,<div><br><div>I've run into some strange behavior with the interaction between impersonators and make-keyword-procedure. I expect that when not invoked with keywords, the result of make-keyword-procedure and a lambda with the same form should be equivalent. Instead, they behave differently when impersonated. I have included a small module that demonstrates the issue below. I expect that the two checks at the bottom should succeed.</div><div><br></div><div>Thanks,</div><div>Scott</div><div><br></div><div><div>#lang racket</div><div><br></div><div>(require rackunit)</div><div><br></div><div>(define-values (prop:my-prop my-prop? my-prop-accessor)</div><div>  (make-impersonator-property 'my-prop))</div><div><br></div><div>(define (mark-with-my-prop val)</div><div>  (impersonate-procedure</div><div>   val</div><div>   #f</div><div>   prop:my-prop</div><div>   #t))</div><div><br></div><div>(define (mark-fun-mkp f)</div><div>  (mark-with-my-prop</div><div>   (make-keyword-procedure </div><div>    (λ (kwds kwd-args . other-args)</div><div>      (keyword-apply f kwds kwd-args other-args))</div><div>    (λ args</div><div>      (apply f args)))))</div><div><br></div><div>(define (mark-fun-lambda f)</div><div>  (mark-with-my-prop</div><div>   (λ args</div><div>     (apply f args))))</div><div><br></div><div>(define (dummy-impersonator val)</div><div>  (make-keyword-procedure</div><div>   (λ (kwds kwd-args . other-args)</div><div>     (apply values kwd-args other-args))</div><div>   (λ args</div><div>     (apply values args))))</div><div><br></div><div>(define marked-mkp (mark-fun-mkp display))</div><div>(define marked-lambda (mark-fun-lambda display))</div><div><br></div><div>(check-eq? (my-prop? marked-lambda) (my-prop? marked-mkp))</div><div>(check-eq? (my-prop? (impersonate-procedure marked-lambda (dummy-impersonator marked-lambda)))</div><div>           (my-prop? (impersonate-procedure marked-mkp (dummy-impersonator marked-mkp))))</div></div></div></div>