Pattern matching is also useful for the design problem where you need to get at data inside an object, but only in special circumstances.
在你遇到需要从对象内部提取数据的设计问题时,模式匹配也有用,但是仅限一些特殊的情况。
Listing 11 shows some basic usage of the pattern matching expansions.
清单11给出了模式匹配扩展的一些基本用法。
Our brains are just pattern matching machines, so we tend to notice patterns like that.
我们大脑是模式匹配机器,因此我们更容易注意到这样的模式。
This article has been a quick tour of pattern matching in F# and introduced its new active patterns feature.
这篇文章是F#中模式匹配的一个快速浏览,并介绍了它的新活动模式的特性。
CEP engines have sophisticated techniques for event correlation, based on pattern matching and event definitions, and might be spatial or temporal.
CEP引擎具有成熟的事件关联技术(基于模式匹配和事件定义),可以采用空间或时间模式工作。
For example, we can assign values to two variables simultaneously with one pattern matching (see Listing 31).
例如,可以使用一个模式匹配同时为两个变量赋值(参见清单31)。
The key to success with a socket wrench is pattern matching: The socket must match the nut.
成功使用套筒扳手的关键在于模式匹配:套筒扳手必须与螺母相匹配。
These techniques are based on pattern matching and event definitions and can be spatial or temporal.
这些技术都是基于模式匹配和事件定义的,可以是空间上的或时间上的。
Pattern matching is a powerful and elegant way of extracting information from objects, when used appropriately.
模式匹配在使用恰当时是一个强大的,优雅的从对象中抽取信息的方式。
It is a formal pattern that a specific program looks for in text or a string of characters using a recognition process called pattern matching.
它是一种形式模式,一个特定程序使用名为模式匹配的识别流程在文本或字符串中进行查找。
The pattern matching operation is potentially expensive, so it is vital to focus the search intelligently.
模式匹配操作可能是非常昂贵的,因此智能地集中搜索是非常重要的。
The categorization is achieved by employing pattern matching techniques on the data types of objects in the ownership context of each object in the dumps.
通过对转储中每个对象所属权上下文中的对象数据类型使用模式匹配技术来完成分类。
The key is pattern matching, as in Figure 1. Instead of coding commands, you code patterns.
其中的关键就是模式匹配,如图1 所示。您不需要编写命令,需要编写的是模式。
Pattern matching is another feature found in many, if not most, functional languages, and offers some useful power.
模式匹配是许多(但不是大多数)函数语言中可以找到的另一个特性,它提供了一些有用的功能。
Assigning values to variables is actually a special type of pattern matching.
为变量赋值实际上就是一种特殊的模式匹配。
In that example, pattern matching was used to extract both the head and the tail of the list.
在这个示例中,使用模式匹配提取列表的开头和结尾部分。
You'll recognize several parameter expansions, including length, substring, pattern matching, and pattern replacement in even this short piece of script.
即使在这样一小段脚本中,您也可以找到一些参数扩展,包括长度、子字符串、模式匹配和模式替换。
Rules to pattern matching in both these files will control what gets denied or allowed.
这两个文件中的模式匹配规则控制拒绝或允许什么。
This article takes a closer look at active patterns a feature that adds to F#'s already strong pattern matching capabilities.
这篇文章是对活动模式这个特性的详细讨论,F#已经具备相当强大的模式匹配能力。
The idea of active patterns is to enable you to use the pattern matching syntax with other data structures.
活动模式的思想就是让你能把模式匹配语法用于其他数据结构。
This tutorial also assumes that you understand the value of developer testing and are familiar with basic pattern matching.
本教程也假设您理解开发人员测试的价值,并熟悉基本模式匹配。
For example, the ability to define multiple approaches to the same functions and employ pattern matching for recursive calls simplifies some functions.
例如,可以为同一函数定义多种处理方式,还可以对递归调用应用模式匹配,这样做可以简化某些函数。
Finally, we can use pattern matching to pull out the elements from a list or tuple using the construct notation mentioned earlier.
最后,可以按前面提到的构造表示方法,使用模式匹配从列表或元组中提取元素。
You can limit the categories that are searched, and you can use Boolean expressions and pattern matching to further refine the search.
您可以限制搜索的类别,还可以使用布尔表达式和模式匹配来进一步精化搜索。
There are a number of ways to do this, but you will demonstrate how you can once again use pattern matching for this.
实现上述操作有许多方法,但我们将演示如何再一次使用模式匹配方法。
Matching modes, which describe the different types of pattern matching that can be specified through the function's parameter mode.
匹配模式,描述了可以通过函数的参数MODE指定的模式匹配的不同类型。
Instead, consider using pattern matching for those "rare" times when you need to extract information in a controlled way.
相反地,在你需要通过可控方式获取信息的时候,考虑使用模式匹配。
Routes make use of regular expressions for pattern matching, and are expressed using XML.
路由在模式匹配时使用正则表达式,并且使用XML表示。
If it's not, it won't — one of the tricky things about performing pattern matching.
如果格式不好,则不会正确匹配——这是执行模式匹配任务的一件棘手之事。
An idea borrowed from functional languages, pattern matching is a powerful yet concise way to make a programmatic choice between multiple conditions.
模式匹配是从函数式语言中引入的强大而简洁的多条件选择跳转方式。
应用推荐