Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom events require casting #167

Open
mordae opened this issue Jul 30, 2015 · 1 comment · May be fixed by #1229
Open

custom events require casting #167

mordae opened this issue Jul 30, 2015 · 1 comment · May be fixed by #1229
Assignees

Comments

@mordae
Copy link

mordae commented Jul 30, 2015

Custom events cannot be supplied to sync. For example:

-> (struct: (a) reply
     ((evt : (Evtof a)))
     #:property prop:evt (struct-field-index evt))
-> (sync (reply always-evt))
; readline-input:4:0: Type Checker: Polymorphic function `sync' could not be
;   applied to arguments:
; Domain: (Evtof a) *
; Arguments: (reply (Rec x (Evtof x)))
;   in: (sync (reply always-evt))
; [,bt for context]
-> (sync (cast (reply always-evt) (Rec x (Evtof x))))
- : (Rec x (Evtof x))
#<always-evt>

On the other hand, some well-known non-pure-evt types seem to work fine.

-> (sync (current-input-port))
- : Input-Port
#<input-port:readline-input>

Help?

@AlexKnauth
Copy link
Member

That's because struct-type properties aren't really supported yet, I believe.

That's why the current docs for struct don't actually mention them, and I believe that's also why define-struct/exec is provided for the special case of prop:procedure.

@capfredf capfredf self-assigned this Apr 8, 2021
@capfredf capfredf linked a pull request Apr 20, 2022 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants