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

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


当前回答

在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

其他回答

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

这并不奇怪或令人惊讶,但这让我总是说WTF:

语法或标识符名称的大小写敏感性。

大多数具有它的语言似乎只是因为C具有它。这样做没有什么好的理由。

Objective-C对字符串@的使用。示例:@"这是一个字符串。"

C++:

void f(int bitand i){ //WTF
    i++;
}
int main(){
    int i = 0;
    f(i);
    cout << i << endl; //1
    return 0;
}

在Ruby中…

i=true
while(i)
   i=false
   a=2
end
puts defined?(a) // returns true