0

我想收集一个原子列表并将一个列表传递给一个对象或抽象,该对象或抽象将通过匹配的原子而不修改列表的顺序或删除重复项。

(hello how are you) 
|
[desiredobject how are you]
|
[print]

理想情况下,这将打印(你好吗)。如果我要输入(如何输入),我会得到相同的信息。但是如果我输入 (jfj jfj jfj) 我什么也得不到。

[zl] 很有用,但我正在寻找 [zl filter] 的相反行为。

编辑:

我想出了以下解决方案,它与@mattijs 发布的解决方案同样有效。我的解决方案使用 [uzi] 给出列表中符号的索引。[zl filter] 的索引输出被馈送到 [zl unique] 以去除不需要的索引。这个新列表被馈送到 [zl lookup] 以转换回符号。插入(假)消息以防 [zl filter] 过滤所有内容,然后 [zl unique] 将没有输出。


----------begin_max5_patcher----------
1385.3oc0Z0scipBE95jmBVdclYo3Owbt67bz0r5hnzDZMfGEa6zYMu6GDvD
v+hoMM0dQzHHvlu89aCrc+mkKb1xdEW5.9GvcfEK9yxEKjEUWvB8yKbNfdMI
CUJeMGJ9E11GcVophiekKKNGjTvJKKvOfKvzDbyKPqNvp3YXtr0Pcoph3+NG
qFZGmUhefeoq9AFkWRdSVoG7mtm5KBscWki3I6Izc2WfS3pdKHVzDP755qdt
t02fhqG6dRpTjESie3CcLFSJ5fbLc92BBJywbDvEZLQCJhFPxvOiKJILpTNW
oKGkmaT7BilTijOxjcTzpiEQnph7NVTA9YRS6cOVJpPLO4hIYUgRHeMNxQU4
eW1L3m.gvvn5IdPP800wxaQvfSvfPQuKik7DN0bbbX4XJglWfKwTNh2RLbRw
Ofpx322uJxt9GPI3AabuX8BmcEjTFsVHrZYcwMC2c.uPopMzbxHeCJJumFWJ
lGUkaQE0v51Lrg4ivBlwxrq5nlTPDPTxADGyIJgE5drSIGxKHTt0.goHQeru
TPExxr5JUMO2SMoBkcB9ERJeuruLgRwqSxaTANGwnTxNbI2tLNZWocIVLaSq
PSFtU4sX5RtVS20kK6YTSW97QEijAYXMYvS87kby.o1zUewpgVLdWydrKqGF
IswCkWggMWs5OCler4LKgc3.lpgzlh+6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wLER0dEUMd0YkTnUHxF5PSV6lu6JncW8rilaxxy5oJOt2D4o0P0u7D
eyDG37Bcftelxix3tUh2VKJsR31VIaa2DscnjrULN+c4+C3uv.MC
-----------end_max5_patcher-----------
4

1 回答 1

1

所以基本上你想将列表 1 中的每个项目与列表 2 中的每个项目进行比较,并且如果它也在列表 2 中,则只通过列表 1 中的项目?

顺便说一句,这可能会被简化,只是一个快速的解决方案:


----------begin_max5_patcher----------
1198.3oc4Z1saihCEG+ZxSAhq6NBayWYuXk1mipQUFvIwcH1HvosyLpu6KXC
IlDRpIkkwilKBowewe94y4Xr64mqb7R4uQp8b+a2Gccb94JGGYQsE3z8aGu8
32xJv0xl4wHuxSe16AUUBxaBYwktYU755JxFREgkQ5avFNSTS+AosQ.3W76J
lcXOkUPDxwDdpP9AQeoftRKwhrcT11mpHYBkRQnlAxMtc3bA99seAat590tt
nFEw2KIp164crJZtTtMOB+EBpKRFdur0d+aEEW3oeyIUc7nCHMcfVPdgTUS4
LMo53gKK0J1QqKsT7YtbfBe3XQTlpHvwhpHuP66+ZUguupe3OQ.4yr7RTf7q
fDM.zLGtsfm8Mh7g0uuvbxFyGAdIgMVq6uLrkTVYEolvDXQm30uq3CEhmF2R
XX8avYjq14Qmgb71VQy4rVQLnmsE2e6dzEDJsUB00srELb4HcVv4Eo3p1ohz
Bxfo3FuCLitGKHBpROP+i8iturhxDCFKBC2LF6pa7OJJFLTpZdYjZxarBxHu
RyE6ji0IZMveU29R2ucP42x+cnOrvM0sPulqLkcgCLXXEZNwPsZFwQNzWyEF
A+R3PG4wclSwrsdOn4TetiML57GhyLc5q78Uq5+iGlebREMANlUZBtMMiWKo
IREPL97vhePnwKnXnUPw+w0+dfH7dgH.FnLFWOEaRoS+0.YfU.xsMgrVTRFo
.YnzPDE7YMGQVAEEtEKbLRkWMLNZJ1i2L9HHwJP4OJbYMquMqljFwRDLQ90Z
CMIuIKisEVtshenbQoYHPhwDokYHZNnYjsPyJx1eAVlvP4dZB7mCVFZIALS+
0DvbZKf+guTIHvVLMqOjtnllqUd1qk7L.NGlln+nMMApXkymoIb4v4dRcMdK
YTdti+pKth39c9gE8EM6np5K06IARt6WzD.9Sd2iPezrr6wELZo7Y26Z7v+d
4g5rI5VJNr+58t6k05BLiueOQcLQd+FPB.JZFQAxeIPgROdS2Kw2j24MHJ5F
rP+gELkG1SmMYAkcsi4SJp15GmB07CUY8SB8qN3NTf4jZAkc7nZe7TfuyZ3N
Zd9viFUcr04kbJSzIP2uZz71T0cfoxNvpjMvXcGZW5t0LAXptA1EuMR2H6R2
ISQ2VjcBxT66X6i2FqaKi2lXm.sq3fPSiCBsL663ona6w9FZreYjcw6PS0ch
cYeartg1ktiLMdhk89I.C4cf8g6eCcKa2vpYgAsKc2t6Ry2siE85IlZmflyc
o0UXeFF4Uiegj+TysoY+tOgEhJZ5AgZin5o+z1BdJtnK2nNdvNGyHmQyjm+u
R+mOJ8ht1YOonf7pZ9yjjea3oedqS9bRI9ldtSocVCPUlb.Rfik3Ulmtbf.U
9xgF+7QMLc4fI2Hc4lQV97lmc69LmrLAoR0nOIKgAp+O7xQSw06gkwKCKasK
69LirDr1eVXIHL3DKStaV5Our7ZI3pLw9l.DAihC+OJqVA.z34Ki9y7B4Jti
TTvc+jA2lXV81QA+v60bvLzH65viYUQpyW3tiWW9BR5KCes0pG1nKVmd70nu
XxyXI4agZJ1B0ThoZBrXZBYh8Txm.SM+38U+GN+kvWC
-----------end_max5_patcher-----------

希望有帮助,

马蒂斯

于 2013-08-03T19:46:12.963 回答