不可变数据是函数编程中的一个重要元素。
Immutable data is an important element of functional programming.
重构为纯函数中所述,使用纯函数是函数编程的一个示例。
Refactoring Into pure functions, using pure functions is an example of functional programming.
在这一部分中,我讨论的是函数式编程的基石之一:不变性。
In this installment, I discuss one of the building blocks of functional programming: immutability.
在大部分编程语言中,定义和命名函数是同一个操作。
In most programming languages, defining and naming functions are the same operation.
函数式编程的核心是函数,就像面向对象语言的主要抽象方法是类。
At the core of functional programming is the function, just as classes are the primary abstraction in object-oriented languages.
另一方面,也有许多编程语言是声明性样式,包括函数语言和逻辑语言,还包括通用语言和专用语言。
On the other hand, there are also many programming languages that are declarative in style, including both functional and logic languages, and also including both general purpose and specialized ones.
Vimscript是一种严肃的编程语言,因此它天生就支持创建用户定义函数。
Vimscript is a serious programming language, so it naturally supports the creation of user-defined functions.
我将关注Solr的函数查询,因为它们是最容易使用的并且不需要编程。可以在Lucene中轻松地使用它们,或者轻松地将它们移植到Lucene。
I'll focus on Solr's function queries because they are the easiest to use and require no programming to leverage, but they can easily be used in or ported to Lucene.
要想了解函数编程风格的好处以及它在Erlang中的实现方式,最好的方法是了解fibonacci函数。
A perfect way to see the benefits of the functional programming style, and how this works within Erlang, is to look at the Fibonacci function.
Web服务是适于销售的函数,可以使用任何平台和任何编程语言访问它们。
Web services are sellable functions that can be accessed independent of platforms and programming languages.
为了处理真实Vim编程任务的复杂性,需要将应用程序分解为正确的、可维护的组件,而函数是实现这个过程的基本工具。
Functions are an essential tool for decomposing an application into correct and maintainable components, in order to manage the complexity of real-world Vim programming tasks.
无应用程序更改,onmode标志,或者SQL应用程序编程接口(API)函数是必需的。
No application changes, onmode flag, or SQL application programming interface (API) functions are needed.
Ocaml被选中的一部分原因是,它支持函数式、命令式和面向对象的混合编程风格。
OCaml as was chosen a basis in part because it supports a mix of functional, imperative, and object-oriented programming styles.
Lisp是目前仍在使用的第二种最古老的编程语言(在Fortran之后)并被称为第一种函数语言。
Lisp is the second oldest programming language still used widely today (after Fortran) and is known as the first functional language.
闭包最初是在20世纪60年代作为Scheme的一部分开发的,Scheme是最著名的函数编程语言之一。
Closures were originally developed in the 1960s as part of Scheme, one of the most well-known functional programming languages.
我把Clojure看作是一种面向函数编程的数据结构。
One parting thought is that I have come to think of Clojure as sort of a data structure oriented functional programming.
我们先从一个机制开始,用这个机制可以表示包含计算模式的闭包,计算模式是一个来自函数式编程的概念。
We'll start with a mechanism by which you can express closures that embody a pattern of computation, which is a concept from functional programming.
了解一个诸如函数式编程的新范例的一大挑战是了解其新的构建块,并将这些构建块看作是问题的潜在解决方案。
One of the challenges of learning a new paradigm like functional programming is learning the new building blocks and "seeing" them peek out of problems as a potential solution.
这个名字是函数式编程的协定。
但是,有这样的场景,函数式编程概念应用程序可适用于PHP应用程序,其结果是代码变得更简单、更简洁、更易于理解。
But there are scenarios where the application of functional programming concepts can be applied to PHP applications, resulting in code that is simpler, more concise, and easier to understand.
不变性是函数式编程的关键,因为它与尽量减少变化部分的这一目标相一致,这使得对这些部分的推断更为容易一些。
Immutability is key to functional programming because it matches the goals of minimizing the parts that change, making it easier to reason about those parts.
函数式编程是一种宽泛的、跨领域的计算机科学,并在最近受到广泛关注。
Functional programming is a wide, sprawling area of computer science that has seen a recent explosion of interest.
函数编程是一种编程风格,它将关注点从执行命令转移到表达式计算。
Functional programming is a style of programming that moves the focus from executing commands to the evaluation of expressions.
转向函数式编程的好处之一是让人们意识到,测试的存在是为了检查代码中成功发生的转变。
One of the benefits of switching to a functional mindset is the realization that tests exist to check that changes occur successfully in code.
严格来讲,E编程语言是一种动态输入的函数性编程语言,而非一种框架。
Strictly speaking, the E programming language is a dynamically typed functional programming language, not a framework.
编程模型是优雅的,基于构造函数的风格意味着您无需包括无参构造函数。
The programming model is elegant, and the constructor-based style means you don't have to include a constructor without arguments.
这是一种很普遍的编程示例,很重要的一点是,你们需要记住一点,成员函数和函数的请求是有区别的。
This is a very common programming paradigm, and it's important to sort of lock into your heads, the distinction between the method and an invocation of the method.
很久以前,函数被称为“子程序”(我知道,我这样说证明我已经老了!)管理复杂性的主要方式之一是自顶向下的编程模式。
A long time ago, when functions were called "subroutines" (I'm dating myself, I know), one of the main ways to manage complexity was top-down programming.
这是与基于特定语言API 的交互完全不同的,在基于 API 的交互中,客户端是通过传递特定编程语言的可变参数到远程代理来调用服务器函数的。
This is in contrast to language-bound, API-based interaction, whereby a client invokes server functions through remote proxies by passing variable arguments in a programming language.
看到函数性编程的一些局限性后,您可能认为这种编程范式是一种倒退,但请继续往下阅读。
Now that you've seen some of the restrictions of functional programming, you're probably thinking the programming paradigm is a step back to the dark ages, but stay with me.
应用推荐