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

Introduce property expression to avoid evaluating properties too early #51

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

falkoschindler
Copy link
Collaborator

This PR tries to fix #36 and part of #18 by not evaluating property getters during compilation.

Open tasks:

  • Why is this example not working?
    let wait do
        await (core.debug == true)
        core.print('done')
    end
    When calling wait() and setting core.debug = true, there should be a message "done".
  • Fix this example:
    serial = Serial(26, 27, 115200, 1)
    p0 = Expander(serial, 25, 14)
    b = p0.Input(5)
    b.pullup()
    
    when b.level == 0 then core.print("DOWN"); end
    when b.change > 0 then core.print("PRESS"); end
    This startup script fails, because the compiler needs to read b.level and b.change to get their datatype. But they are undefined until the expander has started.

@falkoschindler falkoschindler added the bug Something isn't working label Jun 28, 2024
@falkoschindler falkoschindler self-assigned this Jun 28, 2024
@falkoschindler falkoschindler added this to the 0.1.12 milestone Jun 28, 2024
@falkoschindler falkoschindler modified the milestones: 0.1.12, 0.2.0 Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error Accessing change Attribute of Input on Expander Module
1 participant