Is Pdef.map bugged?

There are no usage examples for Pdef.map in the help files as far I can tell, and it seems to me it’s pretty bugged.

Pdefn(\nums, Pseq((1..5)))

Pdef(\huh).map(\degree, \nums)

Pdef(\huh).envir // -> ( 'degree': Pdefn('nums') )

Pdef(\huh, Pbind(\dur, 0.2)).play

Pdef(\huh).envir.clear // now it plays something

The problem is that envir in general is a simple Event, so map should probably instantiate streams or something like that.

Has this been discussed somewhere before?

I can only give the answer that I have given in a parallel thread 5 minutes before, search the mailing list archives !

Pdef map shows up 95 matches, probably only few are relevant. Very specific questions regarding JITLib stuff might be better posed on the mailing list, Julian and Alberto are around there.

1 Like

I think I found an answer from there:

first, map only works with values, not with patterns (this is an incomplete implementation)