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_rules! ok (($T:ident) => ($T)) | |
macro_rules! bad (($T:ty) => ($T)) | |
ok!(int); // compiles | |
//bad!(int); // crashes | |
fn main() { } | |
oiseau:~/tryrust/src clements> rust run /tmp/foo.rs | |
/tmp/foo.rs:3:8: 3:9 error: expected item but found `;` | |
/tmp/foo.rs:3 ok!(int); // compiles |
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
pub fn make_fold(afp: ast_fold_fns) -> @ast_fold { | |
afp as @ast_fold | |
} | |
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
#lang slideshow | |
(define machine-bitmap | |
(scale (bitmap "./light-bulb-changer.png") | |
0.75)) | |
;; yikes! this code could use some serious cleanup. Sorry. | |
(define middle-rect-width 350) | |
(define middle-rect-height 350) |
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 NonEmptyList {first: int, rest: MyList} | |
enum MyList { | |
endoflist, | |
listnode(@NonEmptyList) | |
} |
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_rules! fmt_with_13{ | |
($x:expr) => (fmt!($x,13)) | |
} | |
fn main() { | |
assert_eq!((fmt_with_13!("thirteen: %?")),~"thirteen: 13"); | |
} |
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
CFG_PREFIX := /usr/local | |
CFG_LOCAL_RUST_ROOT := /usr/local | |
CFG_LLVM_ROOT := | |
CFG_BUILD_TRIPLE := x86_64-apple-darwin | |
CFG_HOST_TRIPLES := x86_64-apple-darwin | |
CFG_TARGET_TRIPLES := x86_64-apple-darwin | |
CFG_ANDROID_CROSS_PATH := /opt/ndk_standalone | |
CFG_MINGW32_CROSS_PATH := | |
CFG_PERL := /usr/bin/perl |
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
jclements-09740:~/rust/build clements> sudo make install | |
cfg: build triple x86_64-apple-darwin | |
cfg: host triples x86_64-apple-darwin | |
cfg: target triples x86_64-apple-darwin | |
Makefile:131: mk/platform.mk: No such file or directory | |
You need to run this command from the toplevel of the working tree. | |
Makefile:579: mk/target.mk: No such file or directory | |
Makefile:580: mk/host.mk: No such file or directory | |
Makefile:581: mk/stage0.mk: No such file or directory | |
Makefile:582: mk/rt.mk: No such file or directory |
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_rules! plant_id_in_inner_macro ( | |
(($cuckoo:ident) => | |
({macro_rules! inner_macro ( | |
(($x:expr) => | |
($x + $ $cuckoo)) | |
) | |
inner_macro!(13)})) | |
) | |
plant_id_in_inner_macro!(x) |
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_rules! g ( | |
() => | |
({ | |
macro_rules! f(($y:ident)=> | |
({ | |
let $y=3; | |
$y | |
})); | |
f!(z) | |
})) |
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
#lang racket | |
;; this file shows how you might build a command-line debugger. It doesn't provide much in | |
;; the way of convenience functions.... | |
(provide (contract-out [run-program (-> path-string? void?)] | |
[continue (-> void?)] | |
[this-step (or/c false? step?)] | |
[srcloc (-> any)]) | |
(struct-out step) |