在你看来,你遇到过的最令人惊讶、最怪异、最奇怪或最“WTF”的语言特性是什么?
请每个回答只回答一个特征。
在你看来,你遇到过的最令人惊讶、最怪异、最奇怪或最“WTF”的语言特性是什么?
请每个回答只回答一个特征。
当前回答
Tcl中的连接是将两个字符串添加为一个字符串:
set s1 "prime"
set s2 "number"
set s3 $s1$s2
puts s3
输出为
primenumber
其他回答
在MOD_REWRITE
RewriteRule ^([a-zA-Z0-9_-]+)\.php$ $1/ [R,NC]
RewriteRule ^([a-zA-Z0-9_-]+)/$ $1\.php [NC,L]
将会导致:
"file.php > file > file.php > file > file.php > file > ..."
最后:
Error 500 Too Many Redirects
(一般来说,我发现编辑.htaccess文件和构造一个正常运行的正则表达式一样乏味。)
在类C语言(包括C本身)中,你可以使用“向下到”操作符:
for (x = 20; x --> 0;) {
print x;
}
这将打印从19到0的数字。
在awk中,数组从索引1开始,这是最不容易混淆的。
JavaScript真值表:
'' == '0' // false
0 == '' // true
0 == '0' // true
false == 'false' // false
false == '0' // true
false == undefined // false
false == null // false
null == undefined // true
" \t\r\n" == 0 // true
资料来源:Doug Crockford
Perl:
可以编写一个完全由标点符号组成的程序。
这是怎么回事?!