- Plorkyeran
- Mar 22, 2007
-
To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
|
Example:
code: // Consume a list, and return the same list with a new element at its front
fn prepend(self, elem: u32) -> List {
// `Cons` also has type List
Cons(elem, Box::new(self))
}
"Consume"? Really? I see the code they put there, and for what that does, in my experience most people would just say "takes". Sure, I can maybe accept that "consume" could possibly maybe not quite mean what they use it for here, but for most people in programming (?) "consume" has mutable or destructive connotations, like sucking data from a stream for processing, making it inaccessible for other processors of data from the same stream; it is "consumed" like food and cannot be consumed like food again.
"Consume" is entirely correct here. The thing you call prepend on is moved from and you can't use it again afterwards.
|
#
¿
May 17, 2015 22:16
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
Apr 29, 2024 02:10
|
|
- Plorkyeran
- Mar 22, 2007
-
To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
|
When you read data from a stream and store it in a data structure, the data still exists in some form, but you can't get to it from the stream. Similarly, when you call list.prepend(5), the data previously stored in list still exists somewhere, but you can't get to it from list.
|
#
¿
May 17, 2015 22:51
|
|
- Plorkyeran
- Mar 22, 2007
-
To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
|
I think when an OS's mainstream support period has ended you can safely say it's no longer trying to be a modern OS.
|
#
¿
Mar 1, 2018 06:13
|
|