🦋 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.
melezhik .tell lizmat I like this "Alexey's corner" idea in the last RW ))) 03:12
tellable6 melezhik, I'll pass your message to lizmat 03:13
guifa So weird. I can sub EXPORT { ‘&foo’ => my token foo { … } } and the token is usable if I use Foo; inside of a grammar 04:40
But if I say “my method” instead of “my token”, it fails.
Nonetheless, with a regular class, “my method” works without problem
jmerelo m say &do.^name 05:12
jmerelo m: say &do.^name 05:12
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
do used at line 1. Did you mean 'so', 'dd'?
jmerelo m: say (&do).^name
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
do used at line 1. Did you mean 'dd', 'so'?
jmerelo m: say &do 05:12
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
do used at line 1. Did you mean 'dd', 'so'?
jmerelo m: say &if
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
if used at line 1
jmerelo say &say.^name 05:13
evalable6 Sub
jmerelo say &do.^name
m: say &do.^name
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
do used at line 1. Did you mean 'dd', 'so'?
jmerelo m: say &if.^name
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
if used at line 1
jmerelo m: say (do if True then 3).^name 05:19
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3say (do if True7⏏5 then 3).^name
expecting any of:
block or pointy block
infix
infix stopper
jmerelo m: say with do if True then 3 say .^name 05:20
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of bare "say". In Raku please use: .say if you meant
to call it as a method on $_, or use an explicit invocant or argument,
or use &say to refer to the function as a noun.
at <tmp…
jmerelo m: my $statement = do if True then 3 ; say $statement.^name
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3my $statement = do if True7⏏5 then 3 ; say $statement.^name
expecting any of:
block or pointy block
infix
infix stopper
jmerelo m: my $statement = do if True 3 ; say $statement.^name 05:21
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3my $statement = do if True7⏏5 3 ; say $statement.^name
expecting any of:
block or pointy block
infix
infix stopper
jmerelo m: my $statement = do if True {3} ; say $statement.^name
camelia Int
jmerelo m: my &statement = do if True {3} ; say &statement.^name
camelia Type check failed in assignment to &statement; expected Callable but got Int (3)
in block <unit> at <tmp> line 1
jmerelo m: my &ifs = { if $_ then {34} else {43}}; ifs(True).say 05:26
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3my &ifs = { if $_7⏏5 then {34} else {43}}; ifs(True).say
expecting any of:
block or pointy block
infix
infix stopper
jmerelo m: my &ifs = { if $_ {34} else {43}}; ifs(True).say 05:27
camelia 34
jmerelo m: my &ifs = { if $_ {34} else {43}}; my $result = ifs(True).say; say $result 05:30
camelia 34
True
jmerelo m: my @fors = ($_ *2 ) for ^4; say @fors 05:42
camelia [6] 05:43
jmerelo m: my @fors = (($_ *2 ) for ^4); say @fors
camelia [0 2 4 6]
Geth doc: d9fef79582 | (JJ Merelo)++ | doc/Language/control.pod6
Minor fixes
06:08
linkable6 Link: docs.raku.org/language/control 06:09
lizmat clickbaits rakudoweekly.blog/2020/10/19/2020-42-recipes/ 09:33
tellable6 2020-10-20T03:13:00Z #raku <melezhik> lizmat I like this "Alexey's corner" idea in the last RW )))
lizmat wonders how many people got the en.wikipedia.org/wiki/Alexis_Korner reference :-) 09:39
cpan-raku New module released to CPAN! Math::Libgsl::LinearAlgebra (0.0.2) by 03FRITH 10:36
jmerelo Just got my author copies of Raku Recipes. Here's the preface with ackowledgements www.flickr.com/photos/atalaya/5050...datetaken/ moritz++ (who not only introduced me to Apress, but was also reviewer), but also... xliff++, Altai-man++, and many others. 11:15
lizmat jmerelo++ 11:28
[Coke] ugh. edit a wiki via local git checkout. push. out of date. rebase. push. out of date. rebase. push. out of date. 13:09
(it worked the next time. :)
moritz does it store the whole wiki in a git repo? 13:10
if so, every single page edit could lead to such a conflict. Not very scalable :D
[Coke] moritz: it's azure devops wiki. if you're editing via the front end, I imagine it's a little smarter. 13:11
moritz at $work we have a DNS server with some 7k zone files, each versioned with RCS 13:12
we tried to a switch to git, but there are simply too many changes to make that scale, given that git always records changes as changes to the whole repo, not per file 13:13
[Coke] nifty. 13:17
xinming m: sub t ($x) { $x.say }; class A { has &.code; method ok () { &!code("ok") }; method nok() { $.code("nok") } }; my $t = A.new(:code(&t)); $t.ok; $t.nok 14:08
camelia ok
Too many positionals passed; expected 1 argument but got 2
in method code at <tmp> line 1
in method nok at <tmp> line 1
in block <unit> at <tmp> line 1
tellable6 2020-10-18T13:08:16Z #raku <tbrowder> xinming have you tried %?RESOURCES.keys to see whats there? do you have anything in your resources dir? is resources mentioned in Meta file (not sure if that’s required)?
2020-10-18T14:02:44Z #raku <tbrowder> xinming see module RakuAdvent::Wordpress for an example of using %?RESOURCES
xinming tbrowder: Thanks, will check it out
In this example, $!code("ok") work as expected, But why not the $.code("nok")? 14:09
m: sub t ($x) { $x.say }; class A { has &.code; method ok () { &!code("ok") }; method nok() { &.code("nok") } }; my $t = A.new(:code(&t)); $t.ok; $t.nok
camelia ok
Too many positionals passed; expected 1 argument but got 2
in method code at <tmp> line 1
in method nok at <tmp> line 1
in block <unit> at <tmp> line 1
xinming Shouldn't the &.code("nok") be the same as $!code("ok"), and not passing the self? 14:10
xinming I think the reason &.code("nok") doesn't work is because, it's doing something like, $(&!code)(self, "nok") not expected $($!code)("nok") ?? 14:11
lizmat m: class A { has &.a }; dd A.new(a => * + *).a()(42,666) # you need extra parens 14:13
camelia 708
lizmat m: class A { has &.a }; dd A.new(a => * + *).a(42,666) 14:14
camelia Too many positionals passed; expected 1 argument but got 3
in method a at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat xinming: is that where you're getting at ?
xinming lizmat: Thanks, Seems, still needs more understanding of the $.accessor 14:17
I thought $.accessor is something like, $(self.accessor) 14:18
$(self.accessor)("arg")
rir How to avoid this downward invasion: 'role Export { method get-exportee-type { ... } }'? 14:47
moritz rir: I don't quite understand the question, can you please elaborate? 14:51
Altreus a role for each type?
lizmat xinming: I think you understand the accessor correctly 14:52
the accessor for &.a *does* just return the code object 14:53
rir A supporting get-exportee-... method seems needed to support the role's deferred method. I'd like a mixin that doesn't require the under class to be instrumented.
lizmat but if you say A.a, you are calling the *accessor* that does not take any arguments 14:54
guifa jmerelo: I can haz signed copy? :-)
Altreus rir: are you saying that you don't want consuming classes to be required to implement get-exportee-type?
as in forced to
lizmat that is why you need to do A.new(a => *+*).a() first to get the code object, and then pass (42.,666) to that code object
rir Altreus: Yes.
guifa slips jmerelo an extra duro y un culín de sidra asturiano fresco 14:55
Altreus rir: well that's what ... means
rir: don't put ... and then you simply have an empty default implementation
these are the only options :) 14:56
rir Altreus: Yes, but I need the class of the consuming object in the role consumed.
Altreus I believe that can be expressed as ::?CLASS
Where this does and doesn't work, I am uncertain
rir That is a var I haven't tried. I'll check it out and report shortly. 14:57
tobs m: role Export { method get-exportee-type { ::?CLASS } }; class A does Export {}; say A.new.get-exportee-type
camelia (A)
Altreus I guess I *can* retain information!
tobs (I thought for sure this would say "Export" because I assumed ::?CLASS to be more lexical, but it's ::?CLASS after all and not ::?ROLE) 14:58
but good for you :-)
Altreus and you called it on A, not Export
m: role Export { method get-exportee-type { ::?ROLE } }; class A does Export {}; say A.new.get-exportee-type
camelia (Export)
Altreus hmm 14:59
m: class A { method a { ::?ROLE } }; say A.new.a
camelia 5===SORRY!5=== Error while compiling <tmp>
No such symbol '::?ROLE'
at <tmp>:1
------> 3class A { method a { ::?ROLE7⏏5 } }; say A.new.a
Altreus aha
tobs since get-exportee-type is a method, I think you could also refer to self.WHAT inside of its implementation in the role and get the type of invocant dynamically 15:00
guifa Is there anyway to use a method to create a Match object that doesn’t destroy the caller’s $¢? Apparently I’m doing something wrong and I’ve tracked it down to that 15:16
rir Thanks tobs, Altreus. 15:17
jmerelo guifa hey. I guess you can. But you want me to mail it direct? Or you want me to store it for you for the next time we meet? 15:18
rir In a more purely curious vein: Why is ' in identifiers? And does anyone use it in them?
jmerelo I'm mailing one just today to tbrowder, so if it's the first, tell me now! 15:19
guifa jmerelo: eh, I’d prefer the latter but given the virus I’m not holding out any hope of getting to the peninsula in the near future :-(
jmerelo rir: it's just cool. I seem to remember there was an explanation for it by Larry Wall somewhere. It's consistent with... something
rypervenche rir: I imagine it would be useful to show possession, so probably not super useful until you need it. Then it makes it a bit clearer what it means. 15:20
guifa so I’ll need to go with the first. PM or e-mail me where I can pay you and I’ll do that right away
jmerelo guifa: yep, that's the thing. Nor in-person Perl/Raku events. So best to nail it now. Email me your mail address
guifa I know I’ve used a ‘ in an identifier before and was happy for it, but I can’t remember what it was exactly 15:21
guifa Beyond English’s possession, both - and ‘ are used a lot in other languages, so it makes sense to include them if we’re also doing all the diacritics as valid identifiers too 15:23
my $to-bind; my $p’arreyar; 15:24
rir I don't object re: '. I just haven't seen it in code yet. 15:30
jmerelo m: my $se-h'acabat = True
camelia ( no output )
rir Oops, I forgot that I had a motive beyond curiosity. Is there an Identifer parser module? 15:32
guifa You’d need to coopt the Raku grammar — modules can change the definition at runtime :-) 15:33
MasterDuke the Test-Helper module in roast has things like `doesn't-warn`
maybe Perl6::Parser has something 15:34
guifa but the definition of an identifier is the following:
token identifier { <.ident> [ <.apostrophe> <.ident> ]* }
guifa ident is available to garden variety regexen, and apostrophe is just <[‘\-]> 15:35
rir I will bow to greater wisdom, guifa, but that isn't a full and extended (versioned?) id definition is it? 15:36
Geth ecosystem: hythm7++ created pull request #556:
Re-add Pakku to the Ecosystem
15:38
guifa rir: that’s defined in the grammar as a name, which is defined as [<identifier> <morename>* | <morename>+]
rir guifa: Thanks, I'll look at that. With a good spot to start, maybe I'll find it more enlightning. 15:43
Geth ecosystem: 7024dcdcca | (Haytham Elganiny)++ | META.list
Re-add Pakku to the Ecosystem
15:45
ecosystem: 2192ce090b | (Aleks-Daniel Jakimenko-Aleksejev)++ (committed using GitHub Web editor) | META.list
Merge pull request #556 from hythm7/master

Re-add Pakku to the Ecosystem
tobs rir: I remember seeing it here github.com/Raku/whateverable/blob/...e.pm6#L114
Altreus can't help but notice guifa's apostrophe is a real apostrophe as well 15:46
tobs what I like most about it being allowed in identifiers, though, is that this feature does not interfere with using ' as a prefix or postfix operator :-)
guifa rir: <ident>, fwiw, is defined as /<:L+[_]> <:L+:Nd+[‘+]>*/ 15:47
err
I mean /<:L+[_]> <:L+:Nd+[_]>*/ 15:48
basically, alphabetic followed by alphanumeric and always allowing for an underscore
[Coke] gist.github.com/coke/59b4024c1a033...775a4d68e7 15:52
guifa [Coke] XD 15:53
[Coke] (er, important bun-based update to App::Uni) 15:54
jmerelo m: say Foo::Bar:ver<0> == Foo::Bar:ver<foo> 16:00
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix == instead.
at <tmp>:1
------> 3say Foo::Bar:ver<0> ==7⏏5 Foo::Bar:ver<foo>
jmerelo m: say Foo::Bar:ver<0> ~~ Foo::Bar:ver<foo>
camelia 5===SORRY!5=== Error while compiling <tmp>
Expected a term, but found either infix ~~ or redundant prefix ~
(to suppress this message, please use a space like ~ ~)
at <tmp>:1
------> 3say Foo::Bar:ver<0> ~~7⏏5 Foo::Bar:ver<foo>
rir guifa: Got it. That is in the docs as a 'Ordinary Identifier'. I got a wee bit out of the grammar. I go now to try to grow more. 16:01
guifa Might take a look a bit at the Grammar.pm6 in the Rakudo source. Everything is there except for the definition of <ident>, which is basically what I showed above 16:02
jmerelo guifa: maybe in nqp? 16:07
jmerelo plugs new Raku book! Raku recipes is out! www.apress.com/gp/book/9781484262573
guifa jmerelo: likely. I need to go back at some poitn and review all of it for binex/objex 16:12
tbrowder m: say 'Foo::Bar:ver<0>' cmp 'Foo::Bar:ver<foo>' 16:20
camelia Less
tbrowder m: say 'Foo::Bar:ver<0>' 16:21
camelia Foo::Bar:ver<0>
tbrowder m: say Foo::Bar:ver<0>
camelia Could not find symbol '&Bar:ver<0>' in 'Foo'
in block <unit> at <tmp> line 1
cpan-raku New module released to CPAN! hide-methods (0.0.1) by 03ELIZABETH 17:09
guifa Apparently Match.pos == -3 is defined as a failed match 17:10
Are there any other special Match positional values?
guifa grammar A { token a { a }; token TOP { <a> }; say &a } 17:23
m: grammar A { token a { a }; token TOP { <a> }; say &a }
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
a used at line 1
guifa I thought tokens were routines? 17:24
m: grammar A { token a { a }; token TOP { <a> }; say A.^find_method('a') } 17:25
camelia token a { a }
cpan-raku New module released to CPAN! hide-methods (0.0.2) by 03ELIZABETH
guifa Slow down lizmat, at that pace this evening we’ll be at 4.1.2 ;-) 17:26
lizmat yeah... forgot to add some pod... 17:26
I'm done with it now, for the foreseeable future 17:27
it was just some hacking around to see how for I'd get without using nqp :-)
guifa I’m doing a module right now that sounds like it will be similar 17:33
trying to make a longest/shortest alternation token 17:34
There are a few things I’d love to do to make it more powerful but might not be possible without really digging deep in the innards
[Coke] anyone using mi6 to generate releases of raku modules? 18:58
wondering if github.com/skaji/mi6/issues/113 is biting anyone else 18:59
timotimo i release json::fast with mi6 19:02
[Coke] It looks like it's using the wrong lib to run the tests. 19:16
(maybe I've got a weird setup)
timotimo you don't have a RAKULIB or so in your env? 19:27
[Coke] if I'm running something directly I put it on the command lin 19:28
*e
given that mi6 wants everything in LIB, I'd expect it to handle that itself where needed. guess not?
[Coke] updates github.com/coke/raku-unicode-mangler with more stupid stuff. 19:29
Doc_Holliwood when you move your mouse from the upper left of your screens to the lower right, do you have to move your wrist? 19:51
bending does not count as movement, i mean changing the location on the desk 19:52
lizmat stopped using a mouse because of the onset of RSI 19:54
lizmat uses a trackpad for more than 18 years now
El_Che I use a trackball home and at work 19:55
(which nowadays are the sane place) 19:56
MasterDuke no
El_Che I only use a right hand mouse for gaming 19:58
sometimes I use a mouse with my left hand 19:59
Doc_Holliwood i have a colleague who has his mouse set so that the corners of the mousepad and the corners of the screen match up
El_Che maybe with those huge apple ones
Doc_Holliwood i found that super weird, that must put so much strain on the arm
lizmat fwiw, I have acceleration and double-click speed all set to max 20:00
which means I only need a very small part of the touchpad to move the mouse all round the screen
Doc_Holliwood same
El_Che the fun of a track ball is that you can roll the ball to get fast somewhere
Doc_Holliwood can you play with a trackball? like aiming? 20:01
El_Che yes, you can, but I have a xbox controller for the computer 20:02
better than mouse :)
Doc_Holliwood heretic!
El_Che for AOE trackball is ok, but often I use a mouse there
(I literally play something every months, so no RSI risk there)
I have this one at home: :hierarchy: - "%{tier}" - "%{environment}" - common 20:03
oops
www.logitech.com/en-us/products/mi...tml?crid=7
that one :)
[Coke] misses the trackball he had in the... 90s? 20:07
El_Che I am a pretty fly for a 90s guy
:)
I think the one I use at work dates fron late that period 20:09
it's a cabled one
it even had a usb to serial-nouse-port converter
codesections I've never done anything with fancy mouses/trackballs. I did just get a new keyboard -- which I'm loving even though it means I (temporarily) can't type even half-decently
El_Che codesections: I moved from azerty to qwerty, I type funny stuff all the time 20:10
www.ebay.com/p/1301857966 <-- the one I use at work
200$ + $76 additional costs on ebay
cracy people
z
[Coke] heh. that logitech wheel looks VERY familiar. :) 20:14
El_Che [Coke]: all the cool kids had them
for some definition of cool :)
the trackman wheel is indesctructible
it still works while I already killed an Logitech M570 20:15
El_Che the double click of death 20:15
www.amazon.com/Logitech%C2%AE-Cord...B001ASC9BY 400$ 20:16
ok, there is a market of old nostalgic rich people :)