Rebmμ (10 characters)
Rebmu's "mushing" trick is that it's case-insensitive, so characters are run together. Whenever a case transition is hit, that splits to the next token. By using transitions instead of a CamelCase kind of thing, the unique choice to start with a capital run means a "set-word" is made. (While set-words can be used for other purposes in symbolic programming, they are evaluated as assignments by default).
So this "unmushes" to:
e? a: ts a uq a
The space is needed because once you've begun a series of runs of alternating cases, you can't use that trick to get a set-word after the first unless you begin a new run. So
e?AtsAuqA would have gotten you
e? a ts a uq a...no assignment.
(Note: For what may be no particularly good reason, I tend to prefer rethinking solutions so that there are no spaces, if character counts are equal. Since brackets, parentheses, and strings implicitly end a symbol...there are often a fair number of opportunities for this.)
In any case, when mapped to the Rebol that it abbreviates:
equal? a: to-string a unique a
Throwing in some parentheses to help get the gist of the evaluation order:
equal? (a: (to-string a)) (unique a)
So the prefix equality operator is applied to two arguments--the first the result of assigning to
a of the string version of itself, and the second the result of
unique being run against that string. It so happens that unique will give you back the elements in the same order you passed them...so unique of "31214" is "3124" for instance.
Run it with:
>> rebmu/args "e? AtsAuqA" 17308459
There's also some stats and debug information:
>> rebmu/args/stats/debug "e? AtsAuqA" 48778584
Original Rebmu string was: 10 characters.
Rebmu as mushed Rebol block molds to: 10 characters.
Unmushed Rebmu molds to: 15 characters.
Executing: [e? a: ts a uq a]
If the requirement is that one must define a named/reusable function you can make an "A-function" which implicitly takes a parameter named a with
a|. (A B-function would be created with
b| and take a parameter named A then one named B). So that would add five more characters...let's say you call the function "f"
"You laugh! They laughed at Einstein! Or wait...did they? I...don't know."