Tautologos

From Esolang
Jump to navigation Jump to search
This article is a stub, which means that it is not detailed enough and needs to be expanded. Please help us by adding some more information.

Tautologos is an esoteric programming language by User:Rdococ. It's a lot like Table, where there is only one kind of object. In this case, it's functions. I suspect I'll make another one with bananas soon.

Basics

Everything, and I mean everything, in Tautologos is a function. Numbers? Functions. Characters? Functions. Strings? Functions. The way a function can be written is flexible, and so are the ways comments can be written. The important part is not how you type a function, but how you nest these functions, giving each special function a label along the way, to give meaningless repetition a meaning.

y = function (x) return z end -- valid
y = function (x) { return z } // also valid
y = function (x) ( return z ) /* valid again */
y(x) = z --[[shorthand for the above]]

Paradigm

Tautologos is an imperative programming language with declaration in mind.

Local Variables

You can define a variable as local in one of two ways. A local variable cannot be accessed from outside the function that it's in.

x = function ()
    local y = x
    return y
end
var x = function ()
    var y = x
    return y
end

You can redefine a global value in a function too.

Nil

Functions that are not defined are equivalent to nil, and functions that don't return a value return nil. Other than that, nil is pretty much a normal value - you can change it, which will change every undefined function.

nil = function () return nil end

Treating parameters like normal variables

What sets Tautologos functions apart from other functions is a few very small quirks that makes programming in it interesting - that you can give two parameters the same name. The function technically wasn't defined in the case that the two values are different, unless you defined it, and so is equivalent to nil, and returns whatever nil returns, which is usually nil, but as described above, it can be changed.

false = nil
equals(x, y, trueReturn, falseReturn) = falseReturn -- we defined the whole function
equals(x, x, trueReturn, falseReturn) = trueReturn -- we redefined half of the function

And if you give one parameter the name of a global variable, and the value passed to the function isn't equal to the value of the global variable, then the same thing will happen.

add(x, y) = add(successor(x), predecessor(y))
add(x, 0) = x -- doesn't redefine cases where y is not 0

Trivia

  • Who cares about computational class? This language is about being esoteric. But it can do more than Table.
  • Tautologos is Greek for "repeating what is said."