Strangest Programming Language Feature?
stackoverflow.com
Strangest Programming Language Feature?
1–10 of 66 posts
Re: Strangest Programming Language Feature?
#2Re: Strangest Programming Language Feature?
#3Re: Strangest Programming Language Feature?
#4The most amusingly weird thing I can think of is INTERCAL's COMEFROM: http://en.wikipedia.org/wiki/COMEFROM
Re: Strangest Programming Language Feature?
#5Self-modifying code was fairly common at the time COBOL was developed, but incorporating it in a high-level business language was, IMO, a very weird decision.
I also miss call by name (http://en.wikipedia.org/wiki/Man_or_boy_test) on the first page.
In general, one should read the Intercal (http://en.wikipedia.org/wiki/INTERCAL) paper, and figure out from which language each of its features came.
Re: Strangest Programming Language Feature?
#6That whole language is one long-running WTF.
Re: Strangest Programming Language Feature?
#7I'm stealing the hell out of this.
Re: Strangest Programming Language Feature?
#8/me drops the MUMPS reference manual on the table That whole language is one long-running WTF.
s:foo'="" foo(foo)=foo
It's actually a bit tricky to explain what it does. Everything in MUMPS is effectively a tree. Each tree has a value in the "root node" and you can set it like this: set foo="hello"
You can also put data deeper into the tree: set foo("fizz")="buzz"
So if something is passed to you and you want to know if you can treat it as a string, you test to see if it's a null string: if foo'="" do [something]
('= means !=)Two more features: 1) Almost every directive can be reduced to one letter. 2) If I want to quit based on a condition, I can do either if condition quit or quit:condition
So the line above is more legibly written as
if foo'="" set foo(foo)=foo
So if foo="bar", it's equivalent to: set foo("bar")="bar"Re: Strangest Programming Language Feature?
#9... redefines the constant 2 as 3. FORTH. Go figure :-)
Re: Strangest Programming Language Feature?
#10Fun fact, this is also the reason why 'i' is commonly used as a name for the loop counter variable.