00:40
lizmat_ joined,
TempIRCLogger__ joined
00:41
RakuIRCLogger left
00:42
TempIRCLogger left,
lizmat left
00:44
TempIRCLogger__ left,
TempIRCLogger joined
03:52
frost joined
04:56
frost left
08:00
Manifest0 joined
08:08
lizmat_ left,
lizmat joined
08:51
dakkar joined
11:44
MasterDuke left
|
|||
lizmat | and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/01/17/2022-...kucon-how/ | 13:01 | |
Nemokosch | so I have sets of pairs | 13:04 | |
what exactly happens when I substitute one from the other? | |||
the first result is okay, the new includes the old one | 13:05 | ||
but then the other difference should contain 1760 elements, right? | 13:06 | ||
13:22
MasterDuke joined
13:33
[Coke] left
13:42
[Coke] joined
14:37
qorg11 left
14:40
qorg11 joined
14:56
[Coke]_ joined
14:57
[Coke] left
|
|||
Nahita | Not necessarily | 15:55 | |
m:``` | |||
my @old = 12.comb; | |||
my @new = 124444666666.comb; | |||
say @old (-) @new; | |||
say @new (-) @old; | |||
``` | |||
m: ``` | 15:56 | ||
my @old = 12.comb; | |||
my @new = 124444666666.comb; | |||
say @old (-) @new; | |||
say @new (-) @old; | |||
``` | |||
Nemokosch | I mean... okay, this wasn't the case | ||
I can tell you it wasn't all duplicates but one pair | |||
Nahita | Then we need an MRE! | ||
m:``` | 16:08 | ||
my @old = 12.comb; | |||
my @new = 124444666666.comb; | |||
say @old (-) @new; | |||
say @new (-) @old; | |||
``` | |||
(for completeness nothing else :)) | |||
17:14
[Coke] joined
17:15
[Coke]_ left
|
|||
Nemokosch | m: say (2-1*sqrt 5)**(1/3) | 17:20 | |
why is that? | |||
m: say (2-1*sqrt 5) | 17:21 | ||
m: say -0.2360679774997898**(1/3) | |||
why don't I get this number but NaN instead? | |||
I mean, okay, I get that the unary minus actually has lower precedence | 17:35 | ||
m: say (-0.2360679774997898)**(1/3) | |||
but this doesn't seem okay at all | |||
17:39
dakkar left
|
|||
Nahita | Seems to have adopted the first point here <math.stackexchange.com/a/317546>. Like C, Java, Perl and JS but not Python. | 18:49 | |
Nemokosch | it seems to me the best built-in way is using sign and abs | 19:02 | |
stevied | I got some busted links on: raku.land/zef:sdondley/Karabiner::...dGenerator | 19:22 | |
I filed a report on raku.land repo for the broken USAGE links. not sure if that's the right place | |||
this is also showing up on the page: ` [Configuration File](#Configuration File) ` | |||
in my original pod, I have this: `L<Configuration File|#Configuration File>` | 19:23 | ||
am I doing anything wrong there? | |||
20:58
aitron joined
21:49
aitron left,
aitron joined
22:05
[Coke]_ joined
22:07
[Coke] left
|
|||
tailgate | is there a way to get a default value from a hash if a key isn't there, or is this the best way? | 22:26 | |
if %capitals{'Europe'}:exists { return %capitals{'Europe'} ;} else {return "";} | |||
stevied | `%d{'x}:exists || ''; | 22:27 | |
tailgate | thanks! | 22:28 | |
stevied | `%d{'x}.exists || ''; | ||
no need for "return" if it's the last line in the function | |||
`%d{'x'}.exists || ''; | |||
oh, wait, sorry | 22:29 | ||
`%d{'x'}.exists ?? %d{'x'} !! '';` | 22:30 | ||
hold on, I'm new at this, too | 22:32 | ||
lakmatiol | You could do `%d{'x'}//''` | ||
stevied | `%d{'x'}:exists ?? %d{'x'} !! '';` | ||
but doesn't that check if the value is True? | 22:34 | ||
or defined, I mean | |||
Nemokosch | defined | 22:43 | |
isn't that exactly the wanted behavior? | |||
also, if you want, you can define a default value for hashes, I believe | 22:45 | ||
m: my %capitals is default(''); dd %capitals{'Europe'}; | |||
😎 | |||
tailgate | thanks! | 22:49 | |
stevied | can I key exist with an undefined value, though? | 22:51 | |
can a key exist with an undefined value, though? | |||
Nemokosch | what does that mean? | 22:53 | |
stevied | it seems `%d{'x'}//''` will test if the value is defined. he wants to test if the key exists | ||
Nemokosch | I don't think there is a conceptual difference | ||
I mean... why would you assign not definite values to something? | 22:57 | ||
23:28
[Coke]_ left
23:31
jaguart joined,
[Coke] joined
|
|||
jaguart | Hello, old Perlie, Raku absolute beginner, trying to get @INC path and class/file naming. Have class A::B::C in ./A/B/lib/C.rakumod and that isa A::D::C which is in ./A/D/lib/C.rakumod but can't seem to get raku to tie it together. | 23:38 | |
gfldex | @Nemokosch#9980 I wrote a script that tried to find methods that where missing in the docs. To do so, I had to query methods on the build in types. Those happen to be type object, and as such quite undefined. As soon as you do meta-programming you will find ample reason to store undefined values in Hashes and otherwise. | 23:49 | |
Nemokosch | That doesn't seem like intended usage to me, although it works | 23:51 | |
gfldex | The MOP is very intentional. | ||
Nemokosch | what is MOP? | 23:52 | |
[Coke] | meta object protocol | ||
jaguart: You need to specify -I. to specifically look starting in the local dir. | 23:53 | ||
gfldex | meta object protocol | ||
Nemokosch | btw I can vaguely recall that defined values of a type do have everything that the default value i.e the type object could provide | ||
[Coke] | you can also use RAKULIB | ||
jaguart | I already have the /lib/ folders in my use-lib pragma | ||
[Coke] | (first is command line arg, second is an env var.) | ||
jaguart: ok, but you never mentioned lib in your example. | |||
if it's still not working, can you show me your use lib, your use of the module, and the path to the module? | 23:54 | ||
er. | |||
you did mention lib but it's buried near the bottom? | 23:55 | ||
if you have ./A/B/C.rakumod, you "use A::B::C" and you specify a lib dir of . | |||
you don't use lib near the end of the path. | |||
jaguart | ok - let me fix that and retry | 23:56 | |
[Coke] | When I read your example at first, I literally tuned out after A/B, sorry . :) | ||
gfldex | @Nemokosch#9980 Note quite. Here is a practical example: gfldex.wordpress.com/2021/08/17/most-fancy/ | 23:57 | |
jaguart | removing /lib and raku doesnt find the first A::B::C | 23:58 | |
[Coke] | please share your use statement, path to the module, fully qualified name of the module in the file, and your -I/use lib/RAKULIB | 23:59 | |
Nemokosch | well, I don't see the contradiction | ||
[Coke] | (and the error message) | ||
gfldex | To be fair, undefinedness is a fairly large field in Raku. Where other languages need a paragraph in a book, we need a whole section. |