Here is a wp34s example, demonstating the power and convenience of local symbols.

This is a alternating series summation program from Valentin Albillo. I translated it verbatim without understanding the magic behind it and it worked on all the examples.

Anyway, back to the local symbols. In my proof of concept preprocessor the local symbols are labels of form 1H 2H 3H ... 9H.

The forward references to the label 1H is <1F> and back reference to the label is <1B>.

Note how all the loops and if/then/elses of the program required only one local symbol -- 1H, where it is being reused as the source unfolds. In contrast, regular labels have infinite scope and require severe mental effort to come up with random new ones and keep track of them to not reuse accidentally. In the languages where labels are primary means of flow control (like assemblers) this can be quite an advantage.

More so for calculators, where LBL labels are available in finite quantity.

// DatafileVA001.pdf

// by Valentin Albillo

// port by nsg, 2013-07-11 21:11:55
// Sum alternating series [SIGMA](-1)^i f(i), i=0..∞

// LBL B defines f(i) (i in rX)

// Start:

// PSum [^] NDif [A]

// PSum -- integer >=0, may be >7, say 10

// NDif -- 1[<=]NDif[<=]7, integer

LBL'[SIGMA][infinity]±'

LBL A

CF 00

STO 11

x<> Y

STO 10

1

STO 08

0

STO 09

STO I

1H XEQ B

RCL 08

STO- 08

STO- 08

*

STO+ 09

INC I

RCL 10

RCL I

x[<=]? Y

BACK <1B>

STO 08

2

/

FP

x[!=]0?

SF 0

CLx

STO I

1H RCL 08

XEQ B

STO[->]I

INC I

1

STO+ 08

RCL 11

RCL I

x[<=]? Y

BACK <1B>

2

FS? 00

+/-

STO 08

ABS

1H -

STO I

STO 12

LBL 00

RCL[->]I

INC I

STO-[->]I

RCL 11

RCL I

x[!=]? Y

GTO 00

RCL 12

STO I

x=0?

SKIP <1F>

1

BACK <1B>

1H RCL[->]I

RCL 08

/

STO+ 09

2

+/-

STO* 08

INC I

RCL 11

RCL I

x[<=]? Y

BACK <1B>

RCL 09

RTN

// define ith element here (starting with 0-th)

LBL B

1

+

1/x

RTN

*Edited: 14 July 2013, 9:00 p.m. after one or more responses were posted*