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

Error running REPL: local variable is never mutated #1

Open
achenet opened this issue Aug 6, 2024 · 2 comments
Open

Error running REPL: local variable is never mutated #1

achenet opened this issue Aug 6, 2024 · 2 comments

Comments

@achenet
Copy link

achenet commented Aug 6, 2024

Hello,

I'm trying to run ziglisp with zig version 0.14.0-dev.839+a931bfada.

When I try zig run src/main.zig, as per the README, I get

src/main.zig:19:9: error: local variable is never mutated
    var env = try init();
        ^~~
src/main.zig:19:9: note: consider using 'const'
src/main.zig:71:9: error: local variable is never mutated
    var buffer: []u8 = try alloc.alloc(u8, len);
        ^~~~~~
src/main.zig:71:9: note: consider using 'const'
src/main.zig:88:9: error: local variable is never mutated
    var result = try C.alloc.alloc(ValueRef, sexprs.len);
        ^~~~~~
src/main.zig:88:9: note: consider using 'const'

I'll open a branch to change these var to const, you can merge it if you want (or not, up to you ^^)

@achenet
Copy link
Author

achenet commented Aug 6, 2024

arg, tried opening a branch, it seems I don't have rights to push :/

@achenet
Copy link
Author

achenet commented Aug 6, 2024

forked the code and opened a PR on my version of the repo :)
#2

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

No branches or pull requests

1 participant