Install portaudio using homebrew (or method of your choice)
brew install portaudio
create $HOME/.pydistutils.cfg using the include
and lib
directories of your portaudio install:
[build_ext]
struct Node { | |
value: uint, | |
/*make sure that the list can terminate*/ | |
next: Option<~Node> | |
} | |
fn main() { | |
/*define a vector of numbers*/ | |
let v = [1u,2,3,4]; |
fn reverse_linkedlist(head: Option<~Node>) -> Option<~Node> { | |
let mut result = head; | |
loop { | |
match result.next { | |
Some(~node) => { | |
let old_next = node.next; | |
node.next = result; | |
result = old_next; | |
}, | |
None => { |
fn rv(head: Option<~Node>) -> Option<~Node>{ | |
let mut return_head = None; | |
let mut current_head = head; | |
loop { | |
match current_head.take() { | |
Some(node) => { | |
let mut node = node; //make the node usable | |
current_head = node.next.take(); | |
node.next = return_head; | |
return_head = Some(node); |
Install portaudio using homebrew (or method of your choice)
brew install portaudio
create $HOME/.pydistutils.cfg using the include
and lib
directories of your portaudio install:
[build_ext]