Open ramagottfried opened 3 years ago
(I just edited the example slightly to make it clearer)
ah! the plot thickens: /*
is a bundle, but /1
is a string
----------begin_max5_patcher----------
887.3oc2V0zaaiCD8r8uBAdIsEtNhTeXoBjC6kdt2qKLnkncYWYRARprNaP9
uuyPJ4XmXi3j3Br6BXSINbFNONyaFp6GOhrTuUXIQeI56QiFc+3Qi7hPAi5m
Ohrguspga8pQzSqk11F9cjIgUchsN+JWSgw6mqhhtdkVCuSmqdXxb00clFX1
bPg4Dbt6tVAH3J6UC6QiTIpzcJ+Fk0KT24ZDNT4.9HjnezujpaiTAK5gDsW3
JsxshW40NtWVK2U8SoZ8BinxE1lTJaZZRVVZdwrrIQErjowShnYw3ihrow66
k.FNvMx5PbX4u9bRFAk8v3w3vjyNBVo2zpshyKBdzXTxv4yHrBki6jZ0hipw
4FEYutnXFkNEhd4Ek9v1LbLs70D7X4CmLK+VQ8hkcp5FwhFgZs6mnV4EGa8Z
tiGfPB3+xBH0QmgCXRL1OfxhoS.3+x+RAkSmgXemjT3e9yTLADcQ7HMO3QZL
C2DZ+vAfJEWN64lF8iKKe6S+mgu8jp12CuK4eU7N1+i4chssFf7UKPEeF4Cu
V3ln0BGutFnUVg8Ceb20C2DgOb701OfJ9wixJYuHqjcJV4W6ZZ9Fu5OENxjC
l863NlYYkXyRZVtmtldR5J6HzU192w3syGDdxk1dPfxOLgX0clpgyb+1Aozc
tuVXcRkOvsmRv8ZdkNZR+r8T9Y3oA3797TxaySgfIus8Vgw1qs2I.O9WZCN0
2Jf.DgvTe9gXD2JGz2SBHbCv.bP5uy3AFYadJIXJv9MpNomDMFOdfKst6ZdZ
BTw2DLcYCPDizpn+B2x.umzsQn5NLLrb8JYSSktI.sQ6VApw544jvpS5E6mQ
CtMdZQNaVJVqOsXVbVQQ3shzDryviLzdyXClwJiokXapoIwkEwog2.QG0rfU
T+WXs+vipwUqa7fkMC+BrdosFcq1LjBAOTtS+NmdsgWKEgJ7Xubebcn8h2yK
jJLsJ1g6jRF0iaVVZI1CDda+i63G2FrpbovbX7FK8GRR.m5OLRdyicKd69cu
NKV4e2aGz+3IPpkafSrm43Ss8DiMcMN4PbX+hmc7oJdKFGi7MdCFUKVwA6d9
4an012iXmBXzKFvrP8BBrZ4sRnHw9Rf6zA+Cgdxofd1EG5R0JcjQr98A8eKo
cmzg8XtPwT5I.LK9sA3PqW+2JfPv116I+mTL9gw+Cj80WUK
-----------end_max5_patcher-----------
Ok, so this is extremely confusing, but not a bug. The input bundle is
/* : { /foo : 1}
and the program is
/url = getaddresses(),
/data = value(/url)
The first line of the program produces a binding of /url = "/*"
, so now the working bundle is
/* : { /foo : 1},
/url = "/*"
Then, when value(/url)
is evaluated in the second line, the address (string) /url
is compared to the pattern in the first message of the working bundle, which is /*
, which produces a match, resulting in value( { /foo : 1 } )
, which the value function just bails on.
There is a bug here--it's that value
doesn't report an error. But in terms of pattern matching, it's unfortunately doing the right thing, even if it's confusing
why does value do pattern matching with the wild card? I think only match
should do pattern matching, otherwise this means you can't operate on wildcard addresses, which would be unfortunate.
did you see the second issue?
<pre><code>
----------begin_max5_patcher----------
843.3oc2VszaaDBD9r8uBzdJox0YW12UpG5kdt2Sphv6hcHECq.1TmFk+6kA
Xsie07xpRsRV3kgY36aF9F18gwihlIWQ0QnOgtDMZzCiGMxYBLLJLeTzRxpF
NQ6bKRNsko63j6il3WsiXZtgIVbsh1X76TU7zrz77rhpx7InhX7z3Inj7X3u
zzownuGhctTXlSZnPXwAah9kLAmZbvkDLxZ8fO61OllGswSYuYWW8lL22Q8j
IJB8cXkGGOFFl7hyyF4xNolNflgtxkdQWjXGe3JABcwboDP9JwiCdwYBZirW
3bM83knjx5o1ZisDAEkpRXLq90TZv6WZvEu9RSXIM4NZ60y5Esb50bpXg4Fv
mhpCsdKwP76PpMGpqrGtIkv.bLG6F.awISrT+4+kYcNqDx+0VxfRydNlZMcR
PLoviXRLF1jjvvVjJCVNe+PO0poObBTSa2vchEUo+aKpv+GKpnq5TVkUKEbb
OkUuhi9LZA0PZaUTslpO67IWIt.NqrK.+YHKzmANd9Akb3WpjKOsBtNKIuvo
4xdm2wiwGVygOll6q8b92HM+fZhlr0rsJrNN4xvcdkmK+.6aWs0xdUy.DC8B
nMoVKUaXBhgIEO0Ir2oCdh9hQp3uFR3W.RvKc2AIewjz0cGUoCd6.wJRuUpf
ot97H6Qsep6zKRQuiM3uSODQTVwkwpr5UNhEspHKxGpUZqD8LmLYLjdVH0l6
46d.JHK8gNiaO2QRA5mvV5UQfHZFUscc.jkCQYSxunXD9latflnFIWptlIf7
K3V7TbZMFZzsOkmUCc51mJqxRg18cT8Z1uBwkfmtt34oT+RpneaF8twb1h4L
N2sEgcNr018NzpD4WcRvraVx.NUE3xL3xooUkw4UU9m1CmPX30zqNNo1Quz3
5p3L+SVSGLrPAw8EgOcXiaDwBtir3R3KFCV6TxNoZPVZQnds+8F4BEokQ8WZ
E6r6ToqK2cDkcUmxwUFBBik8bCaHlm17rVO0P5.LQtaU8A0RmSrwsubZ3VtK
Q3ioCR1UG7lIl11u.DqkcGy1jneNxcbs91TO8XTO+jSclXtDonKdeT+O0k8l
ongYf6XNQ0zjiPXb7aiv9qdceH.PAcW.I22KL9ww+FfRI.B3
-----------end_max5_patcher-----------
</code></pre>
or is that similar, that typetags
also does pattern matching? wow,... still really not sure that o.expr should do pattern matching without calling match
@ramagottfried, I think you're right that pattern matching in o.expr should be explicit, rather than implicit. I just checked the history, and this behavior has been there forever, so this would be a breaking change, although, I'm not sure anyone relies on it. I'm going to add this to the 1.4 list--I think it's too late to consider something as deep as this for 1.3.
@maccallum cool, that sounds good -- I'm fairly sure that not many people are using the hidden pattern matching functionality, since as far as I know there is no example of this in the documentation, I only stumbled on it when trying to operate on a wildcard address (that was then being sent to another process where the matching happens).
not sure what's going on here exactly -- any ideas? is it a bug? I think it might be.