Question: [Underload](http://esolangs.org/wiki/Underload) is a stack-based semi-functional tarpit created by [ais523](https://codegolf.stackexchange.com/users/62131/ais523). I've recently been trying to golf in it, as it's a surprisingly elegant language.

What tips do you have for golfing in Underload? (One tip per answer)

Answer: 
Use a dictionary of repeatedly reused functions
===============================================

If you need to use a piece of code a lot, it makes sense to store that code on the stack and duplicate-and-eval it every now and then. So far, that's just normal Underload programming. Unfortunately, keeping a value around on the stack for a long time is difficult and tends to cause your code to become verbose, and that's true even if the value is a function rather than data. This gets a lot worse if you have multiple functions that need to be reused repeatedly.

In the sort of larger program that might benefit from several reused functions, a solution you can use is to instead make one large function that can fulfil any of their purposes depending on the way it's called (either based on what's underneath it on the stack, or via using longer calling sequences than just `^`; a carefully written function can distinguish `^^` from `^:^` from `^*^` from `^~^`, giving you four distinct, fairly short sequences). You can also store other useful things, such as strings that you use multiple times, in this "dictionary". Note that if you use the dictionary heavily, it may make sense to make it a kind of quine, pushing a copy of itself back onto the stack, so that you don't need to manually copy it with `:` to be able to use it without losing the ability to use it in the future.
Put Unneeded Stack Values into the Program Space
================================================

Underload actually has two stacks—the stack of strings, and the stack of commands that make up the source code. Underload's `^` instruction lets us move strings from the former stack to the latter. By doing this, we can save a lot of unnecessary stack manipulation.

For example, say we have `(a)(b)(c)` on the main stack and we'd like to concatenate the bottom two elements, ignoring `(c)`, to get `(ab)(c)`. The naïve way to do this is to rotate the stack to get `(c)(a)(b)` and then concantenate and swap back:

```
a~a~*~a*^*~

```

This is bad. Using `a~a~*~a*^` to rotate the stack like this is extremely costly, and should be avoided when possible. By putting `(c)` into the program space instead, this can be made four bytes shorter:

```
a(*)~*^

```

The idea is to take the instructions you'd like to execute and then add an instruction to push `(c)` back at the end, and then evaluate the result. This means that we don't have to worry about `(c)` until it's pushed back after we've finished.