Three different Pdefs (same name ) different insrument

I created all the dx11 algoritms and sequenced and sequenced algo 2,3,4 from three Pdef with the same NAME \fmer , but a different instrument assignment
One Pdef.play but only the last algo plays \dex11algo2
Unless Pdef’s need to have a unique name ( in which case I 'vs totally forgot about that )
Here 's are the insr. algo,
and the file






//All 8 algoritms of the dx11 opamt defines the output level and thus the amount of phase modulation going into the carrier
(
SynthDef(\dex11algo1,///op4--->op3-->op2--->op1
	{
		|
		pitch=60,
		op1att=0.001,op1dec=5.250,op1amt=1,op1tune=0,
		op2att=0.001,op2dec=1.250,op2amt=1,op2tune=0,
		op3att=0.001,op3dec=1.250,op3amt=3,op3tune=0,
		op4att=0.001,op4dec=1.250,op4amt=1,op4tune=0,feedbackamt=0|
		var env1,env2,env3,env4,op1,op2,op3,op4,pan=(0.0),signal;

		env4=EnvGen.ar(Env([0,1,0],[op4att,op4dec],[0,-5]),doneAction:0);
		op4=SinOscFB.ar((pitch+op4tune).midicps,env4*feedbackamt);
		op4=op4*env4;
		op4=op4*op4amt;
		op4;
		env3=EnvGen.ar(Env([0,1,0],[op3att,op3dec],[0,-5]),doneAction:0);
		op3=SinOsc.ar((pitch+op3tune).midicps,op4);
		op3=op3*env3;
		op3=op3*op3amt;
		env2=EnvGen.ar(Env([0,1,0],[op2att,op2dec],[0,-5]),doneAction:0);
		op2=SinOsc.ar((pitch+op2tune).midicps,op3);
		op2=op2*env2;
		op2=op2*op2amt;
		env1=EnvGen.ar(Env([0,1,0],[op1att,op1dec],[0,-5]),doneAction:2);
		op1=SinOsc.ar((pitch+op1tune).midicps,op2);
		op1=op1*env1;
		signal=op1*op1amt;
		signal=Pan2.ar(signal,pos:pan);
		Out.ar(0,signal);
}).add
)

/////
Synth(\dex11algo1)
/////////////////////
/////////////////////
(
SynthDef(\dex11algo2,//op4+op3--->op2--->op1
	{
		|
		pitch=60,
		op1att=0.001,op1dec=0.250,op1amt=1,op1tune=0,
		op2att=0.001,op2dec=0.250,op2amt=1,op2tune=24,
		op3att=0.001,op3dec=0.250,op3amt=3,op3tune=0,
		op4att=0.001,op4dec=0.250,op4amt=1,op4tune=0,feedbackamt=1|
		var env1,env2,env3,env4,op1,op2,op3,op4,pan=(0.0),signal;

		env4=EnvGen.ar(Env([0,1,0],[op4att,op4dec],[0,-5]),doneAction:0);
		op4=SinOscFB.ar((pitch+op4tune).midicps,env4*feedbackamt);
		op4=op4*env4;
		op4=op4*op4amt;
		op4;
		env3=EnvGen.ar(Env([0,1,0],[op3att,op3dec],[0,-5]),doneAction:0);
		op3=SinOsc.ar((pitch+op3tune).midicps);
		op3=op3*env3;
		op3=op3*op3amt;
		env2=EnvGen.ar(Env([0,1,0],[op2att,op2dec],[0,-5]),doneAction:0);
		op2=SinOsc.ar((pitch+op2tune).midicps,op3+op4);
		op2=op2*env2;
		op2=op2*op2amt;
		env1=EnvGen.ar(Env([0,1,0],[op1att,op1dec],[0,-5]),doneAction:2);
		op1=SinOsc.ar((pitch+op1tune).midicps,op2);
		op1=op1*env1;
		signal=op1*op1amt;
		signal=Pan2.ar(signal,pos:pan);
		Out.ar(0,signal);
}).add
)

/////
Synth(\dex11algo2)

////////////////
///////////////
(
SynthDef(\dex11algo3,//op3-->op2-->op1<--op4
	{
		|
		pitch=60,
		op1att=0.001,op1dec=0.4,op1amt=1,op1tune=0,
		op2att=0.001,op2dec=0.150,op2amt=2,op2tune=12,
		op3att=0.001,op3dec=0.250,op3amt=1,op3tune=0,
		op4att=0.001,op4dec=0.250,op4amt=1,op4tune=0,feedbackamt=0.5|
		var env1,env2,env3,env4,op1,op2,op3,op4,pan=(0.0),signal;

		env4=EnvGen.ar(Env([0,1,0],[op4att,op4dec],[0,-5]),doneAction:0);
		op4=SinOscFB.ar((pitch+op4tune).midicps,env4*feedbackamt);
		op4=op4*env4;
		op4=op4*op4amt;
		op4;
		env3=EnvGen.ar(Env([0,1,0],[op3att,op3dec],[0,-5]),doneAction:0);
		op3=SinOsc.ar((pitch+op3tune).midicps);
		op3=op3*env3;
		op3=op3*op3amt;
		env2=EnvGen.ar(Env([0,1,0],[op2att,op2dec],[0,-5]),doneAction:0);
		op2=SinOsc.ar((pitch+op2tune).midicps,op3);
		op2=op2*env2;
		op2=op2*op2amt;
		env1=EnvGen.ar(Env([0,1,0],[op1att,op1dec],[0,-5]),doneAction:2);
		op1=SinOsc.ar((pitch+op1tune).midicps,op2+op4);
		op1=op1*env1;
		signal=op1*op1amt;
		signal=Pan2.ar(signal,pos:pan);
		Out.ar(0,signal);
}).add
)


/////
~animal=Synth(\dex11algo3,[\op1att,0.001,\op1dec,0.1,\op2att,0.001,\op2tune,1.1,\op4dec,0.1,\op4amt,3,\pitch,48,\op3dec,0.01,\op3amt,5,\op2amt,10])
~canimal=Synth(\dex11algo4,[\op1att,0.001,\op1dec,0.1,\op2att,0.001,\op2tune,1.1,\op4dec,0.1,\op4amt,3,\pitch,48,\op3dec,0.01,\op3amt,5,\op2amt,10])
~lanimal=Synth(\dex11algo5,[\op1att,0.001,\op1dec,0.1,\op2att,0.001,\op2tune,1.1,\op4dec,0.1,\op4amt,3,\pitch,48,\op3dec,0.01,\op3amt,5,\op2amt,1])
~animal.free
~animal.set(\op1pitch,72,\op2dec,100,\op2amt,8);
///////////////////
//////////////////
(
SynthDef(\dex11algo4,//op2-->op1<--op3<--op4
	{
		|
		pitch=60,
		op1att=0.001,op1dec=0.4,op1amt=1,op1tune=0,
		op2att=0.001,op2dec=0.50,op2amt=1,op2tune=12,
		op3att=0.001,op3dec=0.5,op3amt=0,op3tune=12.1,
		op4att=0.001,op4dec=0.050,op4amt=1,op4tune=0.1,feedbackamt=1|
		var env1,env2,env3,env4,op1,op2,op3,op4,pan=(0),signal;

		env4=EnvGen.ar(Env([0,1,0],[op4att,op4dec],[0,-5]),doneAction:0);
		op4=SinOscFB.ar((pitch+op4tune).midicps,env4*feedbackamt);
		op4=op4*env4;
		op4=op4*op4amt;
		op4;
		env3=EnvGen.ar(Env([0,1,0],[op3att,op3dec],[0,-5]),doneAction:0);
		op3=SinOsc.ar((pitch+op3tune).midicps,op4);
		op3=op3*env3;
		op3=op3*op3amt;
		env2=EnvGen.ar(Env([0,1,0],[op2att,op2dec],[0,-5]),doneAction:0);
		op2=SinOsc.ar((pitch+op2tune).midicps);
		op2=op2*env2;
		op2=op2*op2amt;
		env1=EnvGen.ar(Env([0,1,0],[op1att,op1dec],[0,-5]),doneAction:2);
		op1=SinOsc.ar((pitch+op1tune).midicps,op2+op3);
		op1=op1*env1;
		signal=op1*op1amt;
		signal=Pan2.ar(signal,pos:pan);
		Out.ar(0,signal);
}).add
)

/////
Synth(\dex11algo4)
//////////////
//////////////
(
SynthDef(\dex11algo5,//op2-->op1   op4-->op3

	{
		|
		pitch=60,
		op1att=0.001,op1dec=5.250,op1amt=1,op1tune=0,
		op2att=0.001,op2dec=1.250,op2amt=1,op2tune=0,
		op3att=0.001,op3dec=1.250,op3amt=1,op3tune=0,
		op4att=0.001,op4dec=1.250,op4amt=1,op4tune=0,feedbackamt=0|
		var env1,env2,env3,env4,op1,op2,op3,op4,pan=(0.0),signal;

		env4=EnvGen.ar(Env([0,1,0],[op4att,op4dec],[0,-5]),doneAction:0);
		op4=SinOscFB.ar((pitch+op4tune).midicps,env4*feedbackamt);
		op4=op4*env4;
		op4=op4*op4amt;
		op4;
		env3=EnvGen.ar(Env([0,1,0],[op3att,op3dec],[0,-5]),doneAction:0);
		op3=SinOsc.ar((pitch+op3tune).midicps,op4);
		op3=op3*env3;
		op3=op3*op3amt;
		env2=EnvGen.ar(Env([0,1,0],[op2att,op2dec],[0,-5]),doneAction:0);
		op2=SinOsc.ar((pitch+op2tune).midicps);
		op2=op2*env2;
		op2=op2*op2amt;
		env1=EnvGen.ar(Env([0,1,0],[op1att,op1dec],[0,-5]),doneAction:2);
		op1=SinOsc.ar((pitch+op1tune).midicps,op2);
		op1=op1*env1;
		op1=op1*op1amt;
		signal=(op1+op3)/2;
		signal=Pan2.ar(signal,pos:pan);
		Out.ar(0,signal);
}).add
)
/////
Synth(\dex11algo5)

///////////////////
///////////////////
(
SynthDef(\dex11algo6,// op4--->ALL

	{
		|
		pitch=60,
		op1att=0.001,op1dec=5.250,op1amt=1,op1tune=0,
		op2att=0.001,op2dec=1.250,op2amt=1,op2tune=0,
		op3att=0.001,op3dec=1.250,op3amt=1,op3tune=0,
		op4att=0.001,op4dec=1.250,op4amt=1,op4tune=0,feedbackamt=0|
		var env1,env2,env3,env4,op1,op2,op3,op4,pan=(0.0),signal;

		env4=EnvGen.ar(Env([0,1,0],[op4att,op4dec],[0,-5]),doneAction:0);
		op4=SinOscFB.ar((pitch+op4tune).midicps,env4*feedbackamt);
		op4=op4*env4;
		op4=op4*op4amt;
		op4;
		env3=EnvGen.ar(Env([0,1,0],[op3att,op3dec],[0,-5]),doneAction:0);
		op3=SinOsc.ar((pitch+op3tune).midicps,op4);
		op3=op3*env3;
		op3=op3*op3amt;
		env2=EnvGen.ar(Env([0,1,0],[op2att,op2dec],[0,-5]),doneAction:0);
		op2=SinOsc.ar((pitch+op2tune).midicps,op4);
		op2=op2*env2;
		op2=op2*op2amt;
		env1=EnvGen.ar(Env([0,1,0],[op1att,op1dec],[0,-5]),doneAction:2);
		op1=SinOsc.ar((pitch+op1tune).midicps,op4);
		op1=op1*env1;
		op1=op1*op1amt;
		signal=(op1+op2+op3)/3;
		signal=Pan2.ar(signal,pos:pan);
		Out.ar(0,signal);
}).add
)

/////
Synth(\dex11algo6)
//////////////////
/////////////////
(
SynthDef(\dex11algo7,// op4--->op3    op2+op1-->out

	{
		|
		pitch=60,
		op1att=0.001,op1dec=5.250,op1amt=1,op1tune=0,
		op2att=0.001,op2dec=1.250,op2amt=1,op2tune=0,
		op3att=0.001,op3dec=1.250,op3amt=1,op3tune=0,
		op4att=0.001,op4dec=1.250,op4amt=1,op4tune=0,feedbackamt=0|
		var env1,env2,env3,env4,op1,op2,op3,op4,pan=(0.0),signal;

		env4=EnvGen.ar(Env([0,1,0],[op4att,op4dec],[0,-5]),doneAction:0);
		op4=SinOscFB.ar((pitch+op4tune).midicps,env4*feedbackamt);
		op4=op4*env4;
		op4=op4*op4amt;
		op4;
		env3=EnvGen.ar(Env([0,1,0],[op3att,op3dec],[0,-5]),doneAction:0);
		op3=SinOsc.ar((pitch+op3tune).midicps,op4);
		op3=op3*env3;
		op3=op3*op3amt;
		env2=EnvGen.ar(Env([0,1,0],[op2att,op2dec],[0,-5]),doneAction:0);
		op2=SinOsc.ar((pitch+op2tune).midicps);
		op2=op2*env2;
		op2=op2*op2amt;
		env1=EnvGen.ar(Env([0,1,0],[op1att,op1dec],[0,-5]),doneAction:2);
		op1=SinOsc.ar((pitch+op1tune).midicps);
		op1=op1*env1;
		op1=op1*op1amt;
		signal=(op1+op2+op3)/3;
		signal=Pan2.ar(signal,pos:pan);
		Out.ar(0,signal);
}).add
)

/////
Synth(\dex11algo7)
////////////////////
//////////////////////
(
SynthDef(\dex11algo8,// all out

	{
		|
		pitch=60,
		op1att=0.001,op1dec=5.250,op1amt=1,op1tune=0,
		op2att=0.001,op2dec=1.250,op2amt=1,op2tune=0,
		op3att=0.001,op3dec=1.250,op3amt=1,op3tune=0,
		op4att=0.001,op4dec=1.250,op4amt=1,op4tune=0,feedbackamt=0|
		var env1,env2,env3,env4,op1,op2,op3,op4,pan=(0.0),signal;

		env4=EnvGen.ar(Env([0,1,0],[op4att,op4dec],[0,-5]),doneAction:0);
		op4=SinOscFB.ar((pitch+op4tune).midicps,env4*feedbackamt);
		op4=op4*env4;
		op4=op4*op4amt;
		op4;
		env3=EnvGen.ar(Env([0,1,0],[op3att,op3dec],[0,-5]),doneAction:0);
		op3=SinOsc.ar((pitch+op3tune).midicps );
		op3=op3*env3;
		op3=op3*op3amt;
		env2=EnvGen.ar(Env([0,1,0],[op2att,op2dec],[0,-5]),doneAction:0);
		op2=SinOsc.ar((pitch+op2tune).midicps );
		op2=op2*env2;
		op2=op2*op2amt;
		env1=EnvGen.ar(Env([0,1,0],[op1att,op1dec],[0,-5]),doneAction:2);
		op1=SinOsc.ar((pitch+op1tune).midicps );
		op1=op1*env1;
		op1=op1*op1amt;
		signal=(op1+op2+op3+op4)/4;
		signal=Pan2.ar(signal,pos:pan);
		Out.ar(0,signal);
}).add
)

/////
Synth(\dex11algo8)



and the Pdef’s

(
Pdef(\fmer,
	Pbind(\instrument,
		\dex11algo3,
		\dur,Pseq([1/2,1/2,1/4,1/2,1,1/2,1/4],inf),
			\pitch,Pseq([48,44,60,48,40],inf),
))
)
///
(
Pdef(\fmer,
	Pbind(\instrument,
		\dex11algo4,
		\dur,Pseq([1/2,1/2,1/4,1/2,1,1/2,1/4],inf),
			\pitch,Pseq([48,44,60,80,40],inf),
))
)
/////////(
(
Pdef(\fmer,
	Pbind(\instrument,
		\dex11algo2,
		\dur,Pseq([1,1,1/2,1],inf),
			\pitch,Pseq([48,72,60,48,40].reverse,inf),
))
)
//////


Pdef(\fmer).play(~war)
Pdef(\fmer).stop(~war)
~war=TempoClock(124/60).permanent_(true);

I am def. convinced there are bugs and this time it is not user error , I have reported this before
Here in this code you see 3 pdefs all having the same name \fmar, I refreshed the code for each pdef
Two pdefs.plays have different names , \fmar, \fmor
Executing these plays not the pbinds that they are supposed to play
See screenshot and colour legend
The two other tabs , one houses the SynthDefs for the algo’s and one is a pad sound with absolutely no relation to the pbinds .
Closing the tab with the pad sounds and everything behaves as normal again
I saved the tabs called bugtab1 , bug tab2 , bugtab3 , and now it behaves back as normal


The bug ( which I think it is ) d very easy to replicate

step 1 :Load tab 1 , tab 2
step2:Execute the FM SynthDef algo’s 2 and 3 on tab 2
—On tab 1— ,
step 3 :name the pdefs accordingly (pdefs NOT pdef.play)
first : \fmar
second: f\mor
third: \fmer

step4: execute Pdef play , result is correct
step5: Press ctrl .stop

step 6 : Now rename all three Pdefs to \fmar and refresh the code blocks .
step 7: Now execute any Pdef play that is NOT called \fmar , result is that it will play whci is not expected bahaviour
Please look into this becasue I really think this is a bug

(
Pdef(\fmar,
	Pbind(\instrument,
		\dex11algo3,
		\dur,Pseq([1/2,1/2,1/2,1/2,1/2],inf),
			\pitch,Pseq([48,44,60,48,40],inf),
))
)
///
(
Pdef(\fmar,
	Pbind(\instrument,
		\dex11algo3,
		\dur,Pseq([1/2,1/2,1/2,1/2,1/2],inf),
			\pitch,Pseq([56,60],inf),
))
)
/////////(
(
Pdef(\fmar,
	Pbind(\instrument,
		\dex11algo2,
		\dur,Pseq([1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4],inf),
			\pitch,Pseq([48,48,40,40,48,48,44,44,72,60],inf)+12,
))
)
//////


Pdef(\fmar).play(~war)
Pdef(\fmar).stop(~war)
Pdef(\fmor).play(~war)
Pdef(\fmor).stop(~war)
Pdef(\fmer).play(~war)
Pdef(\fmer).stop(~war)
~war=TempoClock(124/60).permanent_(true);
(
Pdef(\fmar,
	Pbind(\instrument,
		\dex11algo3,
		\dur,Pseq([1/2,1/2,1/2,1/2,1/2],inf),
			\pitch,Pseq([48,44,60,48,40],inf),
))
)
///
(
Pdef(\fmar,
	Pbind(\instrument,
		\dex11algo3,
		\dur,Pseq([1/2,1/2,1/2,1/2,1/2],inf),
			\pitch,Pseq([56,60],inf),
))
)
/////////(
(
Pdef(\fmar,
	Pbind(\instrument,
		\dex11algo2,
		\dur,Pseq([1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4],inf),
			\pitch,Pseq([48,48,40,40,48,48,44,44,72,60],inf)+12,
))
)
//////


Pdef(\fmar).play(~war)
Pdef(\fmar).stop(~war)
Pdef(\fmor).play(~war)
Pdef(\fmor).stop(~war)
Pdef(\fmer).play(~war)
Pdef(\fmer).stop(~war)
~war=TempoClock(124/60).permanent_(true);

Ok much easier .
load file
-Excute the Synthdefs and Pdefs
-Rename second Pbind to \fmir
-Play Pbind(\fmir).play

result is correct
Now rename second Pbind (the sequence part) to donkeypants or any other name ,execute code
Now execute Pbind(\fmir).play
Result, donkeypants will play
Same whe you rename any other Pdef,Pbind to any other name (donkeypants, clownfactory etccc) , executing the Pdefplay still plays the old names which I assume are still held in memory
NOt expected bahviour

`(
Pdef(\fmar,
	Pbind(\instrument,
		\dex11algo3,
		\dur,Pseq([1/2,1/2,1/2,1/2,1/2],inf),
			\pitch,Pseq([48,44,60,48,40],inf),
))
)
///
(
Pdef(\donkypants,
	Pbind(\instrument,
		\dex11algo3,
		\dur,Pseq([1/2,1/2,1/2,1/2,1/2],inf),
			\pitch,Pseq([56,60],inf),
))
)
/////////(
(
Pdef(\fmor,
	Pbind(\instrument,
		\dex11algo2,
		\dur,Pseq([1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4],inf),
			\pitch,Pseq([48,48,40,40,48,48,44,44,72,60],inf)+12,
))
)
//////



Pdef(\fmar).play(~war)
Pdef(\fmar).stop(~war)
Pdef(\fmir).play(~war)
Pdef(\fmir).stop(~war)
Pdef(\fmor).play(~war)
Pdef(\fmor).stop(~war)

~war=TempoClock(124/60).permanent_(true);





(
SynthDef(\dex11algo3,//op3-->op2-->op1<--op4
	{
		|
		pitch=60,
		op1att=0.001,op1dec=0.4,op1amt=0.7,op1tune=0,
		op2att=0.001,op2dec=0.150,op2amt=2,op2tune=12,
		op3att=0.001,op3dec=0.250,op3amt=1,op3tune=0,
		op4att=0.001,op4dec=0.250,op4amt=1,op4tune=0,feedbackamt=0.5|
		var env1,env2,env3,env4,op1,op2,op3,op4,pan=(0.0),signal;

		env4=EnvGen.ar(Env([0,1,0],[op4att,op4dec],[0,-5]),doneAction:0);
		op4=SinOscFB.ar((pitch+op4tune).midicps,env4*feedbackamt);
		op4=op4*env4;
		op4=op4*op4amt;
		op4;
		env3=EnvGen.ar(Env([0,1,0],[op3att,op3dec],[0,-5]),doneAction:0);
		op3=SinOsc.ar((pitch+op3tune).midicps);
		op3=op3*env3;
		op3=op3*op3amt;
		env2=EnvGen.ar(Env([0,1,0],[op2att,op2dec],[0,-5]),doneAction:0);
		op2=SinOsc.ar((pitch+op2tune).midicps,op3);
		op2=op2*env2;
		op2=op2*op2amt;
		env1=EnvGen.ar(Env([0,1,0],[op1att,op1dec],[0,-5]),doneAction:2);
		op1=SinOsc.ar((pitch+op1tune).midicps,op2+op4);
		op1=op1*env1;
		signal=op1*op1amt;
		signal=Pan2.ar(signal,pos:pan);
		Out.ar(0,signal);
}).add
)`

Pdef registers patterns by key. Each key can be associated with one pattern.

You can’t “change the name” of a Pdef. You can only register a new association of a key with a pattern.

If you associate \fmer with pattern1 and then associate \foo to pattern1, \fmer and \foo are both associated with pattern1.

If you want one of those keys not to be associated to a pattern, call .clear on it Pdef(\fmer).clear

I am not sure if I understand correctly
My point is that Renaming Pdef(\name’Pbind,(\instrument does not work
Pdef(play)keeps referenceing the old name of Pdef,pbind
The only solution is to rename both Pdef,bind and pdef(play)to the same name

you don’t use or reference Pdef objects directly.

Pdef looks up patterns by name.

first clear the dictionary
Pdef.removeAll

Pdef(\foo, Pbind(\dur, 0.5)) // associates \foo with a new Pdef instance (a subclass of PatternProxy) whose source is Pbind(\dur,0.5)

Pdef(\foo).value.isKindof(PatternProxy) // true

Pdef(\foo).play // play the proxy associated with \foo

If you change ‘\foo’ to ‘\bar’ in the first line in above paragraph:

Pdef(\bar, Pbind(\dur,0.5)) // associates \bar with a new proxy with source Pbind(\dur,0.5)

you now have 2 entries in the global dictionary in Pdef:
Pdef.all // 2 entries, one for \foo, one for \bar

what is the source of the value associated with \foo?
Pdef(\foo).source // a Pbind
what are that pbind’s pattern pairs?
Pdef(\foo).source.patternpairs // [\dur, 0.5]

Let’s change the pattern associated with \foo
First let’s play the pattern:
Pdef(\foo).play

then change it
Pdef(\foo, Pbind(\dur,0.1))

When the source for a PatternProxy changes, any PatternProxyPlayer that is playing that PatternProxy will start playing the new source.

This is the use case for Pdef - you can change patterns that are playing. and you can change them in multiple places in your code at once. You might have another pattern that has this Pdef inside it.

Again: you change what’s playing by changing the source of a proxy that’s associated with a given key. The patterns themselves aren’t being named or renamed.

This kind of registry is a common coding pattern in SC - also used in SynthDefs for example - each new SynthDef associates a key with a synthesis graph.

So when you write above “three different Pdefs, same name” you need to be clear. There is only ever one entry in the dictionary at a given key. There is only one `Pdef(\foo)". You can change its source but you can’t change its name.