Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Karate Bastard posted:

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.

Adbot
ADBOT LOVES YOU

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.

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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply