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

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


当前回答

PL/SQL允许将变量和函数名声明为关键字。下面是可编译的PL/SQL:

create or replace 
  function function 
  return number  as
  return number;
begin 
  function.return := 4;
  return   return;
end function;
/

这创建了一个名为function的函数。后:

SQL> select function from dual;

  FUNCTION
----------
         4

其他回答

在c++

const char* wtf()
{
    char buf[100];
    return buf;
}
string s = ... + wtf() + ...;

在s中创建有趣的值。部分是字符串,部分是堆栈内容,与零混合,因此s.length()!=strlen(s.c_str())。 最奇怪的是,编译器在返回指向堆栈的指针时完全没有问题——如果他在那里添加了一个警告,编译器程序员的手可能会掉下来。

我有点纠结:

1;

在perl中,模块需要返回true。

通知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. 

像图灵机模拟器这样的其他愚蠢的东西可以找到。

APL(除了ALL),在一行中编写任何程序的能力。

例:在APL中,康威的生命游戏一行:

替代文本 http://catpad.net/michael/APLLife.gif

如果这句台词都不是WTF,那什么都不是!

这是一个视频

哈哈!

整个语言本身。虽然不完全是WTF的事情,但我从来没有遇到过一种语言在我的脑海中以一种刺耳的卡通声音播放。我以前也从来没有看过代码并想要惊呼“啊啊啊啊可爱!”

这个程序显示数字1-10并终止

HAI
CAN HAS STDIO?
IM IN YR LOOP UPPIN YR VAR TIL BOTHSAEM VAR AN 10
    VISIBLE SUM OF VAR AN 1
IM OUTTA YR LOOP
KTHXBYE