stream Patterns as compileString
see also: Strings and Streams and Post
//__extensions to Patterns for streaming their content
//Julian Rohrhuber 2/24/01
+ Pattern {
storeOn { arg stream;
var title;
stream << this.class.name;
this.storeParamsOn(stream);
this.storeModifiersOn(stream);
}
}
+ Pbind {
storeOn { arg stream;
if(patternpairs.size > 6, {
stream.nl;
stream << this.class.name;
stream << "(";
stream.nl;
patternpairs.storeItemsOn(stream,2);
stream.nl;
stream << ")";
stream.nl;
}, {
stream << this.class.name;
stream << "(";
patternpairs.storeItemsOn(stream);
stream << ")";
})
}
}
+ Pbindf {
storeOn { arg stream;
if(patternpairs.size > 6, {
stream.nl;
stream << this.class.name;
stream << "(";
stream.nl;
patternpairs.storeItemsOn(stream,2);
stream.nl;
stream << ")";
stream.nl;
}, {
stream << this.class.name;
stream << "(";
patternpairs.storeItemsOn(stream);
stream << ")";
})
}
}
+ ListPattern {
storeParamsOn { arg stream;
stream << "(";
list.storeOn(stream);
stream << ", ";
repeats.storeOn(stream);
stream << ")";
}
}
+ Pswitch {
storeParamsOn { arg stream;
stream << "(";
list.storeOn(stream);
stream << ", ";
which.storeOn(stream);
stream << ")";
}
}
+ Pset {
storeParamsOn { arg stream;
stream << "(";
name.storeOn(stream);
stream << ", ";
value.storeOn(stream);
stream << ", ";
pattern.storeOn(stream);
stream << ")";
}
}
+ Pnot {
storeParamsOn { arg stream;
stream << "(";
name.storeOn(stream);
stream << ", ";
pattern.storeOn(stream);
stream << ")";
}
}
+ Pfin {
storeParamsOn { arg stream;
stream << "(";
count.storeOn(stream);
stream << ", ";
pattern.storeOn(stream);
stream << ")";
}
}
+ Plag {
storeParamsOn { arg stream;
stream << "(";
lag.storeOn(stream);
stream << ", ";
pattern.storeOn(stream);
stream << ")";
}
}
+ Pseries {
storeParamsOn { arg stream;
stream << "(";
start.storeOn(stream);
stream << ", ";
step.storeOn(stream);
stream << ", ";
length.storeOn(stream);
stream << ")";
}
}
+ Pstutter {
storeParamsOn { arg stream;
stream << "(";
n.storeOn(stream);
stream << ", ";
pattern.storeOn(stream);
stream << ")";
}
}
Links to this Page
- Public Library 3 last edited on 27 October 2006 at 9:41 pm by host81-159-217-15.range81-159.btcentralplus.com
- Strings and Streams and Post last edited on 27 June 2002 at 3:37 pm by max2-183.dialin.uni-hamburg.de
- enter. last edited on 29 January 2003 at 10:46 pm by 203.14.169.19
- Public Library SC2 last edited on 2 March 2005 at 2:20 pm by max2-223.dialin.uni-hamburg.de