{"action":"created","issue":{"url":"https://api.github.com/repos/plt/racket/issues/1020","labels_url":"https://api.github.com/repos/plt/racket/issues/1020/labels{/name}","comments_url":"https://api.github.com/repos/plt/racket/issues/1020/comments","events_url":"https://api.github.com/repos/plt/racket/issues/1020/events","html_url":"https://github.com/plt/racket/pull/1020","id":102181219,"number":1020,"title":"Add property to cooperate with syntax-local-value","user":{"login":"takikawa","id":64192,"avatar_url":"https://avatars.githubusercontent.com/u/64192?v=3","gravatar_id":"","url":"https://api.github.com/users/takikawa","html_url":"https://github.com/takikawa","followers_url":"https://api.github.com/users/takikawa/followers","following_url":"https://api.github.com/users/takikawa/following{/other_user}","gists_url":"https://api.github.com/users/takikawa/gists{/gist_id}","starred_url":"https://api.github.com/users/takikawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takikawa/subscriptions","organizations_url":"https://api.github.com/users/takikawa/orgs","repos_url":"https://api.github.com/users/takikawa/repos","events_url":"https://api.github.com/users/takikawa/events{/privacy}","received_events_url":"https://api.github.com/users/takikawa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-20T16:47:03Z","updated_at":"2015-08-25T14:39:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/plt/racket/pulls/1020","html_url":"https://github.com/plt/racket/pull/1020","diff_url":"https://github.com/plt/racket/pull/1020.diff","patch_url":"https://github.com/plt/racket/pull/1020.patch"},"body":"This PR adds a struct property that cooperates with `syntax-local-value`.\r\n\r\nThe motivation for this change is to allow TR to close some bugs related to its uses of rename transformers: https://github.com/takikawa/typed-racket/tree/gh-issue-163\r\n\r\nSome design questions:\r\n  * Should `syntax-local-value/immediate` on a struct with this property return something other than the final redirected value? Currently I chose no, since existing clients of this function don't expect any special behavior from anything but rename transformers. Changing that behavior could break code.\r\n  * What should be allowed in the property? I chose to allow either an integer index or a procedure with one argument. The index case is similar to rename transformers but the field must be an identifier. This seems reasonable to me, but there are other choices (like allow an identifier in the property too).\r\n  * Should rename transformers or this take precedence when both properties are provided? I chose to let rename transformers take precedence, which I think is reasonable.\r\n\r\nI did run into a situation in TR where I wanted `s-l-v/immediate` to give me the struct with this new property back, but I was able to work around it with another layer of indirection using a rename transformer.\r\n\r\nAlso the name of the property is tentative. If anyone has a better name that'd be great. Maybe `prop:redirect-syntax-local-value`?"},"comment":{"url":"https://api.github.com/repos/plt/racket/issues/comments/134608429","html_url":"https://github.com/plt/racket/pull/1020#issuecomment-134608429","issue_url":"https://api.github.com/repos/plt/racket/issues/1020","id":134608429,"user":{"login":"mflatt","id":295034,"avatar_url":"https://avatars.githubusercontent.com/u/295034?v=3","gravatar_id":"","url":"https://api.github.com/users/mflatt","html_url":"https://github.com/mflatt","followers_url":"https://api.github.com/users/mflatt/followers","following_url":"https://api.github.com/users/mflatt/following{/other_user}","gists_url":"https://api.github.com/users/mflatt/gists{/gist_id}","starred_url":"https://api.github.com/users/mflatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mflatt/subscriptions","organizations_url":"https://api.github.com/users/mflatt/orgs","repos_url":"https://api.github.com/users/mflatt/repos","events_url":"https://api.github.com/users/mflatt/events{/privacy}","received_events_url":"https://api.github.com/users/mflatt/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T14:39:22Z","updated_at":"2015-08-25T14:39:22Z","body":"@asumu: The issue with  `syntax-local-value/immediate` makes me reconsider the value of separating rename transformers from `prop:syntax-local-value`. If `prop:rename-transformer` allowed a single-argument function as its value, then the meaning of \"rename transformer\" would change so that it's target identifier is not a constant, but existing code is likely to work fine. With the separation, I can't help thinking that we'll need a variant of `syntax-local-value/immediate` eventually. And, looking at your message again, I see that you already wanted it once.\r\n\r\nIf you think the separation is better, then this commit is fine with me. If you'd like to try changing `prop:rename-transformer` after all, though, I think that would be a worthwhile experiment (despite my earlier advice)."}}