This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::run::{Process, ProcessOptions}; | |
use std::str::{byte_slice}; | |
fn main() | |
{ | |
let mut p = Process::new("gnuplot", [~"-p"], ProcessOptions::new()); | |
let input = p.input(); | |
byte_slice("plot x*x\n", |s| { input.write(s); } ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() | |
{ | |
trait Trait | |
{ | |
} | |
struct Parent | |
{ | |
a : Option<~Trait> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Axes2D; | |
impl Axes2D | |
{ | |
fn new() -> Axes2D | |
{ | |
Axes2D | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum PlotOption<'self> | |
{ | |
Caption(&'self str), | |
} | |
impl<'self> &'self [PlotOption<'self>] | |
{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct A() | |
{ | |
int opCmp(const ref A p) const | |
{ | |
return 0; | |
} | |
string toString() | |
{ | |
return ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tango.io.Console; | |
import tango.io.Stdout; | |
import tango.io.stream.Buffered; | |
import tango.stdc.stdio; | |
void main() | |
{ | |
auto b = (cast(BufferedOutput)Cout.stream); | |
auto s = Cout.stream; | |
OutputStream s2 = b; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dmd -shared -fPIC -O -m32 testlib.d -release | |
dmd -L./lib/32/shared/libtango-dmd.so.0.63.0 test2.d -L-lbz2 -L-ldl -defaultlib=libphobos2.so -L./testlib.so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl<'self> ToStr for ~std::to_str::ToStr | |
{ | |
fn to_str(&self) -> ~str | |
{ | |
self.to_str(); | |
} | |
} | |
fn test<T : ToStr>(a : T) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use private::*; | |
impl A | |
{ | |
fn test() | |
{ | |
} | |
} | |
mod private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern "C" | |
{ | |
fn a(); | |
fn b(a: extern "C" fn()); | |
} | |
fn main() | |
{ | |
unsafe | |
{ |