<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Matthew,</div><div class=""><br class=""></div><div class="">Thanks for working on this so quickly! Unfortunately, It looks like there is a bug in the fix that causes segfaults when checking impersonator properties on keyword procedures that are not impersonators. I’ve included a small test case below.</div><div class=""><br class=""></div><div class="">Thanks again,</div><div class="">Scott</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">#lang racket</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">(define-values (prop:my-prop my-prop? my-prop-accessor)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> (make-impersonator-property 'my-prop))</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">(define kwp</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> (make-keyword-procedure </div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> (λ (kwds kwd-args . other-args)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> (printf "Keywords: ~a~n" kwds)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> (printf "Keyword arguments: ~a~n" kwd-args)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> (printf "Other arguments: ~a~n" other-args))</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> (λ args</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""> (printf "Arguments: ~a~n" args))))</div></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><div style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" class="">(my-prop? kwp)</div></div><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 8, 2015, at 10:12 PM, Matthew Flatt <<a href="mailto:mflatt@cs.utah.edu" class="">mflatt@cs.utah.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">I agree that this is a bug --- specific to impersonators that are not<br class="">chaperones --- and I've pushed a repair to the Git repo.<br class=""><br class="">The general repair was to make impersonator-property predicates and<br class="">accessors sensitive to `prop:impersonator-of`. When a structure<br class="">impersoator does not have a particular impersonator property, but its<br class="">structure has the `prop:impersonator-of` property, then the structure<br class="">produced by `prop:impersonator-of` is checked (recursively). That<br class="">change fixes the problem with keyword procedures, because<br class="">`impersonator-procedure` on keyword-acepting procedure is implemented<br class="">through an internal structure type that has `prop:impersonator-of`.<br class=""><br class="">Thanks for the report!<br class=""><br class="">At Fri, 6 Mar 2015 20:04:10 -0500, Scott Moore wrote:<br class=""><blockquote type="cite" class="">Hi,<br class=""><br class="">I've run into some strange behavior with the interaction between<br class="">impersonators and make-keyword-procedure. I expect that when not invoked<br class="">with keywords, the result of make-keyword-procedure and a lambda with the<br class="">same form should be equivalent. Instead, they behave differently when<br class="">impersonated. I have included a small module that demonstrates the issue<br class="">below. I expect that the two checks at the bottom should succeed.<br class=""><br class="">Thanks,<br class="">Scott<br class=""><br class="">#lang racket<br class=""><br class="">(require rackunit)<br class=""><br class="">(define-values (prop:my-prop my-prop? my-prop-accessor)<br class=""> (make-impersonator-property 'my-prop))<br class=""><br class="">(define (mark-with-my-prop val)<br class=""> (impersonate-procedure<br class=""> val<br class=""> #f<br class=""> prop:my-prop<br class=""> #t))<br class=""><br class="">(define (mark-fun-mkp f)<br class=""> (mark-with-my-prop<br class=""> (make-keyword-procedure<br class=""> (λ (kwds kwd-args . other-args)<br class=""> (keyword-apply f kwds kwd-args other-args))<br class=""> (λ args<br class=""> (apply f args)))))<br class=""><br class="">(define (mark-fun-lambda f)<br class=""> (mark-with-my-prop<br class=""> (λ args<br class=""> (apply f args))))<br class=""><br class="">(define (dummy-impersonator val)<br class=""> (make-keyword-procedure<br class=""> (λ (kwds kwd-args . other-args)<br class=""> (apply values kwd-args other-args))<br class=""> (λ args<br class=""> (apply values args))))<br class=""><br class="">(define marked-mkp (mark-fun-mkp display))<br class="">(define marked-lambda (mark-fun-lambda display))<br class=""><br class="">(check-eq? (my-prop? marked-lambda) (my-prop? marked-mkp))<br class="">(check-eq? (my-prop? (impersonate-procedure marked-lambda<br class="">(dummy-impersonator marked-lambda)))<br class=""> (my-prop? (impersonate-procedure marked-mkp (dummy-impersonator<br class="">marked-mkp))))<br class="">____________________<br class=""> Racket Users list:<br class=""> <a href="http://lists.racket-lang.org/users" class="">http://lists.racket-lang.org/users</a><br class=""></blockquote></div></blockquote></div><br class=""></body></html>