rust-unofficial / too-many-lists

Learn Rust by writing Entirely Too Many linked lists
https://rust-unofficial.github.io/too-many-lists/
MIT License
3.22k stars 281 forks source link

Possible mixup in terminology between lvales and rvalues referring to places #218

Closed T-Dark0 closed 2 years ago

T-Dark0 commented 2 years ago

https://rust-unofficial.github.io/too-many-lists/fifth-testing-stacked-borrows.html contains this quote:

NARRATOR: No one cares that you know the word "rvalue", jonathan. In Rust we call them places, which is totally different and so much cooler?

In Rust, a place intuitively corresponds to a C lvalue: *b = a compiles in Rust because *b is a place (and in C because *b is a lvalue). While it's true that places can coerce to values (which is why a = *b compiles for pointers to Copy types and for Box), it seems to me that saying places are rvalues is incorrect, especially considering how 12 would be a rvalue, but definitely not a place.

Perhaps the narrator say that nobody cares jonathan knows the word "lvalue"?

Gankra commented 2 years ago

Whoops yeah. the second half didn't use to be there so it didn't matter if I said rvalue or lvalue, but once I added the part about "places" it should really be precisely an lvalue. Fixed, thx.