user
|  |
| --- |
| Note:   jortSort is considered a work of satire.   It achieves its result in an intentionally roundabout way.   You are encouraged to write your solutions in the spirit of the original jortsort rather than trying to give the most concise or idiomatic solution. |

JortSort is a sorting tool set that makes the user do the work and guarantees efficiency because you don't have to sort ever again.
  
It was originally presented by Jenn "Moneydollars" Schiffer at the
prestigious   JSConf.

JortSort is a function that takes a single array of comparable objects as its argument.

It then sorts the array in ascending order and compares the sorted array to the originally provided array.

If the arrays match   (i.e. the original array was already sorted),   the function returns   **true**.

If the arrays do not match (i.e. the original array was not sorted), the function returns   **false**.
assistant
(formerly Perl 6)

```
sub jort-sort { @_ eqv @_.sort }

```

Actually, there's a better internal sort that seems to work best for lists that are already completely sorted, but tends to fails for any other list. The name of this sort, [!after], is completely opaque, so we're pretty much forced to hide it inside a subroutine to prevent widespread panic.

```
sub jort-sort-more-better-sorta { [!after] @_ }

```

However, since Perl 6 has a really good inliner, there's really little point anyway in using the [!after] reduction operator directly, and jort-sort-more-better-sorta is really much more self-documenting, so please don't use the reduction operator if you can. For example:

Output:

```
$ perl6
> [!after] <a b c>  # DON'T do it this way
True
> [!after] 1,3,2    # DON'T do it this way either
False
```

Please do your part to uphold and/or downhold our community standards.