这种语言功能已经存在吗?

发布于 2024-08-27 04:47:06 字数 4675 浏览 8 评论 0原文

我目前正在开发一种新的语言,用于在连续环境中进行编程(将其与电气工程进行比较),并且我对某种语言的构造有了一些想法。

让我通过解释和定义来解释该功能:

x = a U b;

其中 x 是变量,ab 是其他变量(或静态值) 。这就像 ab 之间的并集一样;没有重复,也没有特定的顺序。

with(x) {
    // regular 'with' usage; using the global interpretation of "x"
    x = 5;
    // effectively will do:
    // x = a U b U 5;
    // a = 5;
    // b = 5;
    // Thus, when "a" or "b" changes, "x" is still equal to "5".
}
with(x = a) {
    // this code block is executed when the "x" variable
    // has the "a" variable assigned. All references in
    // this code-block to "x" are references to "a". So saying:
    x = 5;
    // would only change the variable "a". If the variable "a"
    // later on changes, x still equals to 5, in this fashion:
    // 'x = a U b U 5;'
    // '[currentscope] = 5;'
    // thus, 'a = 5;'
}
with(x = b) {
    // same but with "b"
}
with(x != a) {
    // here the "x" variable refers to any variable
    // but "a"; thus saying
    x = 5;
    // is equal to the rewriting of
    // 'x = a U b U 5;'
    // 'b = 5;' (since it was the scope of this block)
}
with(x = (a U b)) {
    // guaranteed that "x" is 'a U b'; interacting with "x"
    // will interact with both "a" and "b".
    x = 5;
    // makes both "a" and "b" equal to 5; also the "x" variable
    // is updated to contain:
    // 'x = a U b U 5;'
    // '[currentscope] = 5;'
    // 'a U b = 5;'
    // and thus: 'a = 5; b = 5;'.
}
// etc.

在上面,所有代码块都被执行,但是每个块中的“范围”改变了 x 的解释方式。在第一个块中,x 保证为 a:因此与该块内的 x 交互将在 a 上交互>。仅在这种情况下,第二个和第三个代码块才相等(因为不是a:那么只剩下b)。最后一个块保证x至少是ab

此外; U 不是“按位或运算符”,但我将其称为“和/或”运算符。它的定义是:(

"U" = "and" U "or"

在我的博客上, http://cplang.wordpress .com/2009/12/19/binop-and-or/,有关于此运算符的更多(数学)背景信息它松散地基于集合,在这个问题中更改了它

。强>更新:更多示例。

print = "Hello world!" U "How are you?"; // this will print
                                         // both values, but the
                                         // order doesn't matter.
// 'userkey' is a variable containing a key.
with(userkey = "a") {
    print = userkey; // will only print "a".
}
with(userkey = ("shift" U "a")) {
    // pressed both "shift" and the "a" key.
    print = userkey; // will "print" shift and "a", even
                     // if the user also pressed "ctrl":
                     // the interpretation of "userkey" is changed,
                     // such that it only contains the matched cases.
}
with((userkey = "shift") U (userkey = "a")) {
    // same as if-statement above this one, showing the distributivity.
}

x = 5 U 6 U 7;
y = x + x; // will be:
// y = (5 U 6 U 7) + (5 U 6 U 7)
//   = 10 U 11 U 12 U 13 U 14

somewantedkey = "ctrl" U "alt" U "space"
with(userkey = somewantedkey) {
    // must match all elements of "somewantedkey"
    // (distributed the Boolean equals operated)
    // thus only executed when all the defined keys are pressed
}
with(somewantedkey = userkey) {
    // matches only one of the provided "somewantedkey"
    // thus when only "space" is pressed, this block is executed.
}

更新2:更多示例和更多上下文。

with(x = (a U b)) {
    // this
}
// can be written as
with((x = a) U (x = b)) {
    // this: changing the variable like
    x = 5;
    // will be rewritten as:
    // a = 5 and b = 5
}

一些背景信息:我正在构建一种“与时间无关的语言” ”,就像 Java 一样“平台无关”。语言中陈述的一切都是“按原样”,并且不断地积极执行。这意味着;程序员不知道元素的顺序(除非使用构造明确说明),也不知道语句何时执行。该语言与“时间”概念完全分离,即它是连续执行的:

with(true) {
    a = 0; // only runs once (lazy execution)
}

with(a < 5) {
    a++;
} // this is a loop-structure;
  // how and when it's executed isn't known however.

with(a) {
    // everytime the "a" variable changes, this code-block is executed.
    with(true) {
        b = 3; // only 5 times (again lazy execution, but it's a sub-with)
    }
    with(b < 2) { // dependent on "b"
        // runs only 3 times * 5 times = 15 times.
    }
    with(b > 1) { // dependent on "b"
        b = b - 1; // runs 4 times * 5 times = 20 times.
    }
}

更新3:

在思考该语言特征的类型之后;它与 Netbeans 平台的 Lookup 非常相似,其中每个“with”语句都是一个同步代理,作用于其特定的对象“过滤器”。它不是基于类型,而是基于变量(基本上完全相同;只是识别对象的方式不同)。

我非常感谢你们所有人为我提供了非常有见地的信息以及我可以研究的重要主题的链接/提示。谢谢。

我不知道这种结构是否已经存在,所以这就是我的问题:这种语言功能是否已经存在?

I'm currently developing a new language for programming in a continuous environment (compare it to electrical engineering), and I've got some ideas on a certain language construction.

Let me explain the feature by explanation and then by definition:

x = a U b;

Where x is a variable and a and b are other variables (or static values). This works like a union between a and b; no duplicates and no specific order.

with(x) {
    // regular 'with' usage; using the global interpretation of "x"
    x = 5;
    // effectively will do:
    // x = a U b U 5;
    // a = 5;
    // b = 5;
    // Thus, when "a" or "b" changes, "x" is still equal to "5".
}
with(x = a) {
    // this code block is executed when the "x" variable
    // has the "a" variable assigned. All references in
    // this code-block to "x" are references to "a". So saying:
    x = 5;
    // would only change the variable "a". If the variable "a"
    // later on changes, x still equals to 5, in this fashion:
    // 'x = a U b U 5;'
    // '[currentscope] = 5;'
    // thus, 'a = 5;'
}
with(x = b) {
    // same but with "b"
}
with(x != a) {
    // here the "x" variable refers to any variable
    // but "a"; thus saying
    x = 5;
    // is equal to the rewriting of
    // 'x = a U b U 5;'
    // 'b = 5;' (since it was the scope of this block)
}
with(x = (a U b)) {
    // guaranteed that "x" is 'a U b'; interacting with "x"
    // will interact with both "a" and "b".
    x = 5;
    // makes both "a" and "b" equal to 5; also the "x" variable
    // is updated to contain:
    // 'x = a U b U 5;'
    // '[currentscope] = 5;'
    // 'a U b = 5;'
    // and thus: 'a = 5; b = 5;'.
}
// etc.

In the above, all code-blocks are executed, but the "scope" changes in each block how x is interpreted. In the first block, x is guaranteed to be a: thus interacting with x inside that block will interact on a. The second and the third code-block are only equal in this situation (because not a: then there only remains b). The last block guarantees that x is at least a or b.

Further more; U is not the "bitwise or operator", but I've called it the "and/or"-operator. Its definition is:

"U" = "and" U "or"

(On my blog, http://cplang.wordpress.com/2009/12/19/binop-and-or/, there is more (mathematical) background information on this operator. It's loosely based on sets. Using different syntax, changed it in this question.)

Update: more examples.

print = "Hello world!" U "How are you?"; // this will print
                                         // both values, but the
                                         // order doesn't matter.
// 'userkey' is a variable containing a key.
with(userkey = "a") {
    print = userkey; // will only print "a".
}
with(userkey = ("shift" U "a")) {
    // pressed both "shift" and the "a" key.
    print = userkey; // will "print" shift and "a", even
                     // if the user also pressed "ctrl":
                     // the interpretation of "userkey" is changed,
                     // such that it only contains the matched cases.
}
with((userkey = "shift") U (userkey = "a")) {
    // same as if-statement above this one, showing the distributivity.
}

x = 5 U 6 U 7;
y = x + x; // will be:
// y = (5 U 6 U 7) + (5 U 6 U 7)
//   = 10 U 11 U 12 U 13 U 14

somewantedkey = "ctrl" U "alt" U "space"
with(userkey = somewantedkey) {
    // must match all elements of "somewantedkey"
    // (distributed the Boolean equals operated)
    // thus only executed when all the defined keys are pressed
}
with(somewantedkey = userkey) {
    // matches only one of the provided "somewantedkey"
    // thus when only "space" is pressed, this block is executed.
}

Update2: more examples and some more context.

with(x = (a U b)) {
    // this
}
// can be written as
with((x = a) U (x = b)) {
    // this: changing the variable like
    x = 5;
    // will be rewritten as:
    // a = 5 and b = 5
}

Some background information: I'm building a language which is "time-independent", like Java is "platform-independant". Everything stated in the language is "as is", and is continuously actively executed. This means; the programmer does not know in which order (unless explicitly stated using constructions) elements are, nor when statements are executed. The language is completely separated from the "time"-concept, i.e. it's continuously executed:

with(true) {
    a = 0; // only runs once (lazy execution)
}

with(a < 5) {
    a++;
} // this is a loop-structure;
  // how and when it's executed isn't known however.

with(a) {
    // everytime the "a" variable changes, this code-block is executed.
    with(true) {
        b = 3; // only 5 times (again lazy execution, but it's a sub-with)
    }
    with(b < 2) { // dependent on "b"
        // runs only 3 times * 5 times = 15 times.
    }
    with(b > 1) { // dependent on "b"
        b = b - 1; // runs 4 times * 5 times = 20 times.
    }
}

Update 3:

After pondering on the type of this language feature; it closely resemblances Netbeans Platform's Lookup, where each "with"-statement a synchronized agent is, working on it's specific "filter" of objects. Instead of type-based, this is variable-based (fundamentally quite the same; just a different way of identifiying objects).

I greatly thank all of you for providing me with very insightful information and links/hints to great topics I can research. Thanks.

I do not know if this construction already exists, so that's my question: does this language feature already exist?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

你怎么这么可爱啊 2024-09-03 04:47:06

老实说,我发现你的解释和例子很难理解(更新:你的博客好多了,阅读Statement Ordering 那里我更加确信您的目标是数据流编程形式)。

但是,您的最终描述:

语言中所表述的一切都是
“按原样”,并不断积极
被执行。这意味着;程序员
不知道按什么顺序(除非
使用结构明确说明)
元素是,也不是当语句是
被执行。语言完全是
脱离了“时间”的概念,
即它是连续执行的:
说“a”是“b”,“b”是“a”
是一个简单的循环结构,对于
实例。

..让我认为您正在搜索的通用术语是数据流编程(即使在更简单的数据流编程实例中不允许使用循环)。引用维基百科:

Dataflow 是一种基于以下理念的软件架构:
改变变量的值
应该自动强制
重新计算的值
取决于其值的变量。

反应式编程函数式响应式编程是同一主题的变体。

Icon 的目标导向评估范围更受限制(请参阅此 Icon 简介:目标导向求值机制所隐含的回溯仅限于它发生的表达式)。

另请参阅 Stackoverflow 上的此问题:数据流编程语言

更新: Pindatjuh 在评论中询问“你也可以评论一下,这种语言是否是数据流主题的新变体?”。我认为是的,但问题实际上是关于定义以及共识。在最近一项有关数据流语言的调查中,数据流编程语言的进步< /a>(发布于ACM 计算调查,第 36 卷,第 1 期,2004 年 3 月),作者写道(第 10 页):

最佳功能列表
构成了数据流语言
由 Ackerman [1982] 转发和
怀廷和帕斯科重申
[1994] 以及韦尔和艾布拉姆森 [1995]。
该列表包括以下内容:

  1. 无副作用,
  2. 影响的局部性,
  3. 数据依赖性相当于调度,
  4. 变量的单一赋值,
  5. 由于特征 1 和 4,出现了一种不寻常的迭代表示法,
  6. 程序中缺乏历史敏感性。

我没有读完你的全部博客,只是简单地浏览了一下,所以你比我更有资格判断你的编程语言(无论如何,这是一个移动的目标)。

更新:我无意中错过了您问题中的“新”一词“...这种语言是...的变体”。这是一项艰巨的任务:需要考虑迄今为止发明的所有数据流语言,并仔细检查它们的语义细节,以发现方法中的新颖之处。我现在肯定没有必要的知识。

I honestly find your explanation and examples difficult to follow (update: your blog is much better and reading Statement Ordering there I'm even more convinced that you are aiming at a form of dataflow programming).

However, your final description:

Everything stated in the language is
"as is", and is continuously actively
executed. This means; the programmer
does not know in which order (unless
explicitly stated using constructions)
elements are, nor when statements are
executed. The language is completely
separated from the "time"-concept,
i.e. it's continuously executed:
saying that "a" is "b" and "b" is "a"
is a simple loop-structure, for
instance.

.. induces me to think that the general term that you are searching for is dataflow programming (even if loops are not permitted in the more simple instances of dataflow programming). Quoting from Wikipedia:

Dataflow is a software architecture based on the idea that
changing the value of a variable
should automatically force
recalculation of the values of
variables which depend on its value.

Reactive programming and functional reactive programming are, as I understand them, variations on the same theme.

Icon's goal-directed evaluation is more restricted in scope (see this A Brief Introduction to Icon: The backtracking implied by the goal-directed evaluation mechanism is limited to the expression in which it occurs).

See also this question on Stackoverflow: Dataflow Programming Languages.

Update: Pindatjuh asks in comments "Can you also comment, whether this language is a new variation on the theme of dataflow?". I think so, but the question is really about definitions and so about consensus. In a recent survey about dataflow languages, Advances in dataflow programming languages (published in ACM Computing Surveys, Volume 36 , Issue 1, March 2004), authors wrote (page 10):

The best list of features that
constitute a dataflow language was put
forward by Ackerman [1982] and
reiterated by Whiting and Pascoe
[1994] and Wail and Abramson [1995].
This list includes the following:

  1. freedom from side effects,
  2. locality of effect,
  3. data dependencies equivalent to scheduling,
  4. single assignment of variables,
  5. an unusual notation for iterations due to features 1 and 4,
  6. lack of history sensitivity in procedures.

I haven't read all your blog but just perused it lightly, so you are more qualified than me to judge about your programming language (which is a moving target anyway).

Update: I unconsciously missed the word "new" in your question "... this language is a new variation on...". It is an hard task: one needs to consider all the dataflow languages invented until now and carefully examine their semantics in detail to spot a novelty in your approach. I surely haven't the necessary knowledge at this time.

悍妇囚夫 2024-09-03 04:47:06

我发现这很难理解,但你的意思是:

x == a | b 

将是语法糖相当于:

(x == a) || (x == b)

在博客文章中你给出了这个例子:

1 + (2|3)

所以该表达式的类型是一对整数,每个值分别为 3 和 4代表可能的值之一。所以我们也可以说:

4 == (1 + (2|3)
3 == (1 + (2|3)

这两者都将评估为 true。因此,运算符 == 可以将一个值与一种值向量进行比较,如果向量中的任何值等于第一个值,则该运算符将为 true

这可以使用几种语言中的运算符重载来实现(尽管您必须将简单值显式“提升”到包装类型中,然后才能对其进行操作)。

它实际上不是与两个集合的并集相同,并且 == 被解释为“是……的成员”吗?运算符喜欢 + 被提升,这样它们就适用于集合中的所有成员。

如果您执行 (1|2) + (4|8),您将得到相当于 (5|9|6|10) 的结果,因为这是四种可能的结果。

好的,从您添加的进一步示例中,我发现 == 实际上要求左侧和右侧是同一组,而不仅仅是重叠。但我仍然觉得你的 | 只是两个集合的并集。这意味着什么(或意味着什么)将取决于您对语言的所有其他功能进行的处理集合的操作。

关于您的发言:

语言完全分离
从“时间”概念来看

您是否仔细研究过像 Haskell 这样的纯函数式语言?程序是一系列没有已知执行顺序的定义,您只能编写没有副作用的纯函数,因此解释器可以按照自己喜欢的方式排序执行,只要真正需要时值可用即可。

更新:

您在问题中添加了以下内容:

if(x == a | b) {
    // this 
}
// can be written as
if((x == a) | (x == b)) {
    // this
}
// which can be written as
if(x == a) {
    // this
}
if(x == b) {
    // with this
}

我想知道您认为这会有何启发!

问题是,前两个版本在 if 下有一个代码块。因此,如果第三个扩展版本有两个块,那么它们必须是同一个块。换句话说,这只是另一种写法:

if (x == a || x == b) {
    // this
}

Where ||是传统的布尔 OR。这正是我首先问的问题。

好吧,再一次...您现在已经更改了语法以表明您正在执行并集和交集。但是:

if(userkey I ("shift" U "a")) {
    // pressed both "shift" and the "a" key.

所以 I 意味着取两个集合的交集...但是 if 在什么情况下执行代码块?如果交集非空?或者I实际上是在问“该集合的所有成员都是左边集合的右侧成员吗”并且有提示userkey在范围内被替换该块的另一个值实际上只是右侧的集合。

我要去睡觉了。

I'm finding this hard to follow, but do you mean that:

x == a | b 

will be syntax sugar equivalent to:

(x == a) || (x == b)

On the blog post you give this example:

1 + (2|3)

So the type of that expression is a pair of integers with the values 3 and 4, each representing one of the possible values. So we can also say:

4 == (1 + (2|3)
3 == (1 + (2|3)

and both of those would evaluate to true. So the operator == can compare a value with a kind of vector of values and will be true if any of the values in the vector are equal to the first value.

This could be implemented using operator overloading in a few languages (although you'd have to explicitly "lift" simple values into a wrapper type before you could operate on them).

Isn't it effectively the same as the union of two sets, and with == interpreted as "is a member of"? And operators like + being lifted so they apply to all the members of the set.

And if you did (1|2) + (4|8) you'd get the equivalent of (5|9|6|10), because those are the four possible outcomes.

Okay, from further examples you added, I see that == in fact requires the left and right sides to be the same set, rather than merely overlapping. But I still get the impression that your | is simply the union of two sets. What this entails (or means) will depend on what you do to all the other features of your language to deal with sets.

Regarding your statement:

The language is completely separated
from the "time"-concept

Have you looked much at pure functional languages like Haskell? Programs are a series of definitions with no known order of execution, you can only write pure functions with no side-effects, and hence the interpreter can order execution however it likes as long as values are available when really needed.

Update:

You added this to your question:

if(x == a | b) {
    // this 
}
// can be written as
if((x == a) | (x == b)) {
    // this
}
// which can be written as
if(x == a) {
    // this
}
if(x == b) {
    // with this
}

I wonder how you think that's going to be illuminating!

The thing is, the first two versions have one block of code under the if. So if the third expanded version has two blocks, they must be the same block. In other words, this is just another way of writing:

if (x == a || x == b) {
    // this
}

Where || is the traditional boolean OR. Which is exactly the question I first asked.

Okay, one more time... You've now changed the syntax to indicate that you're doing unions and intersections. But then:

if(userkey I ("shift" U "a")) {
    // pressed both "shift" and the "a" key.

So I means take the intersection of the two sets... but if executes the code block under what circumstances? If the intersection is non-empty? Or is I in fact asking "are all the members of the set on the right members of the set on the left" And there are hints that userkey is replaced in the scope of the block by another value which actually just the set on the right.

I'm going to bed.

尘世孤行 2024-09-03 04:47:06

您的示例和数学都可以使用一些工作,但在您博客上的至少一个示例中,您对 | 的使用非常类似于同一运算符的使用(称为“交替”,我相信)图标编程语言

如果你打算在这个领域进行语言设计,你绝对应该阅读

Your examples and your math could both use some work, but in at least one of the examples on your blog, your use of | closely resembles the use of the same operator (there called "alternation", I believe) in the Icon programming language.

If you're going to commit language design in this area, you should definitely read about

邮友 2024-09-03 04:47:06

C# 肯定不具备您所描述的功能。你所说的似乎有点让人想起罗宾·米尔纳的 pi 演算;这一切都是为了定义一种用于描述并发进程的语言。如果您还没有的话,您可以考虑对此进行一些研究。

C# certainly doesn't have the features you are describing. What you're talking about seems somewhat reminiscent of Robin Milner's pi calculus; it's all about defining a language for describing concurrent processes. You might consider doing some research into it if you haven't already.

薄荷港 2024-09-03 04:47:06

您的语言功能类似于 Perl 6 中的 连接

在 Perl 5 中,有 Quantum::Superpositions 模块。

Your language feature resembles junctions in Perl 6.

In Perl 5, there's the Quantum::Superpositions module.

别想她 2024-09-03 04:47:06

你应该发明自己的符号,即使只是为了例子。

看起来您正在尝试根据范围定义的需要动态更改变量引用。这是一种非常微妙的技术,我不知道任何语言可以做到这一点。尽管我可以看到闭包、生成器和回溯的相似之处,但大多数语言都要求您明确执行此操作。

您能解释一下推动这种不寻常方法的背景吗?您的博客链接不是很有帮助。并且术语“连续编程”也没有定义或解释。

更新:

好的,看看您编辑的示例,我可以指出 Icon 具有类似的内容。这并不完全是您所要求的,而且并不常见,但它看起来很接近并且定义得更好。这称为目标导向评估。

许多语言元素提供或允许您构建一个生成器,如果需要,它可以提供许多替代方案。您的示例和 Icon 之间的主要区别是您必须为语言提供上下文才能继续尝试替代方案。赋值不能做到这一点,但比较可以。一旦生成器耗尽了它可以提供的值,它就会失败。这也是普通比较的工作原理,整个功能很好地集成到更广泛的语言中。 (我有时将其描述为微型异常。)

Python 和 Ruby 有一个 yield 机制,该机制非常相似,并且可以说受到 Icon 生成器的影响。

You should have invented your own symbols, even just for the example.

It looks like you're trying to do variable references that dynamically change as the scope definition requires. That is a very subtle technique and I don't know any language that does it. Most languages require you to do this explicitly although I can see similarities with closures, generators and back-tracking.

Could you explain the context driving this unusual method? Your blog link was not very helpful. And the term 'continuous programming' is not defined or explained, either.

Update:

Okay, looking at your edited example, I can point to Icon as having something similar. It is not quite what you think you're asking for, and it is not common, but it seems close and it much better defined. It is called Goal-Directed Evaluation.

Many language elements provide or allow you to construct a generator which can give a number of alternatives if asked. The main difference between your example and Icon you have to provide a context for the language to keep trying alternatives. Assignment doesn't do it, but a comparison will. Once a generator runs out of values it can supply, it fails. This is also how ordinary comparison works and the whole feature integrates nicely into the wider language. (I sometimes describe this as being like miniature exceptions.)

Python and Ruby have a yield mechanism which is very similar and arguably influenced by Icon's generators.

青萝楚歌 2024-09-03 04:47:06

我建议你不要添加该语言功能。如果您进行如下“测试”,程序员会非常不清楚 x 的含义会发生变化:

if( x != a ) { ... }

I advise you not to add that language feature. It would be very unclear to the programmer that the meaning of x changes if you do a "test" like:

if( x != a ) { ... }
若沐 2024-09-03 04:47:06

Inform IF 创作语言具有此功能。来自DM

if (alpha == 3 or 4) print "Scott";

它并没有真正流行起来不过,更进一步,因为解析起来有点奇怪(您必须将每个 or/| 运算符与特定所有者 ==/< code>!= 比较器),在现代脚本语言中,很容易用以下内容替换:

if alpha in (3, 4):
    print 'Scott';

(Python 示例。)

The Inform IF-authoring language had this feature. From the DM:

if (alpha == 3 or 4) print "Scott";

It hasn't really caught on much further, though, as it's a bit weird to parse (you have to associate each or/| operator with a particular owner ==/!= comparator), and in modern scripting languages it's easy to replace with something like:

if alpha in (3, 4):
    print 'Scott';

(Python example.)

深海不蓝 2024-09-03 04:47:06

您似乎同时探索了几个想法:

  • 列表语法,您可以在其中执行类似 5 | 的操作。 6 | 7
  • 使用您编写的外积 ::list:: + ::list::
  • 仔细定义等式、不等式、赋值等运算符的含义。或者两个参数都是一个列表。即 ::scalar:: == ::list:: 实现了“is an element of”,依此类推,

我不知道有哪个语法功能结合了这些想法,但后来我没有真正丰富的经验...

You seem to be poking around several ideas at once:

  • A list syntax where you do something like 5 | 6 | 7
  • using the outer product where you've been writing ::list:: + ::list::
  • carefully defining the meaning of the equality, inequality, assignment, etc. operators when one or both arguments is a list. I.e. that ::scalor:: == ::list:: implements "is an element of", and so on

I'm not aware of a single syntaxtical feature that combines those idea, but then I don't have really wide experience...

谁的年少不轻狂 2024-09-03 04:47:06

as3 中存在“with”:

private var _a:Number = 0.0;
public function get a():Number{
// Do stuff
    return _a;
}
public function set a(value:Number):void{
// Do stuff
    _a=value;
}

The "with" exist in as3:

private var _a:Number = 0.0;
public function get a():Number{
// Do stuff
    return _a;
}
public function set a(value:Number):void{
// Do stuff
    _a=value;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文