职能是否只是抽象的变量?
After reading this question I started to wonder: is it possible to have a shuffling algorithm which does not modify or copy the original list? To make it clear: Imagine you are given a list of ...
无,其职能比仅仅得到<代码>int foo的价值还要多。 一项职能可以有内效果<>,例如分配记忆或开立档案。 此外,C或C++的职能不一定要退还价值。
如果你说“一个没有直接可用价值的变量”,那么你可以认为它是一种可变的变量,具有功能。
例如,用功能是头等物体的语文,你可以把功能作为参数传递给一种功能。
此外,在C中,你可以把职能点作为理由。
没有任何职能用于将编码分解成合乎逻辑的章节,以便重新使用和改进可读性。 使用变数来保存数据。
www.un.org/Depts/DGACM/index_spanish.htm 它取决于“弹性变量”的语言和含义。
例如,在Schala,可以界定一个抽象变量:
trait X {
val y: Int
}
而变数甚至可能“发挥职能”!
trait MyMath[T] {
// abstract
val square: (T) => T
}
object IntegerMath extends MyMath[Int] {
// concrete value (implementation) given to [previously-]abstract variable
val square = (i: Int) => i * i
}
IntegerMath.square(2) // 4
因此,......“取决于”。 然而,必须提供
C#支持以下概念:。 如果没有执行,
如果不提供执行方法,那么在汇编时间就删除了这种方法所用的方法和所有电话。
There are many more different kinds of programming languages -- some without side-effects (gasp) -- and these really should be at least mentioned to not be auto-boxed (lame Java pun) into a certain way (C/C++ e.g.) of thinking -- especially when talking about language design theory.
幸福 co。
页: 1 一项职能不仅仅是一个抽象的变量。
After reading this question I started to wonder: is it possible to have a shuffling algorithm which does not modify or copy the original list? To make it clear: Imagine you are given a list of ...
I wanted to know why the default value for a variable for a method of a class, cannot be a non-static method or member of the same class. Is there a reason for that ? Could not the compiler provide ...
I ve never used python before. I ve used php for about 5 years now. I plan to learn python, but I m not sure what for yet. If I can think of a project that might be better to do in python, I ll use ...
Theoretically, can one define a protocol where one machine does some remote calls on another machine (or more than one), and where in any part of the process, if any of the machines (or operations) ...
Im building a site where a user can add people to their "list". This list belongs to the user, but im wondering whats the best way to store/retrieve/loop through this list in a function, to show the ...
I ve found that lots of people use the words closure and block interchangeably. Most of these people can t explain what they re talking about. Some Java programmers (even ones from really expensive ...
Motivation: I d like to be able to use toy functional programming in languages without first-order functions, by using natural numbers instead of functions. A universal function is a function f : N ->...
What is the fastest algorithm that exists up with to solve a particular NP-Complete problem? For example, a naive implementation of travelling salesman is O(n!), but with dynamic programming it can be ...