On Tue, Oct 18, 2016 at 3:42 PM, Jay Foad wrote:
> ⍋⍋'GNUAPL'
Great! Thanks.
This is called "ranking" and is very simple in APL:
⍋⍋'GNUAPL'
2 4 6 1 5 3
The permutations 4 1 6 2 5 3 (i.e. ⍋'GNUAPL') and 2 4 6 1 5 3 are inverses
of each other, and ⍋ will invert a permutation.
Jay.
On 17 October 2016 at 15:41, Ala'a Mohammad wrote:
> Hi Juergen,
>
> Thanks for the
Hi Juergen,
Thanks for the fix.
Apology if I could not explain what I'm trying to do. It is: given a
string, replace every char with its alphabetic index (starting from
1). The following simpler solution achieves it.
⊢string ←'GNUAPL'
GNUAPL
⊢string[⍋string] ← ⍳⍴string
1 2 3 4 5 6
Hi Ala'a
thanks, fixed in SVN 798.You will now get a DOMAIN ERROR
instead of
a failed assertion.
The DOMAIN ERROR is being reported because you try to compare
objects that
would be called left values in C/C++, so your code is also wrong.