Rewrite everything to use [] instead of vec() in value position.

This commit is contained in:
Graydon Hoare 2011-05-16 18:21:22 -07:00
parent ae030c5bf2
commit fbbc1a77d2
87 changed files with 1137 additions and 1134 deletions

View file

@ -28,10 +28,10 @@ type aminoacids = tup(char, u32);
fn make_cumulative(vec[aminoacids] aa) -> vec[aminoacids] {
let u32 cp = 0u32;
let vec[aminoacids] ans = vec();
let vec[aminoacids] ans = [];
for (aminoacids a in aa) {
cp += a._1;
ans += vec(tup(a._0, cp));
ans += [tup(a._0, cp)];
}
ret ans;
}
@ -91,7 +91,7 @@ fn make_repeat_fasta(str id, str desc, str s, int n) {
}
fn main(vec[str] args) {
let vec[aminoacids] iub = make_cumulative(vec(tup( 'a', 27u32 ),
let vec[aminoacids] iub = make_cumulative([tup( 'a', 27u32 ),
tup( 'c', 12u32 ),
tup( 'g', 12u32 ),
tup( 't', 27u32 ),
@ -106,12 +106,12 @@ fn main(vec[str] args) {
tup( 'S', 2u32 ),
tup( 'V', 2u32 ),
tup( 'W', 2u32 ),
tup( 'Y', 2u32 )));
tup( 'Y', 2u32 )]);
let vec[aminoacids] homosapiens = make_cumulative(vec(tup( 'a', 30u32 ),
let vec[aminoacids] homosapiens = make_cumulative([tup( 'a', 30u32 ),
tup( 'c', 20u32 ),
tup( 'g', 20u32 ),
tup( 't', 30u32 )));
tup( 't', 30u32 )]);
let str alu =
"GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG" +

View file

@ -7,7 +7,7 @@ native "llvm" mod llvm {
fn main() {
let vec[int] inputs = vec(
let vec[int] inputs = [
50000,
500000
//
@ -16,7 +16,7 @@ fn main() {
// during 'make check' under valgrind
// 5000000
// 50000000
);
];
let vec[Body::props] bodies = NBodySystem::MakeNBodySystem();
@ -38,13 +38,13 @@ fn main() {
mod NBodySystem {
fn MakeNBodySystem() -> vec[Body::props] {
let vec[Body::props] bodies = vec(
let vec[Body::props] bodies = [
// these each return a Body::props
Body::sun(),
Body::jupiter(),
Body::saturn(),
Body::uranus(),
Body::neptune());
Body::neptune()];
let float px = 0.0;
let float py = 0.0;