在你看来,你遇到过的最令人惊讶、最怪异、最奇怪或最“WTF”的语言特性是什么?
请每个回答只回答一个特征。
在你看来,你遇到过的最令人惊讶、最怪异、最奇怪或最“WTF”的语言特性是什么?
请每个回答只回答一个特征。
当前回答
C预处理器及其用法。特别是预处理器元编程和使用预处理器生成可移植代码——完全是胡扯。
其他回答
在c#中,你可以在接口上使用new操作符。
通知7。一个有效程序的例子:
Chomsky is a room. A thought is a kind of thing. Color is a kind of value. The colors are red, green and blue. A thought has a color. It is usually Green. A thought can be colorful or colorless. It is usually colorless. An idea is a thought in Chomsky with description "Colorless green ideas sleep furiously." A manner is a kind of thing. Furiously is a manner. Sleeping relates one thought to one manner. The verb to sleep (he sleeps, they sleep, he slept, it is slept, he is sleeping) implies the sleeping relation. Colorless green ideas sleep furiously.
像图灵机模拟器这样的其他愚蠢的东西可以找到。
Perl的$[(已弃用),这在之前关于通用Perl变量的另一篇文章中提到过,但它值得特别提到,并有更好的解释。对$[的更改仅限于当前范围。更多的信息以及如何使用它的含义;)可以在$[中找到,请访问http://www.perlmonks.org/index.pl/?node_id=480333
BrainFuck语言。真的是这样!
Processing (processing.org)是一种基于Java的语言。简单来说,处理编译器是将特定于处理的语法转换为Java的Java预处理器。
由于语言的设计,它有一些惊喜:
Processing的类被编译成Java内部类,这会引起一些麻烦,比如私有变量并不是真正私有的
class Foo {
private int var = 0; // compiles fine
}
void setup() {
Foo f = new Foo();
print(f.var); // but does not causes compile error
}
同样缺少draw()函数会导致事件处理程序不被调用:
// void draw() {} // if you forgot to include this
void mousePressed() {
print("this is never called");
}