针对Scheme中的列表列表运行查询 [英] Running queries against a list of lists in Scheme
本文介绍了针对Scheme中的列表列表运行查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我被困在项目的中间.我有一个列表列表,例如:
I'm stuck in the middle of my project. I have a list of lists like:
'((a for apple) (b is book) (c in cat) (ronn live in NY))
现在,我想以列表的形式进行查询,并使其在我的列表中显示正确的条目.例如,如果我输入'(a for what)
或'(what in cat)
,它将显示(a for apple)
或(c in cat)
.如果输入'(ronn live in where)
,它将显示(ronn live in NY)
.
Now I want to make a query in the form of a list and have it display the correct entry in my list of lists. For example, if I input '(a for what)
or '(what in cat)
it will display (a for apple)
or (c in cat)
. If I input '(ronn live in where)
it will show (ronn live in NY)
.
有人可以帮我解决这个问题吗?
Can anyone help me solve this problem?
推荐答案
Lecture 4a, Pattern Matching and Rule-based Substitution
这篇关于针对Scheme中的列表列表运行查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文