🦋 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.
perryprog melethere probably isn't quite what you want since it seems to flattent the output (it's not ([5, 6], [8, 9]) 02:16
m: my @mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; say @mat[1,2;[1,2]];
camelia (5 6 8 9)
perryprog phooey, I'm too slow. Well now I'm curious, does anyone know how to do the above and get the result ([5, 6], [8, 9])? 02:17
Xliff_ Good morning. 07:18
What's the best way to check for a dynamic variable at runtime?
m: ?%*a.say
camelia WARNINGS for <tmp>:
Useless use of "?" in expression "?%*a.say" in sink context (line 1)
Dynamic variable %*a not found
in block <unit> at <tmp> line 1
Xliff_ m: %*a?.say 07:19
camelia 5===SORRY!5=== Error while compiling <tmp>
Bogus postfix
at <tmp>:1
------> 3%*a7⏏5?.say
expecting any of:
infix
infix stopper
statement end
statement modifier
statement modifier …
Xliff_ m: %*a.say
camelia Dynamic variable %*a not found
in block <unit> at <tmp> line 1
Xliff_ m: my %*a; say ::MY("%*a'")
camelia Cannot invoke this object (REPR: Uninstantiable; MY)
in block <unit> at <tmp> line 1
Xliff_ m: my %*a; say ::("%*a'")
camelia No such symbol '%*a''
in block <unit> at <tmp> line 1
Xliff_ m: my %*a; say MY::.keys
camelia ($=pod $¢ !UNIT_MARKER $=finish ::?PACKAGE EXPORT %*a GLOBALish $_ $! $/ $?PACKAGE)
Xliff_ m: my %*a; say MY::<%*a>.VAR.^name 07:20
camelia Hash
Xliff_ m: my %*a; say MY::<%*a>.VAR.name
camelia %*a
Xliff_ m: my %*a; say MY::<%*a>.defined
camelia True
Xliff_ \o/
Xliff_ m: $?s.say 08:14
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$?s' is not declared
at <tmp>:1
------> 3<BOL>7⏏5$?s.say
Xliff_ m: ?$s.say
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$s' is not declared
at <tmp>:1
------> 3?7⏏5$s.say
Xliff_ m: my $s; ?$s.say
camelia WARNINGS for <tmp>:
(Any)
Useless use of "?" in expression "?$s.say" in sink context (line 1)
jmerelo Travis has honored our request for more CI credits twitter.com/jjmerelo/status/1324272244349173760 With the new plan, we would have exhausted them by day 10 every month or so. 08:49
This is only for the Raku organization. I've been looking up Travis usage in the rest of the organizations, seems to be relatively small. Should it increase, however, someone might want to do the same kind of request through Travis Support. 08:50
thundergnat m: my @mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; say @mat[1,2]»[1,2]».Array; 10:16
camelia ([5 6] [8 9])
thundergnat perryprog: ^^^^ 10:17
m: my @mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; say @mat[1,2]»[1,2]; # or, if you don't actually need arrays returned 10:18
camelia ((5 6) (8 9))
SmokeMachine m: my @mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; say @mat[1,2].map: *[1,2] 10:32
camelia ((5 6) (8 9))
SmokeMachine m: my @mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; say @mat.tail(2).map: *.tail: 2
camelia ((5 6) (8 9))
SmokeMachine m: my @mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; say @mat.skip.map: *.skip 10:33
camelia ((5 6) (8 9))
SmokeMachine m: multi a([$a, *@r]) { do for @r { .&a } }; multi a($a) { $a }; say a [[1, 2, 3], [4, 5, 6], [7, 8, 9]] 10:37
camelia ((5 6) (8 9))
cpan-raku New module released to CPAN! Text::Flags (0.0.1) by 03ELIZABETH 12:27
perryprog SmokeMachine :) thanks! 13:01
.tell thundergnat Thank you! 13:02
tellable6 perryprog, I'll pass your message to thundergnat
melezhik .tell perryprog, thanks , I'll take a look at your suggestions with slices later 15:02
tellable6 melezhik, I'll pass your message to perryprog
perryprog melezhik, make sure you take a look at the messages below mine as well, as those show non-flat examples. 15:29
tellable6 2020-11-05T15:02:55Z #raku <melezhik> perryprog, thanks , I'll take a look at your suggestions with slices later
perryprog heh
melezhik lizmat Text::Flags Rakudist fails - rakudist.raku.org/sparky/report/debian/897 with some interesting error - rakudist.raku.org/sparky/report/debian/897 15:30
Serialization Error: missing static code ref for closure 'run' (gen/moar/stage2/NQPHLL.nqp:2248)
perryprog - sure
.tell lizmat rakudist.raku.org/sparky/report/debian/897 15:33
tellable6 melezhik, I'll pass your message to lizmat
lizmat melezhik: am aware of the issue, I can *not* reproduce this locally :-( 16:00
tellable6 lizmat, I'll pass your message to melezhik
Geth_ advent: a551ebda3b | Altai-man++ (committed using GitHub Web editor) | raku-advent-2020/authors.md
Update authors.md
16:10
tbrowder hi, all 16:24
tbrowder just reading jmerelo's new book "Raku Recipes" and enjoying it 16:25
one question about a regex construct i'm not sure of. on p. 346 is the following line: 16:26
rir Given a Str: 'my-classname' how would get a my-classname:U? 16:27
tbrowder token quantity { <:N>+ }
tbrowder what does that ^^^ mean? 16:27
timotimo the : is for unicode properties, if there's no key-value kind of thing, it's for general-category 16:29
and N is short for Numeric i think?
tbrowder ah, that sounds right, thank! forgot about unicode space, silly ascii language person me am :-D 16:30
thanks
timotimo it's quite possible that you're getting far more numerics than you were bargaining for, though :) 16:31
tbrowder yep, for my project i'll use something else
just tryinh 16:32
trying to grok the example grammar
SmokeMachine m: my Str $class-name = "Int"; say ::($class-name).new # <-- rir 16:35
camelia 0
melezhik .tell lizmat you can use Rakudist to test your github repos if it helps 16:41
tellable6 melezhik, I'll pass your message to lizmat
rir Thanks SmokeMachine, I thought I'd seen something like that but couldn't find it. 16:42
cpan-raku New module released to CPAN! Text::Flags (0.0.2) by 03ELIZABETH 17:38
Zero_Dogg For an Exception subclass, the docs say to at least override the message method. Is a 'has $.message is required;' sufficient, or should I specify the method explicitly? 18:48
Altreus That's what I've been doing 18:53
timotimo it's fine to use has $.message, since that gives you a message method auto-generated 18:54
Zero_Dogg yep, that's what I thought, just had to make sure I wasn't missing anything 18:55
thanks!
Tirifto Hello! What would be an elegant way to go through the elements of a list, dealing with a variable amount of elements at a time, based on what they are? (Simple example: going through a list of words, but reading in another word from the list to do something with, if the first one ends in a colon. E.g. for (a b c d: e f g: h), dealing in order with 20:05
(a) (b) (c) (d: e) (f) (g: h).)
tobs Tirifto: that seems a little too much for signature tricks. I would probably write an imperative sub that turns an input Seq into an output Seq as per your specification. Once you have that sub well hidden away, you can start thinking about using it elegantly :) 20:08
Tirifto I could only think of taking a single element at a time and storing the context in a variable to decide what to do. (E.g. ‘Did the last element end in a colon? If yes, do this, else do that.’) I’ve also read about iterators in the documentation, but I’m not sure if this would be a good use of them. 20:10
[Coke] input/output iterator makes sense to me depending on what you're doing. 20:11
[Coke] if you want to run some code if you see a colon, but diferent code if not, a map is probably sufficient. 20:11
... not elegant, but sufficient (you'd ahve to save the : info with a state var, probably). on the other end, you could turn it into a supply and have the code tapping it tap another value if it sees a : 20:12
do you have the whole list up front?
Tirifto tobs: Seq looks interesting to know about, I will definitely look into it! 20:14
Tirifto [Coke]: In this case yes; by the time I want to pass the list to whatever will take care of it, the list is complete. 20:14
tobs m: sub aggregate (\seq) { my @agg; gather for seq -> $elt { @agg.push($elt); unless $elt ~~ /':'$/ { take @agg.splice } } }; say "«$_.raku()»" for aggregate <a b c d: e f g: h> 20:16
camelia «["a"]»
«["b"]»
«["c"]»
«["d:", "e"]»
«["f"]»
«["g:", "h"]»
tobs Tirifto: ^ it takes something iterable (called "seq" but may be array as well -- my bad naming) and uses gather/take to turn it into the desired sequence of arrays. 20:17
Tirifto tobs: …now I’ve got it! Very nice! :D 20:36
I will look into a supply; it looks like that’s similar to manually iterating over the values? (As in, you say “give me the next one” whenever you need?) 20:37
timotimo supplies work the other way around, they run whenever (that's where the name of whenever comes from) a value becomes available 20:40
Tirifto Ah, I see. Would there be an analagous construct which gets you the next value on demand then? Is that basically just the iterator? 20:48
timotimo yeah, for-loop over it or map it or whatever? 20:51
or grab the iterator and .pull-one on it until it gives you IterationEnd
Geth_ advent: 8bd23e22fb | L'Alabameñu++ (committed using GitHub Web editor) | raku-advent-2020/authors.md
Add guifa

Draft visible in alabamenhu/DateTimeTimezones repository.
21:20
Tirifto Thank you, I am going with the iterator! 22:27