»ö« 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.
buggable 🎺🎺🎺 It's time for the monthly Accidental /win Lottery 😍😍😍 We have 2 ballots submitted by 2 users! DRUM ROLL PLEASE!... 00:00
And the winning number is 4! Congratulations to AlexDaniel-! You win a can of WD40!
knight__ in other words: if I 'use something' I cannot add method to something, but if I use require I can add methots/var - class variables.
00:03 wander joined
Geth doc/master: 4 commits pushed by (Alex Chen)++ 00:04
raschipi There are multiple ways to find names of things. The first is the lexical pad. When you use my, you're adding the name there.
00:04 mempko left
raschipi Each scope has it's own, and the compiler can look up a name in multiple of them. 00:05
00:05 mcmillhj joined
knight__ I understand, you have symbol table at some scope 00:05
scope may be block, sub, class, whatever
raschipi The second one is package lookup, when you call something with a package name Package::Corp::variable, for example. 00:06
knight__ but, can I add some vars/function to "use something" module?
00:06 callyalater left
raschipi The packages are a lot like hashes, they're called stashes in P6. 00:06
What 'use' does is to take package names and install the names into the pad 00:07
what will be installed is defined by what you're using
The third way to find a name is through method resolution
knight__ raschipi: Only names, not every symbol which I defined for exporting? 00:08
or name of module is index to scope of module?
raschipi Yes, everything that was setup to export.
Don't know anything else other than names, though. 00:09
For exporting a name and a reference is setup.
00:10 mcmillhj left, Piotr_ left
raschipi Feel free to ask anything I didn't make clear. 00:11
knight__ raschipi: Does Module have own scope?
raschipi or name of module is index to scope of module? No, it's impossible to name a scope outside of it.
knight__ I mean
you have own symbol table for every module 00:12
raschipi Yes, each module has it's own scope and it's impossible to get to it unless it sends references.
timotimo there's the package scope where things declared "our" go
you can reach that
knight__ Yep, and my module's symbol table for "use" 00:13
raschipi Perl6 will automatically take the references from the EXPORT sub and is export trait and install in the local scope. You can't get to it otherwise.
knight__ can I change it?
raschipi Yes, anything created with 'our' will be installed in both the pad and the package stash. You can get those things through the stash.
change what? 00:14
knight__ the symbol table
I will show you on python
00:17 mcmillhj joined
knight__ pastebin.com/dmirnwWq 00:17
So, I made class 00:18
with a class variable
and I dynamically added "b" variable
It can be done via __dict__
Also I can add dynamically method
raschipi For classes, that is bread and butter, very easy 00:19
Or do you want to do it to packages? That is done through a Stash docs.perl6.org/type/Stash
geekosaur methods can be added at runtime via the MOP
knight__ And I think, that In case of perl6 require, I can add dynamically method/var because it is in runtime 00:20
and not compiled
raschipi A Stash is a hash you can write to, like any other Hash.
timotimo knight__: symbols from "require" and methods in classes are entirely different 00:21
raschipi What is difficult, although some are working on it, is to change the lexical pad because it's set up at compile time.
but you didn't ask for that. 00:22
00:22 mcmillhj left
knight__ raschipi: can I use Stash on "use module"? 00:23
can I change the state of compiled part? 00:24
I still dont get what is the real purpose of require.
raschipi Some are asking for a way to change the compile part at compile time, but it's not implemented yet.
knight__ raschipi: so Stash you can use only on objects which are "included via require"? 00:25
raschipi You can require something and then get to it with it's full name. Then you can set up alises for what you want to have short names.
timotimo m: say Str.WHO.^name
camelia Stash
timotimo a Stash is installed on every class, for example
most of them are empty, though
m: say Bool.WHO.perl 00:26
camelia {:!False, :True}
timotimo enums have stashes with contents
00:26 BenGoldberg joined
knight__ Ok, so only "required" objects can I stash? 00:26
Ok, so only "required" objects can I Stash?
timotimo that question doesn't make sense to me 00:27
knight__ timotimo: can I use Stash - change method for example Int?
not Inheritance, dynamic... 00:28
raschipi not for methods, you need the MOP for that.
knight__ Ok, I am reading MOP docs 00:30
but I must go to bed, see ya, and thank you.
I am only want to know diffrences from "formal way".
timotimo stash is not how methods are looked up 00:31
also, i think Stash is immutable 00:32
geekosaur perl 6 is not python, methods don't live in a package symbol table
perl 6 is also not javascript, foo["x"] (or perl 6 equivalent foo{"x"}) is not the same as foo.x 00:33
every language does this differently; trying to carry things like that over to a different language won't work
knight__ You are right, but I am trying to understand how it works in Perl.
But I have not found some docs about it. 00:34
ok, I must go!
And thank you
geekosaur docs.perl6.org/language/objects#Me...rospection 00:35
which links to a couple of docs
00:36 leah2 left
knight__ thanks 00:36
00:36 knight__ left
timotimo should probably also tell them that perls 5 and 6 differ greatly in this respect 00:38
00:39 aborazmeh joined, aborazmeh left, aborazmeh joined 00:47 Morfent joined 00:50 Merfont left
raschipi Perl6 is the only language that I know where every type of resolution uses a different method for it. All others I know reuse some for different things. 00:51
00:55 leah2 joined
Geth doc: c125a14a27 | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/grammars.pod6
Fix link
synopsebot Link: doc.perl6.org/language/grammars
00:57 llfourn_ joined 00:58 llfourn left
Geth doc: 7c39640b42 | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
Fix link
synopsebot Link: doc.perl6.org/language/regexes
01:03 mson left, Actualeyes left 01:06 mson joined 01:16 mcmillhj joined
Geth doc: 1506fe00f2 | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
Update regexes.pod6

Note that wildcard C<.> now match "\n". Rewrite comments in regexes to make it practical
synopsebot Link: doc.perl6.org/language/regexes
01:21 mcmillhj left 01:27 mcmillhj joined 01:30 cdg joined 01:31 mcmillhj left 01:34 cdg left 01:35 margeas left 01:38 wander left 01:41 mcmillhj joined 01:46 mcmillhj left 01:57 aindilis left 01:58 Herby_ joined
Herby_ o/ 01:58
02:00 cdg joined 02:01 wander joined 02:12 Cabanossi left 02:14 mcmillhj joined 02:15 Cabanossi joined 02:19 mcmillhj left 02:22 eliasr left
COMBORICO Does ?/ have a name? 02:26
raschipi Never saw that 02:29
COMBORICO It is under regex.
say ~$/ if "abcdef" ~~ / bc.e /; 02:30
evalable6 bcde
02:30 bitrauser_ joined 02:31 Herby_ left
raschipi RIght, $/, not ?/ 02:31
it's the match variable
COMBORICO Oops! Getting sleepy . . .
Match variable! Okay, thanks. How is it different than topical variable ($_) 02:33
wander I've seen "Greedy matching can be explicitly requested with the ! modifier"
m: say 'fooobar' ~~ /fo**:{1..3}obar/;
camelia Nil
wander m: say 'fooobar' ~~ /fo**:?{1..3}obar/;
camelia 「fooobar」
wander m: say 'fooobar' ~~ /fo**:!{1..3}obar/;
camelia 「fooobar」
geekosaur $_ is the target of things. $/ is the result of things (specifically, matches)
COMBORICO Hmm! I like that summary. 02:34
02:34 bitrauser left
wander I think `/fo**:{1..3}obar/` equals to `/fo**:!{1..3}obar/` 02:34
COMBORICO I'll credit your name in my textbook.
wander but oops, they don't.
geekosaur wander, ! tells ** to match as much as it can. : tells it not to allow backtracking after it commits to a match. they do interact but they're very different things 02:35
wander I don't replace ":" with "!" 02:38
02:39 bdmatatu left
wander since ":?" works well, and it said "!" is the explicit way to enable greedy matching, seems ":" should be as ":!" 02:39
02:41 astj left
wander Having tried to add "!" at other position, but no one works. 02:43
If "!" is the explicit way to enable greed, and `/fo**:{1..3}obar/` using greedy, there is a way to explicitly request greedy with "!" in the regex 02:44
02:45 troys is now known as troys_ 02:46 ilbot3 left
wander geekosaur, sorry for my aggressive expression..suddenly notice it 02:48
02:48 astj joined 02:50 Mrofnet joined 02:51 COMBORICO left 02:53 Morfent left 02:54 mcmillhj joined, Todd joined 02:56 ilbot3 joined, ChanServ sets mode: +v ilbot3
Todd Hi All! Do we have a "slurp" (to eat noisely) only it write the whole thing instead of reading the whole thing? I have tried "slop", "upchuck". I have a string with everything I want it in that I want to write to disk. www.freethesaurus.com/slurp is not help. Google give me tons of perl5 hits. 02:56
02:58 mcmillhj left
Todd Wait. Just found it: rosettacode.org/wiki/Write_entire_file#Perl_6 It is `spurt` 02:58
03:04 raschipi left 03:07 mcmillhj joined
wander Todd, docs.perl6.org/language/io#Writing_to_files 03:10
colomon more broadly, docs.perl6.org/type/IO::Path 03:11
colomon had it open to look up .modified
03:12 darkmorph left, mcmillhj left
wander colomon, there is sometimes message leading with "*", such as "* colomon had it open to look up .modified", how do you do that? 03:12
geekosaur /me 03:13
colomon typed “/me” first (I think)
wander thank you
colomon it’s instictive at this point, and my client hides it once I type it. :)
TEttinger Todd: spit is somewhat customary in lisps as the counterpart to slurp
spurt rhymes so that makes sense somewhat 03:14
03:21 mcmillhj joined
Todd I was looking for something with a sence of humor. Whoever came up with slurp (which I adore) had a sense of humor! :-) 03:21
03:26 mcmillhj left 03:30 noganex_ joined 03:33 noganex left, mcmillhj joined 03:38 mcmillhj left
TEttinger slurp I think goes way back to before perl, though I'm not sure 03:38
03:43 Cabanossi left 03:45 Cabanossi joined, mcmillhj joined 03:50 mcmillhj left 03:53 cdg left, cdg joined 03:57 mempko joined 03:58 cdg left 03:59 mcmillhj joined 04:02 wander left 04:03 mcmillhj left 04:12 TimToady left 04:13 aindilis joined, TimToady joined 04:22 aborazmeh left, wamba joined 04:26 troys_ is now known as troys 04:32 BenGoldberg left 04:38 mempko left
piojo1 I noticed something weird when making a class indexable: accessing elements via the class (not instance) as C{$key} is mis-parsed as a closure. C<x> works, and C<<$key>> even works 04:39
m: class C { method m() handles <EXISTS-KEY AT-KEY DELETE-KEY ASSIGN-KEY BIND-KEY> { state %; } }; C<foo> = 42;
camelia ( no output )
piojo1 m: class C { method m() handles <EXISTS-KEY AT-KEY DELETE-KEY ASSIGN-KEY BIND-KEY> { state %; } }; C{'foo'} = 42;
camelia 5===SORRY!5=== Error while compiling <tmp>
Autovivifying object closures not yet implemented. Sorry.
at <tmp>:1
------> 3N-KEY BIND-KEY> { state %; } }; C{'foo'}7⏏5 = 42;
piojo1 Is this a bug? 04:42
04:42 Cabanossi left 04:44 Cabanossi joined
piojo1 Oh, and being more explicit with "." to clarify that it's a method call solves the problem: 04:51
m: class C { method m() handles <EXISTS-KEY AT-KEY DELETE-KEY ASSIGN-KEY BIND-KEY> { state %; } }; C.{'foo'} = 42;
camelia ( no output )
04:52 mcmillhj joined 04:55 wander joined 04:56 mcmillhj left 05:00 khw left 05:06 mcmillhj joined 05:11 mcmillhj left 05:12 xinming_ left 05:31 mcmillhj joined 05:33 mson left
Todd Hi All, I have a mystery. Two computers with Rakudo 2017.08.1. This command gives me two separate results:my $CurlTmpFile = $?FILE.IO ~ ".tmp"; 05:35
05:35 wamba left
Todd computer 1: /home/linuxutil/CurlUtils.pm6 (CurlUtils).tmp 05:35
computer 2: /home/linuxutil/CurlUtils.pm6.tmp 05:36
I am stumped. I need the results of computer 2
05:36 mcmillhj left
ugexe use $*PROGRAM instead of $?FILE 05:36
Todd testing 05:39
./CurlUtilsTest.pl6.tmp 05:41
I need the path too
and not pl6. I need pm6 05:42
I need the name of the module, not the calling program 05:44
05:47 ivans left
Todd I whacked it with 05:51
my $CurlTmpFile = $?FILE.IO ~ ".tmp"; my $CurlTmpFile ~~ s/" "\(.*?\)//;
and just removed the extra "my" 05:52
05:56 troys left, Cabanossi left 05:58 Actualeyes joined 05:59 Cabanossi joined 06:04 mcmillhj joined 06:09 mcmillhj left 06:26 espadrine left 06:31 CacoS joined
wander .ask moritz why `say 'fooobar' ~~ /fo**:{1..3}obar/;` results differently with `say 'fooobar' ~~ /fo**:!{1..3}obar/;` 06:32
yoleaux wander: I'll pass your message to moritz.
06:36 mcmillhj joined, mempko joined 06:41 mcmillhj left
Todd Hi All, I am trying to replace leading spaces with another character. How would I modify the following to only replace leading spaces (I do not want them trimmed)? 06:45
$ perl6 -e 'my $x=" abc d e"; $x ~~ s:global/" "/x/; say $x;' xxabcxdxxe
piojo1 m: my $x = ' ab c d '; $x ~~ s/ ^' '+ //; say $x.perl; 06:47
camelia "ab c d "
piojo1 Todd: don't use :global unless you want the substitution to repeat
Todd testing 06:48
Rats, it subs all the leading spaces with a single character. 06:50
$ perl6 -e 'my $x=" abc d e"; $x ~~ s/^" "+ /x/; say $x;'
xabc d e
This is my eventual goal: 06:51
perl6 -e 'my $x=" abc d e"; $x ~~ s/^" "+ /&nbsp;/; say $x;'
wander perl6 -e 'my $x=" abc \n d \n e "; $x ~~ s:g/^^" "+ /&nbsp;/; say $x;' 06:52
if multi-line 06:53
06:53 mcmillhj joined, napo1eon joined
piojo1 Todd: by the way, that $?FILE bug is a result of this: rt.perl.org/Public/Bug/Display.html?id=128442 06:54
Todd: as wander said, ^^ and $$ are for matching the start/end of a line. ^ and $ match the start/end of the whole input. 06:55
Todd not multiline. "^^" still replaces all the spaces with a single character.
piojo1 oh, I see the problem now. I suggest using code to count the number of spaces you matched 06:57
06:57 wander left 06:58 mcmillhj left
Todd Thanks for the bug url. Mean I's not losing my mind. Well, any more than I already ... 06:58
piojo1 I'll give an example in a moment...
Todd I am try to split the string into and array and reassenbling it. What a pain!
piojo1 no need. you can put the spaces in a match group (one match per space), then count the number of matches 06:59
when you have that, add back the nbsp;:
m: say 'nbsp' x 3
camelia nbspnbspnbsp
Todd did you say you had an example? 07:01
piojo1 removing some crap from it...
TEttinger m: my $x=" abc \n d \n e "; $x ~~ s:g/^^" " /&nbsp;/; say $x; 07:02
camelia &nbsp; abc
&nbsp; d
&nbsp; e
piojo1 m: my $x=" abc d e"; $x ~~ s/^ (' ')* /{ say "matched $0.elems() spaces"; "&nbsp;" x $0.elems; }/; say $x;
camelia matched 2 spaces
&nbsp;&nbsp;abc d e
07:03 rindolf joined
piojo1 TEttinger: I think the issue is to replace more than one leading space, not to do a per-line change 07:03
TEttinger I'm not totally sure what the question is here, what I pasted was an attempt to only remove the initial leading space
07:03 wander_ joined
TEttinger that's what I gathered from <Todd> Rats, it subs all the leading spaces with a single character. 07:03
piojo1 Todd: my example is printing both $x and debugging output, but you can ignore the debugging output. It should replace $x as needed 07:04
Todd I want to change each space into `&nbsp;`
TEttinger err
each leading space, or every space?
and I don't know quite what leading means here, if it's the first space on a line or the first space in a string or the first section of spaces before a non-space char 07:06
wander_ m: my $x=" abc \n d \n e "; $x ~~ s:g/^^(" ")+ /{"&nbsp;"x$/[0].elems}/; say $x;
camelia &nbsp;&nbsp;abc
wander_ Todd, ^^
Todd $ perl6 -e 'my $x=" abc d e "; $x ~~ s:g/^^(" ")+ /{"&nbsp;"x$/[0].elems}/; say $x;' 07:07
&nbsp;&nbsp;abc d e
perfect! Thank you! How in the world did you figure that out?! 07:08
07:08 AlexDaniel joined, mcmillhj joined
wander_ you need more information of the match, so do a capture 07:08
and to get the exact match 07:09
Todd Yo guys have created a monster! 07:11
&nbsp;&nbsp;Used Dev Size : 1855871108 (1769.90 GiB 1900.41 GB)<br>
07:13 mcmillhj left
Todd This stuff is working so well, I am about to giggle. 07:13
07:18 rindolf left 07:21 rindolf joined
piojo1 Todd: perl6 regexes are complicated, but awesome. But I recently discovered a lot of the perl6 grammar power exists in perl5, but you had to use weird syntax and modifiers to make it work 07:25
The power has been brough forward, so it's a first class part of the language.
Todd My first YUGE programming efforts were about 30 years ago with Pascal and Modula2. Now I do a lot of Sys admin work and I write myself a lot of stuff. I use to do it in bash and batch. What a pain in the neck. So I moved to Perl. I hvae been programming Perl5 for a while when moved to Perl 6. I adore Perl 6. (The subs in p5 drives me nuts [@_]). I am not doing any new code in p5. Transitioning from Modula2 to Perl gave me a migra 07:29
07:30 wander_ left
Todd top down, for which I am very grateful. Some p5 guys are crabby about p6. I don't get it. Soon as I got a load of p6, I dropped P5 like a hot potato. 07:30
07:33 mcmillhj joined 07:37 mcmillhj left 07:45 mcmillhj joined 07:50 mcmillhj left
Todd Is "slurp" support to create a file if it does not exist? 07:52
07:53 wander joined
AlexDaniel no 07:53
Todd rats!
Thank you!
07:57 mcmillhj joined
AlexDaniel m: dd Rat xx 10 07:57
camelia (Rat, Rat, Rat, Rat, Rat, Rat, Rat, Rat, Rat, Rat).Seq
07:57 Util joined 08:01 mcmillhj left 08:04 mempko left
Todd :-) 08:04
08:11 wamba joined 08:12 Cabanossi left 08:14 Cabanossi joined 08:17 setty1 joined 08:21 mtj_ joined
wander m: sub f { "hello" }; say &f.CALL-ME(); 08:24
camelia No such method 'CALL-ME' for invocant of type 'Sub'
in block <unit> at <tmp> line 1
wander ^^ surprised
08:29 mcmillhj joined
AlexDaniel squashable6: next 08:29
squashable6 AlexDaniel, ⚠🍕 Next SQUASHathon in 2 days and ≈1 hour (2017-11-04 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
08:30 releasable6 left, releasable6 joined 08:33 mcmillhj left, wander left 08:40 jonas1 joined, mcmillhj joined 08:42 Cabanossi left 08:44 Cabanossi joined 08:45 mcmillhj left 08:51 parv joined, mcmillhj joined 08:52 zakharyas joined, sproctor joined 08:53 ivans joined 08:54 sproctor left 08:56 mcmillhj left 08:57 sproctor joined
Todd Bye Bye. Thank you all so much. You guys heped me complete an over a month long progject. 09:01
09:01 Todd left 09:03 mcmillhj joined 09:07 Piotr_ joined, mcmillhj left 09:09 AlexDaniel left
moritz good morning 09:13
yoleaux 06:32Z <wander> moritz: why `say 'fooobar' ~~ /fo**:{1..3}obar/;` results differently with `say 'fooobar' ~~ /fo**:!{1..3}obar/;`
moritz why wouldn't it? it's not the same regex :) 09:14
with : you disable backtracking, so the first part matches all o's, causing the "obar" to fail 09:16
with ! you re-enable it, so the quantifier can give up the extra o again
:! seems kinda non-sensical
09:18 TheGrimFandango joined 09:19 espadrine joined 09:20 TheGrimFandango left, TheGrimFandango joined 09:27 TheGrimFandango left
moritz huh 09:27
Invalid json? File: /root/.zef/store/Grammar-ErrorReporting-0.2.tar.gz/Grammar-Error-Reporting-0.2/.gitignore
09:27 TheGrimFandango joined
moritz I never expected my .gitignore to be valid json... 09:27
09:27 Ven joined, wamba left 09:28 Ven is now known as Guest37250 09:29 TheGrimFandango left, TheGrimFandango joined 09:30 robertle joined 09:31 TheGrimFandango left, TheGrimFandango joined 09:33 TheGrimFandango left, TheGrimFandango joined 09:35 TheGrimFandango left, TheGrimFandango joined 09:37 TheGrimFandango left, TheGrimFandango joined 09:39 notostraca joined 09:40 knight__ joined, TEttinger left 09:45 TheGrimFandango left, TheGrimFandango joined
knight__ hello, what does WARNING: unhandled Failure detected in DESTROY. mean? 09:46
09:47 TheGrimFandango left, TheGrimFandango joined
moritz it means that something failed in a destructor 09:47
and since the destructor is called from the garbage collector, there is no caller which could receive an exception 09:48
09:49 TheGrimFandango left, TheGrimFandango joined 09:51 TheGrimFandango left, TheGrimFandango joined, Actualeyes left 09:53 TheGrimFandango left
sproctor @moritz is .gitignore not the first line in your .gitignore? 09:53
(Also looking forward to the Grammars book :) )
09:53 TheGrimFandango joined
knight__ I am lost with this require, when I use last perl6 Rakudo version 2017.09-489-g6ad06fad9 09:53
somehow it works 09:54
when I use 2016.12 built on MoarVM version 2016.12
09:55 TheGrimFandango left, TheGrimFandango joined 09:56 Cabanossi left 09:57 TheGrimFandango left, TheGrimFandango joined
knight__ Can someone look to my code bitbucket.org/najt/perl_project/co...st_require ? I do not know what shall I do... 09:58
09:59 TheGrimFandango left, Cabanossi joined, TheGrimFandango joined
DrForr When someone else installs your module the build process should pick up dependencies, I wouldn't really go to that much trouble to catch errors. 10:02
(also, "omg" doesn't really help me understand what your problem is...) 10:03
knight__ Yep, but my task is something like: When I have not installed depends, you program should work for case ./program -h -> should shows the help message.
/usr/bin/perl6 main.p6 --buy-sell='buy' --currency=CZK --date="2015-10-09" 10:04
===SORRY!=== Error while compiling /home/a/Skola/PJS2/projekt/perl/main.p6
Undeclared names: MBANK used at line 65 NBP used at line 64 NBPref used at line 63
/usr/bin/perl6 --version
This is Rakudo version 2016.12 built
DrForr lib/MBANK.pm6 and class MBANK::MBANK don't quite work together. 10:07
moritz sproctor: the .gitignore file is under version control, so it doesn't list itself 10:09
sproctor Oh. See I generally don't put mine in the repo. Different strokes I guess. 10:10
DrForr Convention would be to create lib/MBANK/MBANK.pm6 in your case, then the require() call would be looking for the correct file.
moritz sproctor: if you don't put it under version control, you can place it in .git/config/exclude
DrForr Also just a personal question - --currency=CZK - do you by chance hail from Czechia? If so, ahoj from Prague :) 10:11
knight__ :-D Cau, ale som zo Slovenska 10:12
nine knight__: replace "require" by "use" and don't try to handle dependency errors. If the default error message for an unsatisfied dependency can be improved, please let us know, so we can fix it for everyone. 10:13
knight__ nine: I cannot, because this is my TASK by my professor. If some "perl" develop can send him mail about it. 10:14
10:14 araujo left
knight__ :-) 10:14
DrForr Okay, now I'm *really* curious :) An actual programming class using Perl 6. I've got a retrospective meeting right now, but I'm *really* curious about this school, where it is, how we can help... 10:15
knight__ He teaches Perl5, but I want Perl6. 10:16
and :-X
moritz knight__: maybe show us how you use the module that you import? 10:21
10:21 aborazmeh joined, aborazmeh left, aborazmeh joined 10:22 wander joined 10:23 TheGrimFandango left, TheGrimFandango joined
knight__ moritz: In module I have a class, I am calling class and making instance of it 10:24
10:25 TheGrimFandango left
knight__ "use module" version ^ 10:25
10:25 TheGrimFandango joined
El_Che knight: a reason you use that specific version? I see debian 9 an ubuntu 17.04 have it 10:25
10:26 astj left
knight__ moritz: I make @ with instances of bank 10:26
10:26 astj joined, astj left, astj joined
knight__ and calls methods in map 10:26
So, I am changing online inner state of Objects
s/online/only 10:27
El_Che: do you mean This is Rakudo version 2016.12 ?
It is from Debian repo
Description:Debian GNU/Linux 9.2 (stretch) 10:28
10:28 Aaronepower joined
knight__ I have compiled new version from repo via rakudobrew 10:28
El_Che In case you're using newer feature, I have debian packages available
knight__ This is Rakudo version 2017.09-489-g6ad06fad9
El_Che github.com/nxadm/rakudo-pkg
knight__ require version works, but 10:29
10:29 TheGrimFandango left
knight__ I have problem with destructor DESTROY something... 10:29
moritz knight__: I think at this point, the easiest way to catch the error is to do something like
10:29 TheGrimFandango joined
knight__ what I mentioned, when I joined here 10:29
moritz BEGIN { try { require module1; require module2; .. } # handle errors here }
and then do the regular "use" calls below that 10:30
knight__ but It will not solve one thing
if someone call ./program -h
and you have not dependencies
it will crash
or it will not work
am I right?
moritz right 10:31
10:31 TheGrimFandango left
moritz ok, let my try to eplain some more background 10:31
10:31 TheGrimFandango joined
moritz in Perl 5, the compiler looks for symbols such as class names in the symbol table 10:31
Perl 6 tends to look in lexical scopes more 10:32
but, lexical scopes are immutable at run time
so, in Perl 5, when you do a "require Foo" followed by Foo->import(), thins Just Work[tm]
that is, you get all the symbols that a "use Foo;" would import
it can't work that way in Perl 6 10:33
if you do a require Foo; in Perl 6
then *only* the symbol Foo is available in the caller's scope
because that's the only symbol that the compiler knows about at compile time
so now you have two options 10:34
specify all the symbols that you need as literals in the call to require
or, work from the one symbol you have
10:35 TheGrimFandango left
moritz if for example Foo exports a subroutine bar, you can do a require Foo <&bar>; 10:35
10:35 TheGrimFandango joined
moritz or if use'ing MBANK makes MBANK::MBANK available, you might have to access it explicitly through the symbol table 10:36
require MBANK;
instead of MBANK::BANK.new
10:37 TheGrimFandango left, steeznson joined
pmurias bartolin: github.com/rakudo/rakudo/issues/1225 10:37
10:37 TheGrimFandango joined 10:39 wander left
knight__ moritz: Thank you! 10:39
nine moritz, knight__: why not just move all the relevant (module using) code into a module and have the main script be something like: if check-requirements() { load-main-module(); } else { print-nice-help-text(); }? 10:40
Then you can still use "use" and all the automatic symbol loading in the main module _and_ have your error message if requirements are missing 10:41
knight__ nine: because it is another task, I mast make modules :-)
och 10:42
I mean different
moritz nine: I think the idea is to offer reduced functionality when some modules are not available
nine moritz: and my idea is to split the functionality of the program into parts that are only loaded when their respective requirements are met. My example code split the program into the parts "do-something-useful and print-helpdesk" but it can be split in other ways, too. 10:44
10:46 notbenh joined 10:47 wander joined
nine Did I actually write "print-helpdesk"? I meant "print-helpmessage" of course :) 10:50
wander moritz, so can I say, in ":!", "!" override ":"? does it imply we can only have one modifier on quantifier?
10:51 TheGrimFandango left, TheGrimFandango joined
moritz nine: a 3D printer could print a literal help desk :-) 10:53
10:53 TheGrimFandango left, TheGrimFandango joined
moritz wander: yes, and I think so 10:53
:! is like "give me less! No, more!" :-) 10:54
10:56 raschipi joined
knight__ moritz: One question, what If I use require in in my module e.g MBANK? 10:57
I mean installed via CPAN
some modules
So, in module MBANK I use require HTTP::Tinyish;
wander thank you 10:58
moritz knight__: the same rules apply inside modules 10:59
10:59 bdmatatu joined
moritz afk 11:02
wander I am looking for the implementation of hyper operator "»". Anyone knows its location? Maybe rakudo/rakudo/src/... 11:04
11:04 setty1 left 11:07 margeas joined, bdmatatu left, mr-foobar left
jnthn wander: It'll be in at least 3 places: Grammar.nqp for the parsing, Actions.nqp for code-gen, and the code-gen largely just emits calls to some functions in CORE.setting probably in metaops.pm 11:08
wander thanks 11:09
11:10 literal joined, avar joined, avar left, avar joined
wander I've seen them. 11:14
11:14 parv left 11:17 ilmari left 11:28 Cabanossi left, Aaronepower left 11:29 steeznson left, Cabanossi joined 11:35 TheGrimFandango left, TheGrimFandango joined 11:37 TheGrimFandango left, TheGrimFandango joined 11:46 Guest37250 left 11:51 leah2 left 11:56 piojo1 left, leah2 joined 12:00 knight__ left 12:03 TheGrimFandango left, TheGrimFandango joined 12:05 TheGrimFandango left, TheGrimFandango joined 12:07 TheGrimFandango left, TheGrimFandango joined
Geth doc: 79adcdef4f | (Alex Chen)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
Improve example of quantifier's modifier

  `:?` is non-sensical
synopsebot Link: doc.perl6.org/language/regexes
12:08 Ven joined 12:09 darutoko joined, TheGrimFandango left, Ven is now known as Guest67908, TheGrimFandango joined 12:12 bdmatatu joined 12:13 TheGrimFandango left, TheGrimFandango joined 12:15 mson joined, TheGrimFandango left, TheGrimFandango joined
wander m: say [1,2,3]>>( &sin ); 12:17
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
wander m: say [1,2,3]>>.( &sin );
camelia No such method 'CALL-ME' for invocant of type 'Int'
in block <unit> at <tmp> line 1
wander m: say [1,2,3]>>.&sin;
camelia [0.841470984807897 0.909297426825682 0.141120008059867]
wander what are the details about "Too many positionals passed; expected 1 argument but got 2" 12:19
12:20 Guest67908 left 12:22 wamba joined 12:25 wander left 12:27 Cabanossi left, TheGrimFandango left, wamba left, TheGrimFandango joined, Exodist left
raschipi m: sub joinsay { @_>>.gist.join('---').put }; [1,2,3]>>( &joinsay ) 12:28
camelia 1---sub joinsay (*@_) { #`(Sub|62261368) ... }
2---sub joinsay (*@_) { #`(Sub|62261368) ... }
3---sub joinsay (*@_) { #`(Sub|62261368) ... }
12:29 Cabanossi joined, TheGrimFandango left
raschipi Why is it adding a reference as the second argument I don't know. 12:29
12:29 Exodist joined, TheGrimFandango joined
raschipi m: sub joinsay { @_>>.gist.join('---').put }; say [&sin,&cos,&tan]>>.( &joinsay ) 12:30
camelia Cannot resolve caller sin(Sub); none of these signatures match:
(Numeric \x)
(Cool \x)
(num $x --> num)
in block <unit> at <tmp> line 1
raschipi m: sub joinsay { @_>>.gist.join('---').put }; say [1,2,3]>>.( &joinsay ) 12:33
camelia No such method 'CALL-ME' for invocant of type 'Int'
in block <unit> at <tmp> line 1
raschipi m: say [&sin,&cos,&tan]>>.( 3 ) 12:34
camelia [0.141120008059867 -0.989992496600445 -0.142546543074278]
12:37 wander joined 12:41 zakharyas left 12:43 TheGrimFandango left, TheGrimFandango joined 12:45 TheGrimFandango left, TheGrimFandango joined 12:46 Ven_ joined
wander maybe in this case, >> works like github.com/rakudo/rakudo/blob/6389...#L487-L493 12:46