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
#[derive(Debug)] | |
enum Lx { | |
Str(String), | |
Int(String), | |
Keyword(String), | |
LxUnk(char), | |
} | |
fn main() { |
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
#[macro_export] | |
macro_rules! mat | |
{ | |
( $($($e: expr),+);+ ) => | |
{ | |
Matrix::new(&[$( | |
&[$( | |
($e) as f64, | |
)+], | |
)+]) |
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
#![feature(phase)] | |
#[phase(plugin)] | |
extern crate kwarg_macros; | |
kwarg_decl!(foo(a = 1, b = 2, c = 3)) | |
fn foo(a: int, b: int, c: int) -> (int, int, int) | |
{ | |
(a, b, c) |
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
test count_bench ... bench: 16566 ns/iter (+/- 307) | |
test lower_bench ... bench: 16149 ns/iter (+/- 581) |
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
#![feature(globs, phase, macro_rules)] | |
extern crate algebloat; | |
#[phase(plugin)] | |
extern crate algebloat_macros; | |
use algebloat::*; | |
fn add< | |
T: MatrixRawGet + SameShape + MatrixShape + Clone + |
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
operator_rules! my_awesome_operators | |
{ | |
unary($b ^) : right(5) => | |
{ | |
$a.fact() | |
}, | |
trinary($a ^ $b : $c) => | |
{ | |
if $a { $b } else { $c } | |
} |
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
$ ldd a.out | |
linux-vdso.so.1 => (0x00007fff1fa00000) | |
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff720fc8000) | |
/lib64/ld-linux-x86-64.so.2 (0x00007ff7213c0000) |
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
clone | |
Matrix { data: [100, 200, 300] } |
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
clone | |
move | |
move | |
[100, 200, 300] |
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
clone | |
move | |
move | |
100 200 300 |
NewerOlder