🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
AncientWizard I've read the IO::Pipe page online I'm looking for the deeper suff that page left out. The page does not explain how to create a working pipe without using Proc::Async first 00:01
guifa .tell AncientWizard You can create a pipe manually by using IO::Pipe.new: :$on-read, :$on-write, :$on-close 00:08
tellable6 guifa, I'll pass your message to AncientWizard
samebchase- What signature should MAIN have so that I can pipe data to it, as part of a UNIX pipeline 08:16
moon-child samebchase-: nothing to do with your signature, you just read from $*IN and write to $*OUT 08:45
samebchase- thank you moon-child! let me try that out
moon-child (or just use get and say, but using $*IN and $*OUT make it easier for you to change in/out files according to params later on) 08:46
lizmat when reading lines from STDIN, I would use "lines" 09:28
samebchase- moon-child ^^
m: .say for lines
camelia »Wann treffen wir drei wieder zusamm?«
»Um die siebente Stund‘, am Brückendamm.«
»Am Mittelpfeiler.«
»Ich lösche die Flamm.«
»Ich mit«

»Ich komme vom Norden her.«
»Und ich vom Süden.…
lizmat note that "lines" is lazy
m: .uc.say for lines 09:29
camelia »WANN TREFFEN WIR DREI WIEDER ZUSAMM?«
»UM DIE SIEBENTE STUND‘, AM BRÜCKENDAMM.«
»AM MITTELPFEILER.«
»ICH LÖSCHE DIE FLAMM.«
»ICH MIT«

»ICH KOMME VOM NORDEN HER.«
»UND ICH VOM SÜDEN.…
lizmat also note that using "lines" will automatically read from any number of files that you specify on the command line
raku foo.raku bar baz 09:30
will produce lines first from "bar", then from :baz"
parv lizmat, is there special syntax/idiom to get all the lines in a scalar variable? 09:31
lizmat slurp 09:32
parv ah. thanks lizmat.
lizmat m: say slurp
camelia »Wann treffen wir drei wieder zusamm?«
»Um die siebente Stund‘, am Brückendamm.«
»Am Mittelpfeiler.«
»Ich lösche die Flamm.«
»Ich mit«

»Ich komme vom Norden her.«
»Und ich vom Süden.…
lizmat also "words" has the same semantics: 09:33
m: .say for words
camelia »Wann
treffen
wir
drei
wieder
zusamm?«
»Um
die
siebente
Stund‘,
am
Brückendamm.«
»Am
Mittelpfeiler.«
»Ich
lösche
die
Flamm.«
»Ich
mit«
»Ich
komme
vom
Norden
her.«
»Und
ich
vom
S…
lizmat m: .tc.say for words
camelia »Wann
Treffen
Wir
Drei
Wieder
Zusamm?«
»Um
Die
Siebente
Stund‘,
Am
Brückendamm.«
»Am
Mittelpfeiler.«
»Ich
Lösche
Die
Flamm.«
»Ich
Mit«
»Ich
Komme
Vom
Norden
Her.«
»Und
Ich
Vom
S…
parv "words" is interesting to know in its own right. 09:34
lizmat yeah, people tend to forget about it 09:35
moritz_ Who maintains modules.raku.org/ these days? 09:43
lizmat has no idea 09:47
rba might know
samebchase- thank you for the tip lizmat 10:21
MasterDuke doesn't zef have two places where it gets the list of modules from? github.com/Raku/ecosystem/blob/master/META.list and somewhere else? 10:36
lizmat I think fez's list ? 10:40
dakkar MasterDuke: run `zef --verbose update` to see them all
MasterDuke thanks 10:41
dakkar also, `zef --help` tells you where its config file is, in case you want to change those URLs 10:43
MasterDuke ugexe: github.com/ugexe/Perl6-ecosystems/pull/3 in case you don't get GH notifications 10:50
ugexe MasterDuke: that list is generated from the META.list link you posted earlier 13:09
a pull request to my repo will just get overwritten in an hour or two 13:10
MasterDuke but those typos aren't in github.com/Raku/ecosystem/blob/master/META.list
Altreus Can you tap an array? And if not, how easy would it be to have «has @.messages but Tappable» or ... however that's done 13:14
So that you get a supply whenever it's appended to
It's a queue really
ugexe MasterDuke: sure they are 13:17
lizmat m: my @a = ^10; react whenever @a.Supply { .say }
camelia 0
1
2
3
4
5
6
7
8
9
ugexe just follow the link in META.list
lizmat m: my @a = ^10; react whenever @a.Supply { .say } # Altreus 13:18
camelia 0
1
2
3
4
5
6
7
8
9
Altreus yayaya
can I make it a live supply so I don't hear about existing values? :D
ugexe that isn't going to catch when you append things to the array is it?
Altreus m: my @a = ^10; react whenever @a.Supply { .say } @a.push(11)
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3= ^10; react whenever @a.Supply { .say }7⏏5 @a.push(11)
expecting any of:
infix
infix stopp…
Altreus m: my @a = ^10; react whenever @a.Supply { .say }; @a.push(11)
camelia 0
1
2
3
4
5
6
7
8
9
Altreus it is not
:(
ugexe yeah i wouldnt think so 13:19
MasterDuke oh, it's in *their* meta6, i was just looking at the values in the list
lizmat m: my @a = ^10; dd @a.Channel # meh 13:20
camelia No such method 'Channel' for invocant of type 'Array'
in block <unit> at <tmp> line 1
Altreus Could fairly easily write a subclass of Array, right? has Queue @.messages;
.=new 13:21
lizmat Well, what you'd want is a Channel, no ?
Altreus I defer to your expertise in that
not sure, because I also want it to act like an array 13:22
I could of course double up and have a supply that is fed when I add to the array
I could also rename @.messages so the supply itself held that spot 13:23
lizmat m: my $c := Channel.new; $c.send(42); react whenever $c { .say } 13:24
camelia (timeout)42
lizmat m: my $c := Channel.new; $c.send(42); $c.close; react whenever $c { .say }
camelia 42
lizmat hmmm... am about to go afk for a few hours 13:25
will think about it&
Altreus :)
guifa I feel like I’m spending way too much time handling naming subs 16:43
Altreus use anonymous ones 17:22
guifa ha
guifa This is for a module, so having to balance clarity, distinctiveness and brevity 17:23
Altreus naming things is the main challenge of programming 17:24
guifa especially when one of the words is “localization” and you have an insane hatred of “l10n” 17:25
codesections guifa: agreed re: the difficulty. I have a cluster of related custom properties that I'm currently "namespacing" with the letter é 17:26
lizmat
.oO( l5z4n )
for the americans, and l5s4n for the more english inclined :-) 17:27
guifa casts a butterfly summon spell to attack lizmat 17:27
you know Oxford actually prefers the z in those words haha
lizmat oops :-) 17:28
guifa in my case, I have names that would definitely be potentially used by other modules
lizmat that would only be an issue when used in the same scope ? 17:29
guifa Yeah — unfortunately I could see them possibly being used in the same scope too
I did one interesting solution with LanguageTag
use Intl::LanguageTag actually gives you Intl::LanguageTag::BCP47, but aliased to the former 17:30
so maybe I’ll do a similar one here, to give a longer / shorter import option based on what users want. Since it’s only a few subs, it’s minimal maintenance once made
Because gist.github.com/alabamenhu/a84cec3...b26fc74907 <— that is very wordy :-( 17:31
lizmat well, properly manipulating the EXPORT hash, would be the only thing to do then ?
Altreus Oxford can swivel
They're the same people who accept "aluminum" in scientific papers 17:32
Now if we're fixing *all* of the letters then by all means, gimme that z
guifa lizmat: actually yeah I guess I could just use a :long option. When I did LanguageTag, the issue was I had always used Intl::LanguageTag, but with the rewrite, that really just became a namepsace for different language tag types, so for backwards compatibility (and also a not-so-subtle hint that one is the preferred) I did the weird passthrough export 17:39
codesections What's the syntax for calling a method via a Str, again? Not a tool I reach for very often, and I'm not seeing it right off in the docs 17:42
guifa .”$foo”
err
lizmat .:$foo"() 17:43
guifa .”$foo”() <— parentheses obligatory
lizmat yup
guifa one of my favorites
codesections ty. I was missing the parens
guifa in one of my modules where I do both attribute and hash access I have method AT-KEY($key) { self.”$key”() } 17:45
works like a charm
codesections ha
lizmat indeed... and if a key is not supported, that will throw :-) 17:47
much better than the other way around :-) 17:48
guifa I had it the other way around ( method FALLBACK ($method) { self.Hash::AT-KEY($method) }  ) originally 17:49
the undefined keys weren’t terrible for what I was doing, but the speed was the difference
attribute access > hash access for speed
codesections what are your/everyone's feelings about FALLBACK in general?
guifa codesections: did you see my $file.greatgreatgreatgreatgreatgreatgrandparent thing? 17:50
codesections I've been tempted, but have mostly stayed away
... that sounds familiar, but I'm not positive
guifa www.nntp.perl.org/group/perl.perl6...g9858.html 17:51
codesections ha 17:54
guifa Though that shows a really good use for fallback: you can actually respond to the text of the method called. Any (or Mu?) uses this try to provide a recommend to you if you misspelled it 18:02
codesections yeah. I guess I'm concerned that I lose the _existing_ error messages, though, which tend to be pretty good 18:07
guifa you can always callsame if you can determine you don’t have a better error message 18:08
codesections you can? I guess I thought you were at the bottom of the call chain at that point 18:09
guifa FALLBACK can be multi’d :-)
codesections oh, so you'd be falling back to other FALLBACKs, I get it 18:10
guifa but the error messages might be usefully tailored in some cases. For instance on CLDR trying to access an unknown attribute will display the available ones instead (tend to be no more than a dozen or so)
codesections yeah, that seems like a good use of fallback. The _tempting_ uses are more like the one you mentioned earlier, where I want to support calling something arbitrary (like your keys) 18:12
guifa I think the best question to ask yourself before using FALLBACK is “is there another way? And is it better?”
the greatgreatgrandparent one can’t really be done another way. So FALLBACK makes sense. Mimicking Javascript Objects (~~  Raku Hash) is another good use. Better error message is one. And … I can’t think of any off the top of my head ha 18:13
actually, if hypothetically 0x syntax didn’t exist, I guess you could do x.ff where class x { method FALLBACK ($n) { $n.base(16) } } 18:15
guifa is afk for a bit 18:16
[Coke] (l10n) I know someone who named their l10n product "l10n" which is really frustrating to me. 19:18
japhb [Coke]: Fitting our metamodel, perhaps "Localizable". (Localizer is already used!) 20:08
guifa japhb: Localizable is def more of a Role :-) 20:19
Geth doc: b40c9b0bd1 | (Stoned Elipot)++ | doc/Type/Proc.pod6
Match example's code with its output
20:32
linkable6 Link: docs.raku.org/type/Proc
[Coke] Urk. I was using :skip-empty on split thinking it was just beginning/end skips 21:24
guifa d’oh 21:38
leont Urk? What does a conservative christian fishing town in The Netherlands have to do with this? 😛
codesections wow, you're not kidding. At least judging by their Wikipedia page, they take fish _very_ seriously 21:41
It's not so much that they have a fish both on their Coat of Arms *and* on their flag… 21:43
it's more that they care enough to have made the two fish distinctly different, while still not being distinct
guifa codesections: there are all sorts of interesting things in those symbols in Europe 21:44
my favorite WTF is Madrid’s because it has a bear trying to eat fruit out of a strawberry tree … and Madrid has neither bears nor strawberry trees :P
codesections :D 21:45
guifa But look up Riumors in Spain 21:47
THAT’S an impressive one
( en.wikipedia.org/wiki/Riumors#/med...iumors.svg ) 21:52
[Coke] anyone here familiar with nuget packaging? have an OT question 22:14
stackoverflow.com/questions/670101...nd-the-api 22:15
Geth ecosystem: JRaspass++ created pull request #588:
Update dists who've switched from master to main
22:42