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

mutable params and the developers who love them #47

Closed
disruptek opened this issue Dec 31, 2020 · 1 comment
Closed

mutable params and the developers who love them #47

disruptek opened this issue Dec 31, 2020 · 1 comment
Labels
enhancement New feature or request nim compiler defect fault lies elsewhere wontfix This will not be worked on

Comments

@disruptek
Copy link
Contributor

At some point I developed the conceit that this test should work. The question is whether @Clyybber and company are going to put the kibosh on this due to some hidden addr bs.

    block:
      ## reassignment of var proc params
      ## https://github.com/disruptek/cps/issues/22 (2nd)
      proc foo(a, b, c: var int) {.cps: Cont.} =
        a = 5 
        noop()    
        b = b + a
        noop()   
        check:  
          a == 5
          b == 7
          c == 3
      var (x, y, z) = (1, 2, 3)
      trampoline foo(x, y, z)
      check:
        x == 5
        y == 7
        z == 3
@disruptek disruptek added the wontfix This will not be worked on label Jan 1, 2021
@alaviss
Copy link
Contributor

alaviss commented May 3, 2021

I've tested the resulting transform with manual changes to use views + storing var int in env. The result is SIGSEGV. We can't support this until the compiler gain proper views support.

@disruptek disruptek added enhancement New feature or request nim compiler defect fault lies elsewhere labels Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request nim compiler defect fault lies elsewhere wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants