在你看来,你遇到过的最令人惊讶、最怪异、最奇怪或最“WTF”的语言特性是什么?
请每个回答只回答一个特征。
在你看来,你遇到过的最令人惊讶、最怪异、最奇怪或最“WTF”的语言特性是什么?
请每个回答只回答一个特征。
当前回答
通知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.
像图灵机模拟器这样的其他愚蠢的东西可以找到。
其他回答
Java;使所有对象实例都是互斥对象。
C和c++中的三联体。
int main() {
printf("LOL??!");
}
这将打印LOL|,因为trigraph ??!转换为|。
Javascript中的变量/函数声明:
var x = 1;
function weird(){
return x;
var x = 2;
}
Weird()返回undefined…即使任务从未发生,X也被“占用”了。
类似的,但也不是那么出乎意料
function weird2(){
var x;
return x();
function x(){ return 2 };
}
返回2。
JavaScript:
( {} == {} ) == false
Tcl中的连接是将两个字符串添加为一个字符串:
set s1 "prime"
set s2 "number"
set s3 $s1$s2
puts s3
输出为
primenumber