Skip to content

Comment on Strangest Programming Language Feature?parent

Comments

This line in MUMPS is not only valid, it also actually does something potentially useful:

    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"

It is amazing that MUMPS will be 50 years old in 2 years -- and it still alive and kicking.

An emergency MUMPS project is still my highest billing project (per hour) ever.

What was the rate?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.