在你看来,你遇到过的最令人惊讶、最怪异、最奇怪或最“WTF”的语言特性是什么?

请每个回答只回答一个特征。


当前回答

VBScript的With block:

With xml.appendChild(xml.createElement("category"))
  .setAttribute("id",id)
  .setAttribute("keywords",keywords)
  With .appendChild(xml.createElement("item"))
    .setAttribute("count",count)
    .setAttribute("tip",tip)
    .appendChild(xml.createTextNode(text))
  End With
End With

其他回答

s a=“a=”“a=”a“”,@a=“”“”2N“”“”,a=“c=”_(“”22“”?@a),@a“”,@a,a=“a”“,a(c)=”“S+”“_c,e=$T(@@a@(c))”,@a

这是COS (cache objectscript)中很好的一行代码。有趣的是,这里有5种不同的代码-间接*G模式

在PowerShell中,你可以重命名变量:

> $a = "some value"
> $b = "a"
> $c = "d"
> Rename-Item variable:$b $c
> $d
some value

间接间接!PHP!

字面也有用:

> Rename-Item variable:d e
> $e
some value

在C。

int;

(&a)[0] = 10;/*将值10赋给*/

[0]等于*(&a +0)得到*(&a)也就是a。

在Perl中(没有“使用严格”或“使用警告”):

if(true==undef)
{
    print "True\n";
}
else{
    print "False\n";
}
if(undef)
{
    print "True\n";
}
else{
    print "False\n";
}
if(true)
{
    print "True\n";
}
else{
    print "False\n";
}

打印:

True
False
True

从Ruby中的随机类继承:

class RandomSubclass < [Array, Hash, String, Fixnum, Float, TrueClass].sample
   ...
end

(首次出现在Ruby的隐藏特性中)