闭包是函数语言的共有特征之一。
Closures are one of the common features of functional languages.
它采用函数语言中的一种常见模式处理列表。
It follows a common pattern in functional languages for dealing with a list.
传承自ml的函数语言中,函数是类型签名。
In the ML-descended functional languages, functions have type signatures.
许多函数语言均利用这一特点通过特定的方法实现列表遍历。
Many functional languages have specific methods to iterate over lists using this idiom.
对于这个问题,一个解决方案是使用专门针对伸缩设计的函数语言。
One solution to this problem is to use a functional language designed to scale.
闭包在很多编程语言中非常常见,特别是在Clojure等函数语言中。
Closures are common in many programming languages, especially in functional languages, such as Clojure.
注意,这里所说的 “第一种函数语言”十分贴切,因为一切都基于函数。
Notice that the phrase "first functional language" here is apt, as everything is based on functions.
尽管学习一门新的语言很麻烦,但对于函数语言,当您了解其特点后,学起来就容易得多。
Although learning a new language is a hassle, you get lots of bang for the buck from functional languages when you understand their features.
不同的是Scala融合了对象和函数语言设计,这非常值得我们在本期文章中进行讨论。
The differences have to do with the ways that Scala fuses object and functional language design, and they're well worth exploring this month.
但这种模式在函数语言和面向对象语言中的工作方式不同,所得到的结果也有所不同。
But there are differences in how the pattern works in a functional versus object-oriented language, and in the results it yields.
模式匹配是许多(但不是大多数)函数语言中可以找到的另一个特性,它提供了一些有用的功能。
Pattern matching is another feature found in many, if not most, functional languages, and offers some useful power.
通常,函数语言会避开while循环,因为while实现的大多数操作都可以使用递归来完成。
Normally, functional languages eschew the while loop, because most of what while does can be done instead with recursion.
因此,像大多数人一样,我钟爱使用 Erlang和Scala等函数语言进行并发编程。
So, like a lot of people, I've been caught up in the excitement about concurrent programming with functional languages like Erlang and Scala.
另一方面,也有许多编程语言是声明性样式,包括函数语言和逻辑语言,还包括通用语言和专用语言。
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.
与其他传统函数语言一样,Scala要求函数(在本例中为一个方法)必须始终返回一个值。
As with other traditional functional languages, Scala requires that functions (in this case a method) must always return a value.
Lisp是目前仍在使用的第二种最古老的编程语言(在Fortran之后)并被称为第一种函数语言。
Lisp is the second oldest programming language still used widely today (after Fortran) and is known as the first functional language.
您只需记得Scala像许多函数语言一样允许使用代码块(aka函数)作为参数并根据需要使用它们即可。
You just need to remember that Scala, like many functional languages, allows you to take blocks of code — aka functions — as parameters and apply them as desired.
由于Scala融合了对象和函数语言风格,我实际上建模了Person(如上所述),但并未创建子类型。
Due to Scala's fusing of objects and functional-language styles, I could actually model my Person, as described above, but without creating subtypes.
事实上,真正发生的事情是:在函数语言中,就像变量和常量一样,函数是一级概念,所以语法上也是一样地处理。
In fact, this is precisely what's taking place: in a functional language, functions are first-class concepts, like variables and constants, and so are syntactically treated as such.
函数语言的名称源于这样一种概念:程序行为应该像数学函数一样;换句话说,给定一组输入,函数应始终返回相同的输出。
Functional languages get their name from the concept that programs should behave like mathematical functions; in other words, given a set of inputs, a function should always return the same output.
函数语言结构,如高阶和一级函数,能让我对抽象的理解更进一步,让我更多地将精力放在代码能做什么而不是怎么做 上。
Functional language constructs such as higher-order and first-class functions allow me to climb one more rung up the abstraction ladder and focus more on what the code does rather than how it does it.
开发人员定义一个函数,这与c语言中的函数语言非常类似,并生成代码,使该函数对调用方而言看上去就像一个常规函数。
The developer defines a function, much like those in functional languages like c, and generates code that makes the function look like a normal function to the caller.
如果框架(或者—如果您选择一门函数语言,如Clojure或Scala—语言)能优化底层实现,那么您就可以自动从中获益。
If the framework (or - if you choose a functional language such as Clojure or Scala - the language) can optimize the underlying implementation, you automatically benefit.
您将看到的许多奇怪的、不可思议的东西都可以归功于Scala的函数特性,因此,简单介绍一下函数语言开发和演变的背景可能非常有用。
Much of the strange magic you're about to see is due to Scala's functional nature, so a little background on the development and evolution of functional languages is probably in order.
XQuery是一种高端的、强类型的函数语言(没有副作用),非常适合表达从XML文档或者大型XML存储库(repository)中获取数据的查询。
XQuery is a high-level, strongly-typed, functional language (free of side-effects) that is ideal to express a query to obtain data both from an XML document and a large XML document repository.
大多数语言和环境都提供一种阅读和解析wsdl的机制,以确定可用的函数和数据交换。
Most languages and environments have a mechanism to read and parse the WSDL to determine the functions and data exchange that is available.
和其它大多数语言一样,可以在别的定制php函数中调用您的定制php函数。
As with most other languages, you can call your custom PHP functions within other custom PHP functions.
大多数语言都以基本上相同的方法来解析if语句和函数调用。
Most languages parse if statements and function calls in basically the same way.
例如,包含函数指针的多数语言都可用于可靠地支持函数编程。
For example, most languages that contain function Pointers can be used to credibly support functional programming.
例如,包含函数指针的多数语言都可用于可靠地支持函数编程。
For example, most languages that contain function Pointers can be used to credibly support functional programming.
应用推荐