»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
TimToady | ZoffixLappy: obviously we're already to Step 3: Then they fight you. | 00:14 | |
ZoffixLappy | :) | 00:15 | |
Xliff | Next stop: "You Win!" | 00:16 | |
00:19
pierre_ joined
|
|||
BenGoldberg | m: for 1..2 { say $^x, $^y }; for 1..2 { say $^y, $^x }; | 00:22 | |
camelia | rakudo-moar 3cab7c: OUTPUT«1221» | ||
BenGoldberg | While having placeholder arguments sorted alphabetically makes intuitive sense, istr them being documented as being used in order of appearance... that is, both of the above two ought to produce the same output. | 00:25 | |
ZoffixLappy | If they're documented that way, it's an error that should be fixed. Perhaps, you're confusing regex captures? | 00:29 | |
m: 'foobar' ~~ /(foo(bar))/; say $0; say $1 | |||
camelia | rakudo-moar 3cab7c: OUTPUT«「foobar」 0 => 「bar」Nil» | ||
ZoffixLappy | :/ not the output I expected.... | ||
m: 'foobar' ~~ /(foo) (bar)/; say $0; say $1 | 00:30 | ||
camelia | rakudo-moar 3cab7c: OUTPUT«「foo」「bar」» | ||
ZoffixLappy | Interesting... | ||
BenGoldberg | en.wikibooks.org/wiki/Perl_6_Progr..._Arguments | 00:31 | |
m: dd 'foobar' ~~ /(foo(bar))/; | 00:32 | ||
camelia | rakudo-moar 3cab7c: OUTPUT«Match.new(ast => Any, list => (Match.new(ast => Any, list => (Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foobar", to => 6, from => 3),), hash => Map.new(()), orig => "foobar", to => 6, from => 0),), hash => Map.new(()), orig => "foobar…» | ||
ZoffixLappy | Fixed. Thanks. | 00:34 | |
00:34
wamba left
00:36
Ben_Goldberg joined,
BenGoldberg left,
Ben_Goldberg is now known as BenGoldberg
|
|||
ugexe | is there a way to get around another subroutine calling `exit()` other than &*EXIT? | 00:39 | |
&exit.wrap({ return; }); still exits | |||
ZoffixLappy | m: sub foo {exit}; &exit.wrap({ ; }); foo; say "Meow" | 00:43 | |
camelia | rakudo-moar 3cab7c: OUTPUT«Meow» | ||
ZoffixLappy | Seems to work? | ||
00:58
Actualeyes joined
01:03
tardisx left
01:09
ZoffixWin_ joined,
ZoffixWin_ left,
ZoffixWin_ joined
01:11
tardisx joined
01:22
Herby_ joined
|
|||
Herby_ | Evening, everyone! | 01:22 | |
o/ | |||
hotel | \o | ||
ZoffixLappy | \o | 01:26 | |
Herby_ | o/ | ||
01:26
molaf joined
|
|||
Herby_ | ZoffixLappy: you're a blogging machine! | 01:27 | |
I'm learning quite a bit reading through them, hope you keep it up :) | |||
hotel | oh that's a good idea | ||
make a blogging machine in p6 | |||
Herby_ | when in doubt, blog it out | ||
hotel | someone made a shitpost generator in java for tumblr | 01:28 | |
ZoffixLappy | Herby_, thanks. I'm doing it for quite selfish reasons of trying to learn the stuff myself :) This morning, I still had no solid idea of how to use the S/// operator and now I do :) | ||
Herby_ | hotel: I just looked it up, here's the tagline for it: "I am a JAVA program who's purpose is to churn out the worst posts imaginable" | 01:33 | |
thats great | |||
hotel | yep | ||
Herby_ | and the 5th post on that page: "I am the zodiac" | 01:35 | |
ZoffixLappy | heh | 01:36 | |
hotel | so like I said, why not make one in p6? :P | ||
maybe that'll be my first project | |||
Herby_ | blog about the blog project. i'd read it | ||
i don't have the chops for that yet | |||
hotel | I don't have any chops yet, still can't get rakudo to build right | 01:37 | |
though that's mostly my fault | 01:38 | ||
>shiny tools have shiny problems< | 01:40 | ||
dalek | osystem: fcf6c5e | (Andy Weidenbaum)++ | META.list: Add module TXN::Parser |
01:45 | |
osystem: b119fb8 | (Zoffix Znet)++ | META.list: Merge pull request #201 from atweiden/txn-parser Add module TXN::Parser: github.com/atweiden/txn-parser |
|||
01:48
pierre_ left
01:55
colomon joined
01:56
AlexDaniel joined
01:57
pierre_ joined
|
|||
AlexDaniel | this is so awesome essenmitsosse.de/pixel/?showcase=tr...mp;slide=4 | 02:02 | |
reminds me of perl a bit :) | |||
m: use MONKEY-TYPING; augment class Int { method foo { say self } }; int.foo | 02:05 | ||
camelia | rakudo-moar 3cab7c: OUTPUT«(int)» | ||
ZoffixLappy | AlexDaniel, heh... I hope it's not this part that reminds you of Perl: i.imgur.com/jp9yT6v.jpg | 02:10 | |
:) | |||
Pretty cool though... Other than the crash.... | 02:11 | ||
AlexDaniel | ZoffixLappy: no, it does not remind me that your browser is broken :)1 | 02:12 | |
ZoffixLappy | lol | ||
02:14
Herby_ left
02:15
winger_ joined
02:18
kid51 left
02:24
noganex joined
02:29
pierre_ left
02:33
hotel_california joined
|
|||
dalek | c: 7ad327f | (Zoffix Znet)++ | doc/Language/operators.pod: Fix heading levels |
02:35 | |
02:47
winger__ joined
02:48
pierre_ joined
02:51
winger_ left,
pierre_ left
02:52
pierre_ joined
02:57
pierre_ left
02:58
pierre_ joined,
colomon left
03:05
colomon joined
03:07
colomon left
03:19
hotel_california is now known as hotel
03:29
vendethiel joined
03:41
Amnez777 joined
03:44
Actualeyes left
03:45
colomon joined,
Amnez777- joined
03:47
Amnez777 left
03:50
BenGoldberg left
04:17
pierre_ left
04:19
pierre_ joined
04:22
pierre_ left
04:23
pierre_ joined
04:28
Amnez777- left,
Cabanossi joined
04:29
Actualeyes joined
04:31
pierre_ left
04:33
Amnez777 joined
04:34
vendethiel left
04:35
Timbus joined
04:36
pierre_ joined
04:37
pierre_ left
|
|||
MadcapJake | m: PROCESS::<&EXIT> = -> $_ { Nil }; exit | 04:39 | |
camelia | ( no output ) | ||
MadcapJake | ugexe: ^^ | ||
04:40
hotel is now known as hotel|netteiru
|
|||
jdv79 | ZoffixWin_: are you an educator or well versed presenter? | 04:40 | |
nice posts lately. | 04:41 | ||
04:41
Actualeyes left
04:55
Actualeyes joined
05:03
vendethiel joined
05:16
zhmylove joined
05:21
al2o3-cr joined
05:22
rurban joined
05:24
vendethiel left,
jjido joined
05:26
zhmylove left
05:28
m0ltar left
05:29
zhmylove joined
05:30
m0ltar joined
05:37
pierre_ joined
05:40
chienjo joined
05:42
chienjo left
05:43
pierre_ left
05:44
aries_liuxueyang joined
05:45
domidumont joined,
domidumont left
05:46
domidumont joined
05:50
domidumont left
05:51
domidumont joined,
jjido left
05:52
finanalyst joined
|
|||
finanalyst | hi. Is there any good way to test code containing 'warn'? | 05:52 | |
yoleaux | 22 Feb 2016 20:37Z <ab6tract> finanalyst: your 'Intro to Sixy Perl' pastebin is awesome! you should consider publishing it somewhere more permanent! | ||
finanalyst | i wrote to perl-users, but thought I would ask here too. | 05:54 | |
05:56
finanalyst left,
finanalyst joined
05:57
CIAvash joined
05:58
cognominal left
05:59
sno joined
06:01
finanalyst left
06:02
_mg_ joined
06:05
finanalyst joined
06:07
domidumont left
06:10
zhmylove left
06:13
zhmylove joined
06:20
hotel joined
06:21
hotel|netteiru left
06:24
firstdayonthejob joined
06:25
domidumont joined
06:26
zhmylove left
06:30
zhmylove joined
06:31
CIAvash left
06:34
CIAvash joined,
hotel_california joined
|
|||
TimToady | finanalyst: warn throws a control exception that can be caught with a CONTROL block | 06:35 | |
06:35
hotel left
|
|||
finanalyst | TimToady: that I understand. But it is how to do this in a test snippet that I'm not sure about. Where does the CATCH block go | 06:36 | |
it would seem intuitive to me that there is a 'warns-ok' routine in TEST | 06:37 | ||
06:38
jjido joined,
firstdayonthejob left
06:43
jjido left
06:44
pierre_ joined,
jjido joined
06:45
rurban left,
zhmylove left
|
|||
masak | mornin', #perl6 | 06:47 | |
06:48
zhmylove joined
06:49
jjido left
06:52
RabidGravy joined
|
|||
moritz | \o masak, * | 06:53 | |
RabidGravy | oink! | 06:57 | |
_nadim | Morning all | 06:58 | |
07:02
jamesnek1 joined
07:04
cschwenz joined
|
|||
cschwenz | \o #perl6 :-) | 07:04 | |
07:08
sue joined
07:10
abraxxa joined
|
|||
cschwenz | in perl6, how do i get the computer to do nothing for 0.012 seconds? (i need to translate some perl5 code which has "select( undef, undef, undef, 0.012 );") | 07:13 | |
moritz | cschwenz: sleep 0.012 | 07:14 | |
07:15
zhmylove left
|
|||
moritz | I hope you're not worried that it only applies to the current thread, not the whole computer :-) | 07:15 | |
cschwenz | \o/ perl6 has a sane sleep ! | ||
moritz: i'm very okay with it only applying to the current thread :-) | 07:16 | ||
moritz | m: sleep 0.012; say now - INIT now | ||
camelia | rakudo-moar 3cab7c: OUTPUT«0.013980» | ||
RabidGravy | or if you actually want to do something something in the future but could usefully be doing something in the meantime, see Promise.in($secs) | 07:17 | |
07:18
boegel joined
|
|||
_nadim | Do we have a module that given something that looks like a command line would parse it? The format of the command line itself is not known (user defined) | 07:19 | |
cschwenz | isn't there a port of Getopt::Long? | ||
RabidGravy | I think so | 07:20 | |
_nadim | There is, completely undocumented but i wrote "format of options are unknown" | ||
RabidGravy | modules.perl6.org/#q=getopt | ||
07:21
tardisx left
|
|||
_nadim | I did that, Getopt:::Long is not documented, Getopt::Tiny makes the same mistake as P5 and the doc is, well, fuzzy, Getopt::Type doesn't fit the work. | 07:21 | |
I smell a Getopt::Whatever module coming | 07:22 | ||
RabidGravy | yes I think you need to read some code | ||
and/or help make one of the existing modules do what you want | 07:23 | ||
07:23
zhmylove joined
|
|||
_nadim | I read the codes, and if there is nothing available, Getopt::Whatever will come, but it would be a pitty to no use what already exists. | 07:23 | |
RabidGravy | on the face of it, it doesn't seem that difficult | 07:24 | |
07:24
tardisx joined
|
|||
_nadim | No, a grammar and some actions. And not even that is necessary. | 07:25 | |
but I want to finish what I am doing not start another module in the middle of it. | 07:27 | ||
RabidGravy | life sucks like that | ||
07:27
_28_ria joined
|
|||
_nadim | specially when the thing one is doing is a template to make starting new modules easier ;) | 07:29 | |
07:33
domidumont left
07:34
telex joined
07:36
domidumont joined
07:39
hotel joined
07:40
hotel_california left
07:42
daniel-s joined,
aries_liuxueyang left,
leont joined
07:43
ufobat joined
|
|||
ufobat | god morning! | 07:43 | |
RabidGravy | erp | ||
07:44
zhmylove left,
jjido joined
07:49
tardisx left,
jjido left,
al2o3-cr left
07:52
darutoko joined,
zhmylove joined
07:53
dolmen joined
07:55
zakharyas joined
07:56
sue left,
maybekoo2 joined
07:57
zhmylove left,
aries_liuxueyang joined
08:10
Amnez777 left,
nebuchadnezzar joined,
Amnez777 joined
08:12
g4 joined
08:15
ZoffixWin_ left
08:20
al2o3-cr joined
08:25
al2o3-cr left
08:26
dolmen left
08:27
CIAvash left
|
|||
dalek | osystem: 515bf6e | RabidGravy++ | META.list: Add App::ModuleSnap See github.com/jonathanstowe/App-ModuleSnap |
08:29 | |
RabidGravy | Xliff, ^ | ||
08:31
wamba joined
|
|||
RabidGravy | thus ensuring that the next one is my fiftieth | 08:31 | |
Any objections if I alter the doc.perl6.org/language/modules#Dist...ng_Modules to have META6.json rather than META.info? | 08:33 | ||
reason being that the future PAUSE thingy requires that afaiu | 08:34 | ||
also do both zef and panda support the specced "source" now? | 08:36 | ||
08:39
leont left
08:43
Cabanossi left,
ufobat left
|
|||
_nadim | jnthn: App-ModuleSnap++ | 08:44 | |
jnthn | ...what? :) | 08:45 | |
08:46
jjido joined
|
|||
_nadim | hehe, the other jonathan :) | 08:47 | |
08:50
Cabanossi joined,
jjido left
08:52
rindolf joined
09:04
tardisx joined
09:06
tardisx left
|
|||
RabidGravy | easy mistake to make, he's the one with the beard | 09:13 | |
but jnthn++ just because | |||
_nadim | RabidGravy++ (now I know who you are ;) ) | 09:20 | |
09:24
zhmylove joined
|
|||
RabidGravy | :-O | 09:25 | |
stmuk_, you about? | 09:26 | ||
09:26
domidumont left
|
|||
cschwenz | so, from doc.perl6.org/language/operators#Op...Precedence , what do "~&", "~<", and "~>" do? (the only mention of them i can find is in the linked operator precedence table) | 09:27 | |
psch | cschwenz: bit-wise and, bitshift left, bitshift right, in order | ||
oh no | |||
Str-wise, not bit-wise | |||
i don't know if the semantics are actually clear | |||
hm, char wise maybe, actually? | 09:28 | ||
moritz | they make sense on buffers | ||
but on Grapheme clusters? | |||
psch | m: say "foo" ~& "fou" | ||
camelia | rakudo-moar 6cb231: OUTPUT«foe» | ||
psch | m: say "foò" ~& "fou" | ||
camelia | rakudo-moar 6cb231: OUTPUT«fop» | ||
psch | .u snowman | ||
yoleaux | U+2603 SNOWMAN [So] (☃) | ||
psch | .u rocket | ||
yoleaux | U+1F680 ROCKET [So] (🚀) | ||
psch | m: say "🚀" +& "🚀" | 09:29 | |
camelia | rakudo-moar 6cb231: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5🚀' (indicated by ⏏) in block <unit> at /tmp/R2_bby_Znw line 1Actually thrown at: in block <unit> at /tmp/R2_bby_Znw line 1» | ||
psch | m: say "🚀" ~& "🚀" | ||
camelia | rakudo-moar 6cb231: OUTPUT«🚀» | ||
psch | oh ffs :) | ||
m: say "🚀" ~& "☃" | |||
camelia | rakudo-moar 6cb231: OUTPUT«☀» | ||
cschwenz | :-D | ||
so they would appear to work on NFG characters? | 09:30 | ||
moritz | they appear to work, yes | 09:31 | |
psch | m: say ("🚀".ord +& "☃".ord).chr # looks equivalent from here | ||
camelia | rakudo-moar 6cb231: OUTPUT«☀» | ||
RabidGravy | yeah, bitwise is +< etc | 09:32 | |
m: say 2 +< 2 | |||
camelia | rakudo-moar 6cb231: OUTPUT«8» | ||
jnthn | It works at codepoint level, iirc | ||
So it operates on each codepoint in an NFG synthetic | |||
Which means you may or may not get another synthetic out :) | |||
cschwenz | jnthn++ | ||
psch | .u combining | ||
yoleaux | U+0300 COMBINING GRAVE ACCENT [Mn] (◌̀) | ||
U+0301 COMBINING ACUTE ACCENT [Mn] (◌́) | |||
U+0302 COMBINING CIRCUMFLEX ACCENT [Mn] (◌̂) | |||
cschwenz | that is what i was trying to ask about | ||
psch | m: say "🚀\c[COMBINING GRAVE ACCENT]" ~& "☃" | 09:33 | |
camelia | rakudo-moar 6cb231: OUTPUT«☂» | ||
jnthn | Whether it's useful for anything outside of ASCII cute tricks is another matter :) | ||
oh interesting.... | 09:35 | ||
I'm not sure it actually is doing what I thought it would be | |||
github.com/MoarVM/MoarVM/blob/mast...ps.c#L1373 | |||
moritz | well, there is a use case for string bitwise ops | ||
for example if you want to to find borders in a text table | |||
you can start with chr(255) x 80, and ~& every line | 09:36 | ||
and see what columns remain in the end | |||
if your data is large enough, only separate columns have non-zero bytes in the end | |||
09:37
domidumont joined
|
|||
jnthn | Cute :) | 09:37 | |
09:37
zhmylove left
|
|||
moritz | (or if you know the separator character in advance, you can see the string with that instead of the chr(255), and see which columsn remain the same) | 09:38 | |
jnthn: that's signed integer arithmetic in MVM_string_bitand, right? | 09:40 | ||
09:41
zhmylove joined
|
|||
moritz | can this create the number of a not-yet-created grapheme cluster? | 09:41 | |
jnthn | moritz: Yeah, that's what I fear might happen | 09:42 | |
It's not clear why it works this way | |||
moritz | m: say "नि" & "5" | ||
camelia | rakudo-moar 6cb231: OUTPUT«all(नि, 5)» | ||
moritz | m: say "नि" ~& "5" | ||
camelia | rakudo-moar 6cb231: OUTPUT«4» | ||
moritz | m: say "नि" ~& "\r\n" | ||
camelia | rakudo-moar 6cb231: OUTPUT«नि» | ||
RabidGravy | can anyone else remember what the github alternative thingy that stmuk_ is using is? | 09:43 | |
some GitFoo | |||
moritz | RabidGravy: bitbucket? gitlab? | ||
RabidGravy | gitlab | ||
cheers, just changing the wording of the modules.pod to make it clear that github is per example rather than an absolute requirement | 09:44 | ||
moritz | m: say "नि" ~> 1 | ||
camelia | rakudo-moar 6cb231: OUTPUT«infix:«~>» not yet implemented. Sorry.  in block <unit> at /tmp/3CjJH3GbMW line 1» | ||
moritz | m: say "नि" ~< 1 | 09:45 | |
camelia | rakudo-moar 6cb231: OUTPUT«infix:«~<» not yet implemented. Sorry.  in block <unit> at /tmp/rBvD9tOSOA line 1» | ||
moritz not sorry at all | |||
09:46
jjido_ joined
09:50
nowan_ joined
09:51
jjido_ left
|
|||
stmuk_ | RabidGravy: gitlab | 09:54 | |
RabidGravy | and that works fine for modules doesn't it (before I commit this) | ||
stmuk_ | it pretty much resembles github and you can login with gh creds | 09:55 | |
RabidGravy | cool | ||
stmuk_ | yes some features aren't visible on modules.perl6.org butapart from that that works fine | ||
09:56
domidumont left
|
|||
RabidGravy | excellent | 09:57 | |
is it worth explaining *why* you probably want to use META6.json rather META.info in the modules doc? I'm torn | 09:58 | ||
stmuk_ | colour syntax in vim | ||
RabidGravy | :) | ||
I think I'll leave it, not much point describing forward compatibility when it's not quite clear what the end state will be | 10:00 | ||
10:01
zhmylove left
10:04
zhmylove joined
10:05
domidumont joined
|
|||
dalek | c: 28989a3 | RabidGravy++ | doc/Language/modules.pod: A few small changes: * prefer META6.json to META.info * more explanation on 'provides' * make it clear that other repos than github may work |
10:06 | |
10:08
Actualeyes left
|
|||
RabidGravy | what next? | 10:17 | |
psch | full SysEx support for Audio::PortMIDI? :P | 10:19 | |
10:19
maybekoo2 left
|
|||
RabidGravy | I thought you were sending me a patch for that ;-p | 10:19 | |
psch | yeah, i might eventually :) | 10:20 | |
RabidGravy | lots of things that I could fix up in my existing modules, also some 5 to 10 modules that I haven't finished yet | ||
cschwenz | error message feature request: when perl6 cannot find a matching signature, perl6 prints all of the signatures it found for a multi-method; will we please add the signature it was trying to find? | 10:21 | |
RabidGravy | it does doesn't it? | ||
psch | m: multi f($) { }; multi f($, $) { }; f 1, 2, 3 | ||
camelia | rakudo-moar 6cb231: OUTPUT«5===SORRY!5=== Error while compiling /tmp/qtM5TzAf4ICalling f(Int, Int, Int) will never work with any of these multi signatures: ($)  ($,)at /tmp/qtM5TzAf4I:1------> 3multi f($) { }; multi f($, $) { }; 7⏏5f 1, 2, 3» | ||
RabidGravy | yeah | ||
psch | cschwenz: it does. at the very beginning :) | ||
ah, we still have a bug with disappearing anon positionals there :/ | 10:22 | ||
RabidGravy | it's different for multi methods | ||
psch | m: say :($, $).perl | ||
camelia | rakudo-moar 6cb231: OUTPUT«:($, $)» | ||
psch | m: say :($, $).gist | ||
camelia | rakudo-moar 6cb231: OUTPUT«($,)» | ||
RabidGravy | eugh | ||
cschwenz | so, i am seeing "Cannot call AUTOGEN( […] ); non of these signatures match: […]" are you saying the "[…] AUTOGEN( […] ) […]" is the signature it was trying to find? | 10:23 | |
RabidGravy | ah that old AUTOGEN thingy | ||
cschwenz | do i need to update/upgrade perl6? | ||
psch doesn't know about any AUTOGEN thingies | |||
RabidGravy | if you add "proto method <name> (|c) { * }" you will get the right name | 10:24 | |
psch, under some circumstances it doesn't create the proto name right so it just leaves it as "AUTOGEN" | 10:25 | ||
I've never figured out quite what those circumstances are sufficiently to RT IT | |||
psch | o.o | ||
that sounds a bit bad | |||
cschwenz: can you golf the code that gives you that error? | 10:26 | ||
in case it stays around when golfed this might be an angle to try and figure out what's actually happening | 10:27 | ||
cschwenz | psch: probably | ||
10:27
Actualeyes joined
|
|||
RabidGravy | it's something in the area of more than one multi with a certain number of candidates | 10:28 | |
cschwenz | so, with that solved, next question… if i have multi-methods which take a single positional value, and said value has a default, why does "$obj.foo()" not do what i mean and use the default? (instead it complains about not finding a signature match) | 10:29 | |
psch | m: class A { multi method f($ = "foo") { say "ok" }; }; A.f | ||
camelia | rakudo-moar 6cb231: OUTPUT«ok» | ||
psch | there most be more to that issue :) | 10:30 | |
RabidGravy | I think I've encountered that one before too, can't remember the circumstances | ||
10:30
zhmylove left
|
|||
RabidGravy | but yeah a golfed example of that one would be good | 10:31 | |
cschwenz | p6: class Foo { multi method bar( Int $baz = 1 ) { say "Int $baz"; }; multi method bar( Rat $baz = Rat.new(1, 1) ) { say "Rat $baz"; }; }; my $obj = Foo.new(); $obj.bar(); | 10:32 | |
camelia | rakudo-moar 6cb231: OUTPUT«Ambiguous call to 'bar'; these signatures all match::(Foo $: Int $baz = 1, *%_):(Foo $: Rat $baz = { ... }, *%_) in block <unit> at /tmp/tmpfile line 1» | ||
psch | oh, that's easy. two candidates with one parameter with default are two candidates with 0 parameters | ||
cschwenz | hmm, that error message is different than the one i'm seeing | ||
psch | cschwenz: maybe you do have to upgrade your rakudo :) | ||
cschwenz | psch++ | 10:33 | |
10:33
zhmylove joined
|
|||
psch | cschwenz: if it sticks around you might simply have golfed too much, too | 10:33 | |
...although i'm at a loss to guess what else could cause what you're describing | 10:34 | ||
10:39
cdg joined
10:43
cdg left
10:44
daniel-s left
10:47
robertle joined,
jjido_ joined,
tbrowder joined
|
|||
tbrowder | need help with env var PERL6LIB: rakudo (nom) seems not to recognize the colon path separator | 10:49 | |
...I set "export PERL6LIB=path1" and rakudo finds my module; I set "export PERL6LIB=path1:path2" and the module is not found; am I doing something stupid? | 10:50 | ||
10:50
daniel-s joined
|
|||
psch | tbrowder: PERL6LIB expects specs seperated by comma | 10:51 | |
a spec doesn't have to be a path, either | |||
which is why we don't use colon as a separator i guess, as it could be needed for a protocol | |||
like url#git://github.com/someone/something.git | 10:52 | ||
10:52
jjido_ left,
daniel-s left
10:53
daniel-s joined,
zhmylove left,
Actualeyes left
10:54
Actualeyes joined
|
|||
tbrowder | psch: oh! thanks, that works! next question then: how do I get the rakudo to search the paths in another rakudo install where the resources are specified differently? | 10:54 | |
psch | i don't understand the question. you want one rakudo executable to include the (sha1'd) module sources from another? | 10:55 | |
10:56
zhmylove joined
|
|||
tbrowder | psch: yes, or else tell me how to install them into the new rakudo build | 10:56 | |
psch | tbrowder: RabidGravy++ recently published a module for exactly that | 10:57 | |
RabidGravy | :) | ||
robertle | I have problems with understanding the very basics of modules as well: to get started I create a single module with a single sub with "is export" in it. I can use that module, and call the sub. great. but I am very confused about the namespacing: I seem to be only able to access exported stuff (which is ok), and the export puts it in the namespace of the loader. so the actual namespace of the sub does not | ||
10:57
_28_ria left
|
|||
robertle | matter anymore. interestingly the "unit module xyz" at the top of my module does not need to match the path of it (also ok), so effectively the namespace does not matter at all! that can't be right, there must be more to it... | 10:57 | |
am I right in assuming that the "use" looks up by filename/path, so that does not have to match the namespace? | 10:58 | ||
RabidGravy | robertle, subs are "my" scoped by default, they aren't in a "namespace", if you want to refer to them with a full package name, qualify them with "our" | ||
10:58
Actualeyes left
|
|||
psch | tbrowder: App::ModuleSnap, fyi | 10:59 | |
10:59
daniel-s left
|
|||
RabidGravy | but yes, the default behaviour of the repos is to derive the path from the module name supplied to "use" or "require" | 10:59 | |
of course a CompUnit::Repository could be made that does something else | 11:00 | ||
robertle | RabidGravy: right, so if I "need" then the contents of the file in question get loaded. if that's "our" then I can access it by namespace, if it is "my" then it's private to the namespace and inaccessible. if I use "use" instead, the loaded bits also are made availabel in the loading namespace, so no need to prefix anymore. that abut right? | 11:01 | |
RabidGravy | for installed modules it is different again, as the name of the module isn't directly reflected in the installed module name | ||
robertle, not quite | |||
tbrowder | psch: so how will App::ModuleSnap help me if I can't get it installed for the new rakudo? | 11:02 | |
robertle | RabidGravy: right, the file vs namespace is a bit academic because you want them to match up anyway, everythign else is just plain confusing | ||
psch | tbrowder: i have no idea how it works, but i'd assume you install it for the old rakudo that already has the modules you need | ||
11:02
Actualeyes joined
|
|||
RabidGravy | yes | 11:02 | |
psch | tbrowder: RabidGravy probably appreciates any feedback re documentation or functionality :) | ||
11:02
finanalyst left
|
|||
RabidGravy | it basically traverses the $*REPO.rep-chain, finding all the Distributions which aren't something it made or "CORE" and then writes out a META6.json with all those as dependencies | 11:03 | |
so in your other perl6 you do "panda install ." and voila | |||
tbrowder | psch: ah! okay, I'll give it a shot | 11:04 | |
I have to go now but will try it and report back--thanks!! | |||
11:04
tbrowder left
|
|||
RabidGravy | because I seem to install a lot of modules for testing purposes I find myself with the need to completely eradicate everything once in a while and reinstall the modules | 11:05 | |
I've just discovered that "Flash Magic Eraser" is perfect for cleaning the white rubber parts of Converse All Stars, almost box fresh looking ;-) | 11:08 | ||
11:09
kid51 joined
|
|||
RabidGravy | is there something other than github "organizations" that people use for organising e.g. a "special interest group"? I'm thinking of starting a "Perl6 Audio" thingy | 11:11 | |
psch | haha | 11:12 | |
DrForr | SIGAUD, ISAGN. | ||
psch | special interest group made me laugh :) | ||
RabidGravy | :) | ||
psch | i don't think they have anything like that on github though | ||
i'd totally join an org for that though, even if it might be somewhat inappropriate as an org on github vOv | 11:13 | ||
11:13
ufobat joined
|
|||
RabidGravy | well an "organisation" gives you all the github stuff, wiki, issues and a github.io site but yeah it's not so much about the code as collecting and promoting the stuff | 11:14 | |
ufobat | ola! :D just in case someone cares! my notebook is alive again | ||
RabidGravy | and of course becoming an evil and secretive cabal | ||
psch | right, but a github-page would be a good start for promoting i think | ||
11:15
wamba left
|
|||
RabidGravy | so yeah, create a github organisation and create the page | 11:15 | |
psch | i mean, unless you have an appropriate domain lying around... :) | ||
11:16
wamba joined
|
|||
RabidGravy | jeezus-knievel.com? | 11:16 | |
perlmonkeys.org? plastic-fernandez.com, its-going-to-be-fabulous.com all unused but not really suitable ;-) | 11:17 | ||
goatponi.es | |||
psch | its-going-to-be-fabulous.com is pretty close though | ||
robertle | RabidGravy: let me try again for "our" and "need" only. "our" stuff gets put in a namespace according to the enclosing "module". "need" loads a unit and therefore makes the namespaces within and what is "our" in them available. "my" stuff from the loaded unit is unavailable because it is lexically scoped, and the unit is the lexical scope. right? | 11:18 | |
RabidGravy | yes, but "need" is a red herring here, | ||
however you load it if the sub in a module isn't our scoped you can't access it at all outside the module | 11:19 | ||
robertle | RabidGravy: right, I said "need" only because "use" does something on top of it. let's check my "use" and "is export" understanding: "is export" or the more elaborate versions thereof takes whatever we are talking about and places it in a special namespace of the module. if you "use" a unit, everything from that special namespace makes it available in the loader. about right? if so: does use put into the t | 11:22 | |
RabidGravy | m: module Foo { sub bar() { say "bar" }; our sub baz() { say "baz" };}; Foo::baz(); Foo::bar(); | ||
camelia | rakudo-moar 6cb231: OUTPUT«bazCould not find symbol '&bar' in block <unit> at /tmp/JljyT__jh2 line 1Actually thrown at: in block <unit> at /tmp/JljyT__jh2 line 1» | ||
robertle | arget namespace or the target lexical scope? | ||
psch | "use" puts the used module into the current lexical scope, and imports all exported symbols into the current lexical scope | 11:24 | |
robertle | RabidGravy: understood that part, but that's because bar() isn't part of the Foo namespace, just part of the lexical scope that happens to be created by the module/namespace block. rigt? | ||
psch | well, after (potentially compiling and) loading the source file | ||
RabidGravy | yes | 11:25 | |
11:25
zhmylove left
|
|||
RabidGravy | subroutines are lexically scoped by default | 11:25 | |
11:26
pmurias joined
|
|||
psch | m: say MY::.keys | 11:26 | |
camelia | rakudo-moar 6cb231: OUTPUT«($=pod !UNIT_MARKER EXPORT $_ $! ::?PACKAGE GLOBALish $¢ $=finish $/ $?PACKAGE)» | ||
psch | and lexical scope is a namespace too /o\ | ||
robertle | ok, great! somewhat off topic, but is there a way to "use" from a different namespace and put in this *namespace* rather than this lexical scope? there is such a concept in UML, and it is thoroughly confusing and interestingly impossiblt to implement in C++ and java, which makes you wonder why it is in UML in the first place... | ||
psch | robertle: i think reexportation could cover that at least partially, but i don't know in how far that's implemented | 11:27 | |
RabidGravy | yeah, there are export tricks available | ||
robertle | psch: interesting! I don't really have any use for it, just wondering... | ||
psch | m: module Foo { use Test :EXPORT }; import Foo; | 11:28 | |
camelia | rakudo-moar 6cb231: OUTPUT«5===SORRY!5=== Error while compiling /tmp/g5NffKCkaGError while importing from 'Test': no such tag 'EXPORT'at /tmp/g5NffKCkaG:1------> 3module Foo { use Test :EXPORT 7⏏5}; import Foo;» | ||
psch | that's the speculated syntax, but yeah... | ||
RabidGravy | well at it's simplest you can define a "sub EXPORT" in your compilation unit which returns a hash that is keyed on the names you want to export with *what* as the value | 11:29 | |
and some <hand wave> other thing with the EXPORT package | 11:30 | ||
psch | m: module Foo { use Test; }; import Foo; ok 1 | 11:31 | |
camelia | rakudo-moar 6cb231: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ExKc1N3mzAUndeclared routine: ok used at line 1» | ||
psch | hm, i don't get the test case we have for that | ||
oh, we're not running it anyway :) | 11:32 | ||
github.com/perl6/roast/blob/master...e-export.t this one fyi | |||
llfourn_ | m: module Foo { use Test; BEGIN trait_mod:<is>(&ok,:export) }; import Foo; ok 1 # maybe? | ||
camelia | rakudo-moar 6cb231: OUTPUT«ok 1 - » | ||
psch | llfourn_: yeah, that i'd expect to work, but see the linked test. that's what was once thought to be the easy way to make it work | 11:33 | |
it's still in roast, but we're not running it | |||
llfourn_ | mmm | 11:34 | |
I wrote a module to do it fyi | |||
github.com/LLFourn/p6-CompUnit-Uti...-exporting | |||
11:35
wamba left
|
|||
RabidGravy | llfourn_++ # making stuff | 11:37 | |
11:37
daniel-s joined
|
|||
llfourn_ | RabidGravy++ xx 10 :) making stuff | 11:37 | |
11:39
Actualeyes left
11:44
tbrowder joined
|
|||
RabidGravy | but it's nearly may and no-one has made a mailling list manager yet | 11:44 | |
11:48
jjido_ joined
|
|||
tbrowder | psch & RabidGravy: I realize now (I think) if I want to hack on rakudo I should create my own branch and let rakudobrew manage it on my own machine. That way there shouldn't be any major problems with standard module handling. Am I right? | 11:48 | |
RabidGravy | psch, having done a cursory survey of the alternatives I'm thinking that a github organisation is easiest and makes collaboration easier and chuck a custom domain on it later | ||
psch | tbrowder: uhh, for actual hacking on rakudo itself i at most branch rakudo inside its own repo | 11:49 | |
tbrowder: and build with Configure.pl | |||
RabidGravy | tbrowder, I've always used rakudobrew for day to day stuff then what psch said for hacking on rakudo | ||
tbrowder | but the problem with that has been finding modules | ||
..installed modules | 11:50 | ||
psch | i don't think i ever needed modules to hack on the compiler | ||
i'd suggest golfing the code module code that is buggy and writing tests from that | |||
RabidGravy | yeah I see it as two different enterprises | ||
llfourn | tbrowder: I just do panda --prefix=/path/to/forked_rakudo/lib if I want to install a module on non-rakudobrew rakudo | 11:51 | |
RabidGravy | and when I really do need to do it I just use one or more -I<path to module> on checkouts of the modules | ||
couple of times fixing breakage in my own or other modules from change in rakudo I do that | 11:52 | ||
11:52
jjido_ left
11:53
pierre_ left
|
|||
RabidGravy | or bisection of said breakage | 11:53 | |
tbrowder | psch, RabidGravy, llfourn: okay, sounds good--thanks; bye | ||
11:54
tbrowder left
11:56
pierre_ joined
11:59
rurban joined,
kid51 left,
rurban left
12:00
Actualeyes joined
|
|||
literal | if I want to loop over an arrayref stored in a hash, do I always need @() ? as in: for @(%hash<foo>) -> $bar { ... } | 12:02 | |
RabidGravy | psch (or anyone else who might be interested) any thoughts on what one might call said Perl6 Audio organization? "Perl6 Audio Cabal", "Perl6 Noise Gang", "Butterflies on Acid"? | 12:03 | |
llfourn | literal: |%hash<foo> is more idiomatic imo | 12:04 | |
psch | Butterflies on Acid feels more like the first collab album published by the org tbh | ||
RabidGravy | indeed | ||
literal | llfourn: ah, of course | ||
RabidGravy | I'm going with the middle one | ||
psch | i do like Perl 6 Noise Gang yeah | ||
note the space though | |||
the synopses even said it has to be an unbreaking one | |||
12:04
rba_ joined
|
|||
psch | ...i put that in a comment in a nqp-j java file once and then the build stopped working :P | 12:05 | |
grondilu wonders if we could not have %hash<foo>@ to mean @(%hash<foo>) | 12:07 | ||
12:07
domidumont left
|
|||
literal | and is there a more straightforward way of getting all the matched strings of a group than this? @matches = $<mygroup>.map({~$_}) | 12:07 | |
_nadim | jnthn: I pushed a pull request for Grammar::Tracer, the output should be like this with the patch imgur.com/YoFIvU4 | ||
llfourn | in p5 there is $hash{foo}->@* now | ||
(or *@..) | |||
rba_ | How to avoid passing getting an error when passing and Inf from a Num to an Int? e.g. > say Inf.Int | 12:08 | |
psch | m: sub postfix:<@>(\c) { @(c) }; my %h = a => 1, b => 2; say %h@ | ||
camelia | rakudo-moar 6cb231: OUTPUT«(a => 1 b => 2)» |