gfldex
Making Debian possible. Allegedly, the German banking system is held together by Perl scripts. Which is good. Perl got 0 bitrot. And you don't want your bank account to rot, do you?
$ cat ~/.signature
--
raku -e 'try { not :2(.fear) } and do not die'
perl -e 'do not $fear and do not die'
raku -e 'say „The Road to Wisdom“; $*ERR and $*ERR and $*ERR but Less and Less and Less' constant &s = (now.DateTime.day-of-week == 7) ?? sub () {} !! sub (|) {};
constant c = s(42);
Constants are evaluated at compile time. Here we define a sub that takes no argument or any number of arguments depending on the day of the week (In Raku we start at 1 for monday to avoid ending the universe by deviding by 0). While binding the return value of s(42) to a constant we force execution of that sub at compile time. Thusly, we create a program that can not be executed when compiled on sundays. This is reasonalbe, because by heavenly mandate we are bound to rest on that day.Modules are precompiled, programs are not (yet). So to make this really depend on the day of compilation we have to put it into a module (for now).
With fiat book money any payment processor (banks, CC, paypal) can create dept and thus money. We have to hold a gun against their heads and never look away to make sure that they don't cheat. Crypto solves that problem.
Please note, that you asked for solution. Crypto is creating way more problems then it solves. The VISA Network is processing 2G transactions per day. With crypto you can be happy if you get beyond 100k per day. There is better reasons to burn fossil fuel, etc. pp.
do *² for 1..5;I build a very simple^1 non-balancing binary tree and skip any insertation that would reproduce a duplication. Since the tree is not balanced, the order of insertation is preserved. Search time goes up without a good balance but the tree will have the same amount of nodes than unique elements in the original array. Each element is 6 machine words plus some gc overhead. If it's faster or slower then a hash table depends on the ratio between elements in the array and the number of duplicates.
1) Perl 6 got a general compare operator that works well with a wide range of types. So I don't have to care about types at all. If I would have to care I could monkeytype the operator candidates for custom types into the language.
It takes years for a language to become used by a reasonably large group to make a difference. Given you come from Python you probably know that the first release happened in 1991. Do you know anyone who used that language before 2000? So Perl 6 didn't take off yet because less then a year since the initial release has happened.
The lack of feedback from actual language users did slow down Perl 6 development and esp. getting all the holes in the docs plugged.
It's a bit of a trap, I agree and we should fix it. Having all exceptions listed is on the list and will add another few hundred man hours to the nearly 5000 we invested in the docs so far.
If you really want to be verbose you can always write `open('foo.txt', :r).Str.split(/\W/)`. If you learn a new language there will be buildins that are well tested and may be more efficient then your solution (it isn't right now for your example. Rakudo does it exactly your way). It can be worth your time to learn what the standard library provides you with -- in any language that is.
The start page of https://docs.perl6.org/ is not referring there is a bug indeed. It will be fixed in a day or two.