//Julian Rohrhuber 1/2001
Pdict : Pattern {
var <>dict, <>whichName;
new { arg dict, whichName;
^super.new.dict_(dict).whichName_(whichName)
}
asStream {
^Routine.new({ arg inval;
var item, name, nameStream;
if(whichName.isKindOf(Symbol), {
dict.at(whichName).embedInStream(inval)
}, {
nameStream = whichName.asStream;
while ({
(name = nameStream.next).notNil;
},{
item = dict.at(name);
if(item.isNil, { name.post; " not found".postln; item = dict.at(\empty) });
item.embedInStream(inval);
})
})
})
}
}
/*authors so far: jrh */ |
new version at Pdict |