Nemokosch how can I define a switch with sub MAIN? 00:34
you know, something like --amend for git commit
hm, Bool:D :$switch will do the trick? 00:36
I mean, I want a multi actually, the switch would have a clause 00:37
Yeuph So switching the sigil from $ to % worked, though I don't understand why. 00:40
Hmmm, the words I'm storing in the textfile are duplicating in the set. 00:49
kinda was hoping Raku woulda been smart enough to figure out not to do that on it's own - because *set* 00:50
I guess I need to add some condition check when writing to the textfile to not duplicate words? 00:51
Rogue There should not be duplicates in a set 02:05
can you post your most recent code @Yeuph#9974 ?
Yeuph my %SetText is SetHash;
%SetText.set(slurp "SetText.txt");
my $InputWord;
repeat {
$InputWord = prompt 'Add word to %SetText: ';
%SetText.set($InputWord);
spurt "SetText.txt", %SetText;
} while $InputWord ne "I'm done";
%SetText.unset("I'm done");
%SetText.say;
at the end you can see the "%SetText.say" 02:06
it'll list duplicate words in the %SetText and also the textfile (SetText.txt) 02:07
it'll list duplicate words in the %SetText and also store duplicates in the textfile (SetText.txt)
Rogue Hm, one problem I see is that you're using the result of `slurp` in the first call to `.set` 02:09
slurp returns the entire contents of the file as a single string
you want to split that string on space 02:11
so something like `%SetText.set: (slurp 'SetText.txt').split(/\s/)` 02:12
you're getting what *appear* to be duplicates because you have a string in there which looks like multiple words 02:14
Yeuph ahh
ok, so I was just storing some string of words as a single element in the set; and any new words as a new element (and a new string) 02:16
Rogue yep
Yeuph I'll do your fix
but its worth checking to see if 2 exact strings will duplicate
because *science*
Rogue yeah it's always good to verify even what you really strong assume will work
yeah it's always good to verify even what you really strongly assume will work
because the moment you don't is the moment you happen to have overlooked something :P 02:18
or so it often seems
Yeuph well its still storing identical strings as duplicates (before your split code anyway) 02:22
kinda curious
🤷
*split* works! 02:26
ty ty sir
or sir-ette 02:27
Rogue you're welcome 02:28
and sir is right haha
Nemokosch Is there a way to get around the recursive application of hyper? I don't think I ever wanted that behavior; I usually want to pass a list to the operator 10:14
I mean, yes, probably I can keep using Z