> - tjc's pre-talk and talk, "Rust: A Friendly Introduction" went very well. The
> [slides](http://catamorphism.org/Writing/Rust-Tutorial-tjc.pdf) are up, and
> a recording is coming soon (hopefuly). tjc says the slides aren't as
> understanable without the audio of the talk.
Thanks for the tutorial!
The slides seem perfectly comprehensible without audio, except
possibly for some points below that may either be corrected or perhaps
addressed in the slide notes themselves.
POSSIBLE ERRATA:
Slide 40:
The notes say "Change [@Drawable] to [~@Drawable]". The latter should be
~[@Drawable], or, to be consistent with the Slide 41, perhaps
&[@Drawable]? Both tested to work.
Slide 51:
The program seems to be missing a unique pointer sigil ~; and the types of
the array and the initializer ("quux") don't match. Here is a possible
correction? (Tested.)
fn h(b: ~[int]) { }
fn g(a: ~[int]) { }
fn f(n: uint) {
let v: ~[int] = vec::from_elem(n,1);
h(v);
g(v);
}
Slide 53:
Perhaps the audio is needed for this slide, but I am confused. Before I
start with that, I checked
struct Cat {
a : int,
}
fn main() {
let v: Cat::new();
}
It seems that there is no default new() function, so I don't know the
type of the object returned by Cat::new(). Is it Cat or ~Cat here?
The comment about Cat not being copyable seems to imply that the type is
Cat (i.e. stack-allocated). But then send_cat_to_moon(cat) should not be
able to invalidate the reference, right? So there should not be a problem
with that code as webcam should get destructed before cat at the end of
the block.
If Cat::new() returns ~Cat and Webcam::new() returns ~Webcam, then I can
see this working out, but then there is the implicit assumption (that
could perhaps be clarified in the comments) that send_cat_to_moon(cat)
takes its argument as ~Cat rather than, say, &Cat.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev