Skip to content

Instantly share code, notes, and snippets.

@leon-vv
Created July 13, 2013 19:07
Show Gist options
  • Save leon-vv/5991838 to your computer and use it in GitHub Desktop.
Save leon-vv/5991838 to your computer and use it in GitHub Desktop.
Changes for the rus for rubyist book
Multiple chapters:
int::to_str(num) --->> std::int::to_str(num)
Chapter 6:
int::range(1, 101) --->> std::int::range(1, 101)
Chapter 7:
use core::pipes::{stream, Port, Chan} --->> Nothing?
extern mod std; --->> extern mod extra;
use std::comm::DuplexStream; --->> use extra:comm::DuplexStream;
Chapter 10:
This fails: "another_vector += a_vector;",
and this works: "another_vector = another_vector + a_vector;",
I don't know why.
Chapter 11:
v.each --->> v.iter().advance
impl IndustrialRaverMonkey: Monster --->> impl Monster for IndustrialRaverMonkey
Chapter 12:
use core::io::{Reader, ReaderUtil}; --->> Nothing?
io:: --->> std::io::
... annoying from Ruby is that you ... --->> Should be Rust?
extern mod core; use core::*; --->> Core should be std?
io::stdin() --->> std::io::stdin()
int::from_str(in) --->> std::int::from_str(in)
int::to_str(number_string) --->> std::int::to_str(number_string)
core::rand::RngUtil --->> std::rand::RngUtil
etc...
let rng = rand::Rng(); --->> let mut rng = rand::rng();
let num = rng.gen_int() % 100 + 1; --->> Gave me errors, solved using: "let mut num: int = rng.gen(); num = num % 100 + 1;",
can probably be solved better.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment