Closed ramagottfried closed 5 years ago
ah, actually I think for some reason the wildcard is assigning a reference, not the value -- so if you delete the value after assigning, it deletes the wildcard too:
----------begin_max5_patcher----------
598.3ocyV00aZCCE84jeEQ9o1pLH1wIEpzdcOu2GUHShg5tfcThChsp9ee1W
mLBExDsBXUB4He802ONm6gjW78PKTa40nfGB9Qfm2K9ddfIqAu18dn0rsYEr
ZvMjZTlZcopliBcmVxzYOIjqlWwyztHkLIYTTXPL4d6CbRj8AgNJJ3w1KsTI
0KYYbq+Qs1jMqExBtFxCYmQUityJt0pH2UKKd9KIndgrV7aHjXxntn5ts9Wk
bWsgP+sHpYa34yWzHyK3yK3xU5mfKmdryyYZlKBwIgASmX5K781EaGFAKVaQ
3PSCMvufGsA9Uee6R3IC37skUFTOmacrs1z7s.XiFuToB9pAYlImIM2QrRdy
Lz36lgBCfytENImaPA9MVK21EiBgjmoZjPfR5nyJdMWpYZgRNeOORGlvSmF4
X5T2Cf9mj9dHb7QIbxgDd56kv+VSQw2YY+jqMPR+ceP53My+6Xh6rEx+PVDG
O4pIKhO6xhXxkRVz6GlDFPM2mR5rPo1qmbnm+eDSGU6DOLmSow6oL.NOY5EQ
YP+zpLrP2C.rNdYeQxdnHYXTDSINkSbOTzplt.JGxYW4jbUTNoNkCNhXCBtc
ouKCJkNh.DBymGE3xOtBj.b20QAhuLJPnRgF9MepFztV66C30plprtTz9Nyf
c8aNuVKjva364i4CoFjRO07fOg7PNC4gdB4I9f73fQVY4FdUcqyPJLSnOqpr
amDBaER2Vf2PU7MhN+ofEVkYJSaFwZpfxBsM08mun0l45JYi.HdeayYRIL8K
Yq40ksiYfHw+U++.gmkqn.
-----------end_max5_patcher-----------
ok found it, the problem is that the assign function looks up the message to assign to via osc_bundle_s_lookupAddress
which in turn calls osc_match
which matches the wildcard to the first message in the bundle, whatever it is, for example:
----------begin_max5_patcher----------
509.3ocwT1riaCBDG+r8SAhSsUtYMD67Qe.54duYUDwljks1fEfib6p8cuvf
cWmTuJtsRakhfvvelgYlelmhivGTcbCF8IzWQQQOEGEAl7Fh5WGgqYcEULCH
CqVTnpaTFNNIrqk2Ygct6.S6loI6j2cTob+kLnoRH4EpVIHj1arQyMbokYEJ
49IUHaqExJt0bwwX1hGDxS607Ba3lS1luHMAQHDXJO0OsbyhTz8u3IUqcvUj
dqGUR6QVA2aKs2VPl86M7fuw3e4DQYnBb3wOtFOxEFwO.wD5hAuXXm4k6OzJ
Kq36q3xS1G7JxWM09kLKKDrk4Insa7YxZ+fOYRgAusTRh6Vd6ejUInr0AGsE
7S1kBxx7dK+2NHcBmPRoPgseXNtgft2mjOGG6GR924pO.srYRUykY1Ffjrku
UHyx+Rjg9VfLzP2Nidyl6+WFg20ncfRI2K7ZPwISbR9tcNhYGNAA3x6wSwEj
a+VxZ5Xvf9pfA8OAL9baU0WXEeiac2uwqlBXxdMfYTkCNG7gvUOhCYl29kkS
ipUWLba5eHC8RpUxMVgDdQdjlrflIaXyMNYyHNtuPtBLBoGqo4LWa5ECgvwE
Opz9kaRfkBYXIT5wZ9Ywf9LvBS6ZzVWWtUCWKb2pP8EW6nIsrU.U2Xex4BIv
bRVM2zz2SAzL943eBrpigJF
-----------end_max5_patcher-----------
so, I think assign()
shouldn't use any pattern matching to find which address to replace, but only replace exactly the address that is specified.
if you want to do pattern matching to decide which message to assign to, you can use the match
function to find the addresses, and then use assign
afterwards.
edit: so, actually there are two issues: (1) the address lookup routine shouldn't use pattern matching, and (2) it looks like the assignment is by reference but should be by value.
so far not seeing the where the problem is for issue 2.
ok, actually issue 2 was the same problem with using osc_match, but in the delete function. just pushed an update to libo which fixes both issues by using a simple strcmp instead of osc_match for assign and delete.
when assigning to a wildcard, the message used to assign then value seems to get eaten by assign(), but not with regular addresses