Enter RPN

Stupid RPN Tricks
Login

Stupid RPN Tricks

I knew rejig was getting complicated when it began exhibiting emergent behaviors…

Raise the COMPLEXity

In addition to its lovely 𝒊 and 𝒊⊙ ops, the R47 supports the same legacy complex number entry scheme as the HP-42S, but R47 fans gain a happy consequence from our support of its ancestor:

rejig program.p47 | rejig --from utf8 -o raised.p47

That one-liner converts any real + imaginary + COMPLEX sequences found in the input to a complex literal. The P47 input processor does not know this trick itself, but the UTF-8 input does, and round-tripping grants it the feature indirectly.

E pluribus unum

You may pass rejig multiple input files, but it obeys a single -o. What use is that? Try this:

rejig *.p47 -o combined.p47u

The happy outcome for the HP-42S and its descendants is that this yields either:

It depends entirely on which inputs have END statements.

With this, we may arguably add “linker” to our operating mode list, or at least archiver. 🤓

(You may now wish to return to the rejig home page.)

License

This work is © 2026 by Warren Young and is licensed under CC BY-NC-SA 4.0