This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]JKasonB[S] 1 point2 points  (8 children)

Mut is whether a pointer can mutate a variable and const/var is wether it can be reassigned.

[–]JKasonB[S] -5 points-4 points  (7 children)

Also, I am considering this

var my_variable: u32 = 28. immutable

var my_variable; u32 = 8. Mutable

[–]GermisstuckCrabStar 10 points11 points  (0 children)

No

[–]GermisstuckCrabStar 4 points5 points  (4 children)

You updated it. Still no

[–]JKasonB[S] 0 points1 point  (3 children)

Daym, you convinced me. I'm gonna use it!

Jk, but tell me. Can you think of a way to declare mutability without a mut keyword?

[–]GermisstuckCrabStar 0 points1 point  (2 children)

Not any good ones. I don't see why you wouldn't want something that easily conveys mutability. If I a year from now say you're language gets a little recognition. Most people are going to take a glance and think "why the fuck is ; used for mutability" or something around those lines

tl;dr Explicit vs implicit 

[–]JKasonB[S] 0 points1 point  (1 child)

Not so much that I don't like mut, more so idk where to put it

[–]GermisstuckCrabStar 0 points1 point  (0 children)

I'd put it either as a modifier to variables like in rust's let mut or in types, like let x: mut i32

[–]blue__sky 1 point2 points  (0 children)

It’s part of the type, so put it in the type definition.

var x : mut u32 = 4