CNMAT / CNMAT-odot

Multi-paradigm Dynamic Programming
Other
115 stars 11 forks source link

match() partial match not working as expected #351

Closed ramagottfried closed 7 years ago

ramagottfried commented 7 years ago

I would expect with a match pattern /foo that /foo/x would be partially matched, but it's not:


----------begin_max5_patcher----------
793.3oc6Ws0aaBCE9YxuBDO0NQK1FCAOo95dduuTUQ.mV5HlHroKaU8+9rOF
HoD5kj0lsJMIhcNGe724h+.Nb+DGu4Uq4RO2O69MWGm6m33.pLJbZkc7VltN
qLUBl4UcdV0xUURtmucUEesBVIXQUU.Nfn+OtawpFUIWo94Jt0GddtW1tjnY
YgPuH.KoU4hJgZQZFXMpU2pTU1MEhquplmorvPY3yQ9tDB0LgQLPRKzitAHY
wu.fvjy6vpH2lDyu8LLxaSjXiSHTvctslK4BUppnRLlqiLSn1gd+JSuime07
FQdI+pRt3Z0Ml8QQisddpJ0hZXjuKKQmJ3olAHofAiNDV6iWwEQ+iZ1OhX.A
2NXTQY14nAagRMlGsCTX2KMw6CSlXF7eS3FGAdQXLcKdAK5.nErChUDFGd.r
hv3i.q.GOJq3uEKn6ID9yDAo440Rsvr9Ul4YzOOUVjErzb9pW89YhYp.8osh
WK5sFrTqeQSYoeqE0phzVgFArcd9.3mIdv3geTTl+BNH3SGtK5x7xBAOqpQ.
oOl99R9IQ.4KLl.SHKiDg2K5exAQ+IDj00r8h9Soevdp31vRs6kMsOpLCXyV
wQOBosD2u3n+5LbWVXJGfKMfBwHi0gKqaoXqVLhtadQi2Msv5H5soV2VT.D6
iE6.B2WdFqb+rEowevF4Q1NsOXSFf8y7LwMwIsONi5NTS1MLGIkS5fZScazC
BaA.gd6oF8EcVa32VGPuDw3CKe.pLj+yH1b8d7l50GgN1Hzj+zN1l97ux5ev
du.Uj2s1u3qWUqOYy4FC24j01z0EtWyUl+xkRt7jSG110Etv7I8Ma4Z23oC5
dZfgPSSclNZWPgOEe5K5tr9ZZ124JMBaKMNOCeX7rDaWQLXJhsWDs3wIZjsN
j.zfDdvGUCgjQ+iO4jUM0YcUfVxr6lXJmKUEBnaqsrI16oug+05GyW+dTbD6
H4m3WgezM2N3lJ64U5pU2wqksFCtPeO0sU0Fwo9fXgvJB7WuZ9cEc1CMw5kV
qobJMeqoFBKu0wTO6V02IVKZJ.h0DimeXxuAP9xyxA
-----------end_max5_patcher-----------
maccallum commented 7 years ago

This behavior is correct. /foo is the pattern, and /foo/x is the address, that is, imagine that /foo/x is the argument to o.route, and /foo is the incoming address:


----------begin_max5_patcher----------
530.3ocuTssaiBCD8Y3qvhmoo1bKP+.1m22WUE4.SRbWhMBaxltU8eewigTR
SpZVTUkhFGOdtb7YN3W78BVqNB5.xCjeQ77dw2yCcYc3Mr2KXO+XYMWigErG
zZ9VHHzclANZP++nqt9m7xeCFRbF4NVQQZTdLcYzXj0BITp5jX3ICNkc6ExZ
vf0NZvo17bMfEcL2FtobmPtcUKTZbnMqftfFRXYY1kTbSZ++IO9VoUclwZyF
75bYdtAbkIH3TBhJrmp0OcWxoF2BZPZ3FgRdsluztPGLjGsI8puu0DNO9b9D
RZQxEDRD8KhPhClwUSsnTsuQouTrb+FkxhA53IaTRiV7WDCrndn+VBkpZUqC
azEr77v2svN+JdI68wbUFCYrAtJ4Khqhldo1vKwfGuQZ9AnZ05NYUMrpFjaM
6rGGmcsyq3FtqSwogjB6kkszZrnlhFqOJqmLtgerrPRhMeZjsHrAyzPRRrGm
dYpySbKg+zyHWL9UKZ6oRfXkA2e7pRe1bj9Q3fLm8IR+nObbFN8crqNbYS+P
.C.eX6cOghXz5+btQq5ZKGalqZ8n9Tap.sQHw2ZlDSxYwrSTUAxoJpJglutF
PHRu5L5+AMzOAMweanI5FPy4H91QiavwaZN.s5gRh.oW99j60lkg3VgzsE0L
AsvAwX7wnGdauXzzqD6Zcxzi4YAtTUUPqrSfpYeame0+efsUutI
-----------end_max5_patcher-----------

On Oct 25, 2017, at 3:27 PM, rama gottfried <notifications@github.com mailto:notifications@github.com> wrote:

I would expect with a match pattern /foo that /foo/x would be partially mat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KZJ.h0DimeXxuAP9xyxA -----------end_max5_patcher----------- — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CNMAT/CNMAT-odot/issues/351, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjjdeIucSYyYY2IB2DYHLSZ1r00xGLwks5svzdNgaJpZM4QGADJ.

ramagottfried commented 7 years ago

ah! you're right, it works! cool! I had the argument order backwards, sorry -- I thought I tried that first, but apparently I missed something.

so just to get my vocabulary right in terms of the documentation, the "pattern" is the incoming address pattern, and the "string" is the thing to match it against.

what you would type into o.route, is the address that might be matched, but itself is not a pattern matching address, except for wildcards : )

right?

sorry for the noise!

ramagottfried commented 7 years ago

for posterity here a working version of the example I posted above:


----------begin_max5_patcher----------
761.3oc6W08aaBCD+YxeEH+T6DsXCFR7j5q6489xTEAbZoiXh.SW1p5+6y2Y
fQSnKM8qrIMoD6bmuO9c99Qxk6l3PVTtQVSb+n6WbcbtahiCpBT3zJ6PVkrI
sHoFMiTddZ4p0k0Rhm8TsbiFOweYYoOyOv7YV2gplUkM5BoFcl0p0pR+i0Ra
lID2u9aGxUc1GzpbYoRuLIEsl1pachN85b0UWVIS01vviiOm54x3bbiJfs.i
Pezg.Um+SLPrfy6hUdlszVbyYLZGzqStUlc4hFUVg7xBo5J80fUb5XmmknSr
fHLxyULyjd1TXAABt.5nLOSAr+WAl2bveZ.DDV6BnhKr6Qa4BmClGsSnXteE
v68Sl.KduJc4iVGNLTLnCKhdFMXwd5ugwuC8WV7n82iU+r6oVu4J+jrrpZiv
79SlS.8KRpyS8WA8Dyo2MWMW6a5PZYkZWqMmsronvq0pJcdRQuUcVznvnIyl
qtGxv2yKxdURf+GFKEcUdQtRlV1nvxmwOFz3fPJxbmALT2PZHJQYGDQd19Hx
b9+XeS0vvxs9Jl1iJXgAtxhdPjFHdX3n+0Yrtp.tNvTBAEwnPzEWQ2QwVsLJ
e25hGuaYwLH504tdVKVfH1iE6Bk0e8L108K+RBx4.em1C9YakqQvMeGby6wc
TWSd1gB6+72rN3hdzNm8FitGnanF8fWzB215ltOhw+4Cuu7AD1AuILh2heyc
yQaJpffvW5TTS+KdJJTUva1fTxMqqLc1LIX3NcV63SW3dkTCeTVWKqO4zsGf
5BWb+Dq4d8CFc5VyA8HFBC3b5nyyDNJeJ3w3SexLC0mSR+lTS7dfz37L1yhm
EzNei.2hDGDQKlLnIg9gE7V+kUL4f9G14pKapR6pUazvGlaSSlrVmqRz4kpA
1Xlq5Q4FO07HdB4oEKun7.+a02kDM8YkGa+JY85akU0sFiov7L0MkUf3TOTL
WYEQ9KoRdadm83PrjjJC4RaXVMUHrHah4DqqlmDqTM4HEZBj46m7KT4umxM
-----------end_max5_patcher-----------
maccallum commented 7 years ago

Yeah, that’s right. o.route doesn’t really take patterns as arguments except for /* which is done for compatibility with OSC-route.

On Oct 25, 2017, at 4:58 PM, rama gottfried notifications@github.com wrote:

ah! you're right, it works! cool! I had the argument order backwards, sorry -- I thought I tried that first, but apparently I missed something.

so just to get my vocabulary right in terms of the documentation, the "pattern" is the incoming address pattern, and the "string" is the thing to match it against.

what you would type into o.route, is the address that might be matched, but itself is not a pattern matching address, except for wildcards : )

right?

sorry for the noise!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CNMAT/CNMAT-odot/issues/351#issuecomment-339359005, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjjdS9rkqhPoC6uE5bGkuf5GlhafLbaks5sv0yogaJpZM4QGADJ.

ramagottfried commented 7 years ago

I <3 /*

: )

maccallum commented 7 years ago

:*

On Oct 25, 2017, at 5:12 PM, rama gottfried notifications@github.com wrote:

I <3 /*

: )

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CNMAT/CNMAT-odot/issues/351#issuecomment-339363687, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjjdWTMf6FVcSdkkhlllbXqHpeVsevEks5sv0_fgaJpZM4QGADJ.