Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2018-02-12

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:10 cdg joined #perl6
00:31 cdg joined #perl6
00:45 pierre__ joined #perl6
00:50 konsolebox joined #perl6
01:19 jstevens joined #perl6
01:29 pierre__ joined #perl6
01:47 aborazmeh joined #perl6
01:47 aborazmeh joined #perl6
01:47 pierre__ joined #perl6
01:56 aindilis` joined #perl6
01:56 pierre__ joined #perl6
01:59 pierre__ joined #perl6
02:15 aindilis joined #perl6
02:15 Thrush I find myself really enjoying learning and using Perl 6.  However, I haven't been able to install IO::Glob on my Rakudo Star installation.  (I'm using Windows.)  For some reason, when I type "zef install IO::Glob", Microsoft's web browser pops up.
02:18 AlexDaniel Thrush: I don't use windows so can't help unfortunately, but can you install other modules?
02:49 titsuki zef(rakudo-star 2017.10) itself seems to have a bug. I also tried to install IO::Glob on Windows: https://gist.github.com/titsuki/2332f051bfb08deb3071aeecebcf35fe
02:56 ilbot3 joined #perl6
02:56 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
03:15 Thrush AlexDaniel:  I've never been able to successfully install anything on Perl 6, with or without zef.
03:16 Thrush When I type "zef install <anything>", I get this page popping up on a web browser:  https://support.microsoft.com/en-us/help/917607/error-opening-help-in-windows-based-programs-feature-not-included-or-h
03:18 geekosaur sounds like it is assuming that an http handler is installed somehow
03:19 geekosaur I think that might be a known issue? iirc if all else fails it tries powershell, but if you don;'t have that there's nothing it can do reliably to get http/https support (no, that is not included with perl 6. if this is going to be a problem on windows, maybe we have to bow to reality and include it in the core)
03:21 Thrush If I "use" something (such as "use IO::Glob") from the Perl 6 REPL, am I supposed to see "Nil" on success?
03:23 Thrush I just tried "zef install IO::Glob --force-install" (with the --force-install LAST instead of earlier), and it seemed to work for me.
03:25 ZzZombo `use` doesn't return anything. It would fail though if the module wasn't found.
03:26 Thrush However, I've noticed that "my @a = glob('../*')" won't work for me (it sets @a to an empty array).  I found that using '\' instead of '/' DOES work, though, so apparently the module doesn't treat '/' as directory separators on all platforms, like Windows.
03:29 ZzZombo '\' is the escape character. YOU should treat it as such.
03:33 geekosaur I think you understood them backwards
03:48 pierre__ joined #perl6
03:52 pierre__ joined #perl6
04:00 Thrush ZzZombo:  Sure, '\' is the escape character.  And '/' is the directory separator in both Unix and Windows, at least according to Perl5, Ruby, Python, and GNU C++.  But not according to Perl6, evidently.
04:02 wamba joined #perl6
04:05 tt joined #perl6
04:11 pierre__ joined #perl6
04:12 Cabanossi joined #perl6
04:15 pierre__ joined #perl6
04:46 pierre__ joined #perl6
05:10 pierre__ joined #perl6
05:19 tt joined #perl6
05:23 lizmat_ notable6: help
05:23 notable6 lizmat_, Like this: notable6: weekly rakudo is now 10x faster # See wiki for more examples: https://github.com/perl6/whateverable/wiki/Notable
05:24 lizmat_ notable: weekly
05:24 notable6 lizmat_, 6 notes: https://gist.github.com/bc3c075a0621e06e9f389b81ca301eea
05:25 lucs joined #perl6
05:25 tt joined #perl6
05:28 pierre__ joined #perl6
05:46 pierre__ joined #perl6
05:51 ZzZombo I don't get it, this `EXPORTHOW` stuff just doesn't work for me at all.
05:53 ZzZombo I copied the code from https://github.com/jnthn/oo-monitors/blob/master/lib/OO/Monitors.pm6#L111 into a module, replaced `constant class` with `constant test`, used the module in Perl REPL, wrote `use Test;my<HERE> test C {};C.HOW.^name` and it returns the standard `ClassHOW`!
05:53 konsolebox joined #perl6
05:54 ZzZombo wtf
05:54 ZzZombo I meant I wrote `test C {};C.HOW.^name`.
05:56 curan joined #perl6
06:05 pierre__ joined #perl6
06:07 cdg joined #perl6
06:13 pierre__ joined #perl6
06:18 cdg joined #perl6
06:20 tt joined #perl6
06:33 pierre__ joined #perl6
06:47 Geth ¦ doc: 85322f76ba | (JJ Merelo)++ | doc/Language/list.pod6
06:47 Geth ¦ doc: Fixes warning and changes to list, refs e01b3ca and follows @coke advice
06:47 synopsebot Link: https://doc.perl6.org/language/list
06:47 Geth ¦ doc: review: https://github.com/perl6/doc/commit/85322f76ba
06:47 Geth ¦ doc: 4eda9f8e26 | (JJ Merelo)++ | xt/examples-compilation.t
06:47 Geth ¦ doc: Makes easier identification of chunk
06:47 Geth ¦ doc:
06:47 Geth ¦ doc: In the compilation tests. Shows the first 10 chars excluding whitespace
06:47 Geth ¦ doc: review: https://github.com/perl6/doc/commit/4eda9f8e26
06:47 Geth ¦ doc: 0a952d0950 | (JJ Merelo)++ | 2 files
06:47 Geth ¦ doc: Changes quotes
06:47 Geth ¦ doc:
06:47 Geth ¦ doc: And eliminates other "sink context" warnings from the list document.
06:47 Geth ¦ doc: review: https://github.com/perl6/doc/commit/0a952d0950
06:56 tt joined #perl6
06:56 lizmat And another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2018/02/12/2018-07-a-quick-one-from-apopka/
06:58 lizmat a little earlier than usual, but I won't have any time for it in the next 72 hours
06:58 * lizmat is off to bed
06:59 lizmat notable6: clear weekly
06:59 lizmat hmmm... guess notable6 also went to bed
06:59 lizmat sleep&
07:18 amalia___ joined #perl6
07:21 darutoko joined #perl6
07:28 Petit_Dejeuner joined #perl6
07:31 wamba joined #perl6
07:57 lowbro joined #perl6
07:57 lowbro joined #perl6
07:58 konsolebox joined #perl6
08:06 abraxxa joined #perl6
08:29 konsolebox joined #perl6
08:31 zakharyas joined #perl6
08:35 char_var[buffer] joined #perl6
08:36 pierre__ joined #perl6
08:38 zakharyas joined #perl6
08:39 reportable6 joined #perl6
08:39 Actualeyes joined #perl6
08:41 zakharyas joined #perl6
08:48 konsolebox joined #perl6
08:48 rindolf joined #perl6
08:55 pierre__ joined #perl6
08:58 timeless joined #perl6
09:00 zakharyas joined #perl6
09:08 dakkar joined #perl6
09:11 clkao joined #perl6
09:14 caasih joined #perl6
09:18 Xliff Does the latest version of rakudo properly include zef?
09:19 Xliff After the tree change from nom to master, I don't see the proper bin installed.
09:19 Xliff Indeed, if I call zef from moar-nom, it errors out and says "Could not find Zef::CLI at line 2 in"
09:20 El_Che Xliff: rakudo does not include zef. My packages (rakudo-pkg on github and rakudo star do)
09:21 Xliff So I have to build zef from git sources, then?
09:21 Xliff zef used to be a part of moar-nom, so I am curious as to why the change.
09:22 Xliff At least as far as rakudobrew was concerned.
09:23 El_Che Xliff: this will install it in your home: https://github.com/nxadm/rakudo-pkg/blob/master/docker/install-zef-as-user (in case rakudo does not have a "install zef" switch)
09:24 El_Che (as an example, change paths accordingly)
09:24 El_Che it been a while since I used rakudobrew
09:25 Xliff Yeah. "rakudobrew build zef" is b0rked.
09:27 ZzZombo Can anybody tell me step-by-step how to work with `EXPORTHOW` since it doesn't work for me.
09:31 Spot__ joined #perl6
09:31 notable6 joined #perl6
09:31 Xliff El_Che: Yeah, even those instructions aren't working.
09:31 Xliff ZzZombo: Sorry. I know nothing about EXPORTHOW, and would like to know myself.
09:32 El_Che it's a simple git clone + install, it's just on how a user can build zef in their $HOME next to the one install globally
09:33 Xliff El_Che: Yes, and those aren't working for me.
09:33 Xliff Let me see if there is another zef in path.
09:34 El_Che git clone https://github.com/ugexe/zef.git && cd zef && perl6 -Ilib bin/zef install .
09:34 El_Che there you go
09:34 Xliff Done that. No luck.
09:34 Xliff Seriously.
09:35 Xliff cbwood@infinity:~/.rakudobrew/moar-master/zef$ perl6 -Ilib bin/zef install
09:35 El_Che no perl6 in path?
09:35 Xliff ^^ works.
09:35 Xliff No. Perl6 is in path.
09:35 El_Che ok
09:35 Xliff [02/12/2018 04:35:25] cbwood@infinity:~$ which zef
09:35 El_Che (like saidn it has been ages since I used rakudobrew)
09:36 Xliff This isn't a rakudobrew issue though since I am doing it from git, now.
09:36 El_Che zef is in  ~/.perl6/bin normally
09:36 Xliff That isn't the issue, either.
09:37 El_Che Xliff: I know where the perl6 I build puts stuff because I know with which options I built it
09:37 El_Che I don't know how rakudo builds perl 6
09:37 El_Che hence my remark
09:38 Xliff Oh DUH
09:38 Xliff perl6 -Ilib bin/zef install >.<
09:38 Xliff /o\
09:39 Zoffix joined #perl6
09:39 Zoffix lizmat++ # good weekly
09:39 Xliff lizmat++ # Indeed
09:39 Xliff I'm bored. I need a new perl6 project.
09:39 Zoffix Is it [safe/does it make sense] to shove a Str object as a :value to QAST::SVal?
09:40 El_Che Xliff: write something to package dependencies so that a perl6 project can be deplied with one file
09:40 Xliff El_Che: I assume you mean "deployed"
09:40 El_Che yes
09:40 Zoffix The `<x>` construct creates a single QAST::WVal(Str) which causes some wantedness not to propagate right. Wondering if I should teach the wanter to want QAST::WVals, or to change the `<x>` to make a QAST::Want(WVal(Str), 'Ss', SVal(Str)). It compiles and seems to work, but wonder if that's sane
09:41 Xliff What do you mean by "one file"?
09:41 El_Che like fatpack does for perl 5, a fat jar/war in Java, a static compiled file in Go
09:41 Xliff Oh.
09:42 Xliff I was thinking about something like that.
09:42 El_Che I gave it a go some time back, but didn't get far to to lack of time
09:42 El_Che (and the procompiling complicated stuff)
09:42 Xliff making it so that you can package a perl project, including all precompiled modules so that it could be run directly via the moarvm exec
09:43 Xliff Sounds like we are on the same page.
09:43 Xliff Although that sounds like messing with nqp / moar internals, which I am not well versed with.
09:44 El_Che extra points if it could include compiled C stuff for nativecall, but that's hairy
09:44 Xliff Meh. Best if the nativecall stuff is separately installed with a build script.
09:44 El_Che perl6 ./big_fat_packed_script.pl6 would also be nice
09:44 konsolebox joined #perl6
09:44 Xliff Precisely because of the 80's hair.
09:45 Zoffix eco: Wix
09:45 buggable Zoffix, App::InstallerMaker::WiX 'Tool to make basic WiX installers for Perl 6 apps, bundling MoarVM/Rakudo.': https://github.com/jnthn/p6-app-installermaker-wix
09:46 Xliff El_Che: That would be the goal, yes. Where ./big_fat_packed_script.pl6 would be ./project_distro_installer.pl6 and it would put everything in a directory, including a simple exec that ran the project with all the needed command line switches.
09:46 Xliff Zoffix++ # Will look into WiX
09:47 Xliff Although I think that falls short of having something that runs directly via moarvm, rather than the perl6 interpreter.
09:47 Xliff The idea is to avoid stage parse.
09:48 Xliff Although jnthn++ does have a good workaround putting everthing in a module and the exec is simply "use App::Module"
09:48 El_Che maybe worth looking at stuff like rust cargo?
09:49 Zoffix m: use nqp; use QAST:from<NQP>; my $v := QAST::SVal.new(:value("meows")).value; say(nqp::objprimspec($v))
09:49 camelia rakudo-moar 00af9ce27: OUTPUT: «0␤»
09:49 Zoffix m: use nqp; use QAST:from<NQP>; my $v := QAST::SVal.new(:value(nqp::unbox_s("meows"))).value; say(nqp::objprimspec($v))
09:49 camelia rakudo-moar 00af9ce27: OUTPUT: «0␤»
09:49 Zoffix :(
09:50 * Xliff &
09:52 Zoffix well, I'll stick an unbox_s over it and assume it'd good 'nuf
09:52 Zoffix ZofBot: #YOLO
09:52 ZofBot Zoffix, com/b10bb6a66d4948ff03655731d82a9d4a Files=1229, Tests=75884, 316 wallclock secs (14
09:57 konsolebox joined #perl6
09:57 Zoffix left #perl6
10:05 konsolebox joined #perl6
10:07 fireartist joined #perl6
10:08 fireartist Hi - is there a simple way to use a string var as a filehandle, and pull a line at a time out of it?
10:10 markong joined #perl6
10:13 moritz fireartist: for $filename.IO.lines() -> $line { ... }
10:13 moritz fireartist: .lines() returns a lazy iterator, so that doesn't read the whole file into memory
10:14 fireartist moritz: just realised I was being daft - I did run().out.slurp-rest; then wanted to parse the output - realised I could drop the slurp-rest, and out() might give me something useful I could use :-)
10:14 moritz fireartist: run().out.lines ?
10:16 fireartist moritz: exactly :-) I'll actually use get(), as I'm wanting to make a stately parser - my fault for reading 5to6 without thinking for myself
10:16 fireartist moritz: btw, are you the same moritz on tau station alpha?
10:17 Kaiepi joined #perl6
10:18 moritz fireartist: yes
10:18 moritz I'm EVERYWHERE! :-)
10:19 fireartist moritz: ah, I'm firefu there - greetings omnipresent one!
10:21 moritz fireartist: :) how do you like it so far?
10:22 moritz I guess they have quite a few beta testers from the Perl community; Perleone also plays it, and he sits right next to me at $work :-)
10:24 fireartist yes, I've been rss subscribed to ovid's blog for years - that's where I saw the invite
10:26 fireartist I am enjoying it, but there's not enough to do yet - but that's to be expected for early testers
10:29 bloatable6 joined #perl6
10:33 El_Che plot a take over of the universe? most SF ends up on that scenario anyways :)
10:36 konsolebox joined #perl6
10:52 shareable6 joined #perl6
10:54 Xliff Um.
10:54 Xliff Tau Station Alpha?
10:54 Xliff moritz: Pray tell?
11:02 Xliff https://taustation.space/blog/on-writing-clean-database-code/
11:02 Xliff O_o
11:02 Xliff That's cool.
11:07 Xliff Well, waiting for confirmation, now. :/.
11:09 Geth ¦ doc: eda32c5fd2 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Exception.pod6
11:09 Geth ¦ doc: Document behaviour of &die without args
11:09 synopsebot Link: https://doc.perl6.org/type/Exception
11:09 Geth ¦ doc: review: https://github.com/perl6/doc/commit/eda32c5fd2
11:10 zakharyas1 joined #perl6
11:15 zakharyas joined #perl6
11:18 zakharyas joined #perl6
11:20 khw joined #perl6
11:25 zakharyas joined #perl6
11:28 lalitmee joined #perl6
11:30 konsolebox joined #perl6
11:38 moritz Xliff: sorry, was offline
11:39 konsolebox joined #perl6
11:39 moritz http://blogs.perl.org/users/ovid/ has some more blog posts on that game, it used to be called "Veure" or so in its earlier stages, iirc
11:42 buggable New CPAN upload: MeCab-0.0.6.tar.gz by TITSUKI https://cpan.metacpan.org/authors/id/T/TI/TITSUKI/Perl6/MeCab-0.0.6.tar.gz
11:45 konsolebox joined #perl6
11:47 Xliff moritz: Yeah. I signed up. Waiting for the confirmation email.
12:16 konsolebox joined #perl6
12:34 eliasr joined #perl6
12:36 bhm joined #perl6
12:38 kybr joined #perl6
12:40 bhm left #perl6
12:41 bhm joined #perl6
12:43 Xliff Has anyone written a grammar for SQL?
12:45 Xliff SQL::Parser was started on github but has no code.
12:55 zeddy_k joined #perl6
12:55 psychoslave joined #perl6
12:56 bhm joined #perl6
13:07 lalitmee joined #perl6
13:16 DrForr I have it as a TODO item, should that actually help :)
13:26 scimon joined #perl6
13:33 pierre__ joined #perl6
13:40 ZzZombo jnthn, since you are the author of OO:Monitors, and used `EXPORTHOW` stuff, can you tell me why I fail to utilize it at all?
13:40 ZzZombo I used pretty much the same code as you do.
13:45 jnthn ZzZombo: No idea, if you're using pretty much the same code. I presume your EXPORTHOW is in UNIT of the module?
13:45 jnthn (It must be.)
13:45 ZzZombo Yes.
13:45 jnthn And you're putting something under a sub-package, like DECLARE
13:46 ZzZombo It's a standard module file, like this "unit module Test;"
13:46 jnthn ?
13:46 jnthn Hm, does mine also use "unit module ..." ?
13:46 ZzZombo No, but even w/o it it didn't work.
13:46 jnthn Hm
13:46 jnthn Got code I can look at?
13:50 ZzZombo Oh well, I just realized when copying the code I missed the `my` in front of declaration of `EXPORTHOW`. Adding it fixed that.
13:52 jnthn ah, yes, that'd important
13:52 jnthn *that's
13:55 ZzZombo Aw, a pity `COMPOSE` isn't available yet.
13:55 jhill_ joined #perl6
13:55 zakharyas joined #perl6
13:59 mcmillhj joined #perl6
14:02 ZzZombo m: class C {our $.a=123};$C::a.say
14:02 camelia rakudo-moar e72eb01ed: OUTPUT: «(Any)␤»
14:02 wamba joined #perl6
14:02 ZzZombo m: class C {our $.a=123};C.^attributes
14:02 camelia rakudo-moar e72eb01ed: ( no output )
14:02 ZzZombo m: class C {our $.a=123};C.^attributes.say
14:02 camelia rakudo-moar e72eb01ed: OUTPUT: «()␤»
14:04 ZzZombo m: class C {our $.a=123};C.a
14:04 camelia rakudo-moar e72eb01ed: ( no output )
14:04 ZzZombo m: class C {our $.a=123};C.a.say
14:04 camelia rakudo-moar e72eb01ed: OUTPUT: «123␤»
14:04 ZzZombo m: class C {my $.a=123};C.a.say
14:04 camelia rakudo-moar e72eb01ed: OUTPUT: «123␤»
14:04 ZzZombo m: class C {my $.a=123;has $.a='asd'};C.a.say
14:04 camelia rakudo-moar e72eb01ed: OUTPUT: «Potential difficulties:␤    Redeclaration of symbol '$.a'␤    at <tmp>:1␤    ------> 3class C {my $.a=123;has $.a7⏏5='asd'};C.a.say␤123␤»
14:04 ZzZombo m: class C {my $.a=123;has $!a='asd'};C.a.say
14:04 camelia rakudo-moar e72eb01ed: OUTPUT: «123␤»
14:08 abraxxa joined #perl6
14:09 abraxxa joined #perl6
14:20 cdg joined #perl6
14:28 zakharyas joined #perl6
14:29 abraxxa joined #perl6
14:29 sergot .seen masak
14:29 yoleaux I saw masak 26 Jan 2018 22:00Z in #perl6: * masak groans preemptively
14:32 jkramer What is this for? https://docs.perl6.org/routine/tree
14:33 jkramer m: dd 'foo'.tree
14:33 camelia rakudo-moar e72eb01ed: OUTPUT: «"foo"␤»
14:42 skids joined #perl6
14:43 zakharyas1 joined #perl6
14:53 mcmillhj joined #perl6
14:54 ZzZombo s: &tree,\(Str)
14:54 SourceBaby ZzZombo, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Undeclared routine:␤    tree used at line 6␤␤
14:54 ZzZombo s: Str,'tree'
14:54 SourceBaby ZzZombo, Something's wrong: ␤ERR: Type check failed in binding to parameter '&code'; expected Callable but got Method+{is-nodal} (Method+{is-nodal}.new)␤  in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤  in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤  in block <unit> at -e l
14:55 ZzZombo s: help
14:55 SourceBaby ZzZombo, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Undeclared routine:␤    help used at line 6␤␤
14:56 ZzZombo s: Any, 'tree'
14:56 SourceBaby ZzZombo, Something's wrong: ␤ERR: Type check failed in binding to parameter '&code'; expected Callable but got Method+{is-nodal} (Method+{is-nodal}.new)␤  in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤  in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤  in block <unit> at -e l
14:56 ZzZombo IDK
14:57 ZzZombo s: Int, 'base'
14:57 SourceBaby ZzZombo, Sauce is at https://github.com/rakudo/rakudo/blob/e72eb01ed/src/core/Int.pm#L82
14:57 ZzZombo s: Int, 'tree'
14:57 SourceBaby ZzZombo, Something's wrong: ␤ERR: Type check failed in binding to parameter '&code'; expected Callable but got Method+{is-nodal} (Method+{is-nodal}.new)␤  in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤  in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤  in block <unit> at -e l
14:58 ZzZombo m: Int.tree
14:58 camelia rakudo-moar e72eb01ed: ( no output )
14:58 ZzZombo m: Int.tree.say
14:58 camelia rakudo-moar e72eb01ed: OUTPUT: «(Int)␤»
14:59 ZzZombo m: (Int.^methods.first: *.name eq 'tree').say
14:59 camelia rakudo-moar e72eb01ed: OUTPUT: «Nil␤»
15:00 ZzZombo m: say Int.^methods.first: *.name eq 'tree'
15:00 camelia rakudo-moar e72eb01ed: OUTPUT: «Nil␤»
15:00 ZzZombo What in hell?
15:00 ZzZombo m: tree
15:00 camelia rakudo-moar e72eb01ed: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    tree used at line 1␤␤»
15:00 ZzZombo m: tree: ''
15:00 camelia rakudo-moar e72eb01ed: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant string "" in sink context (line 1)␤»
15:01 ZzZombo m: say tree: ''
15:01 camelia rakudo-moar e72eb01ed: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    tree used at line 1␤␤»
15:04 jkramer According to the source it simply returns self, unless it's iterable, in which case it maps over its elements calling .tree on each, which then just returns self :)
15:04 Xliff DrForr: Was that TODO mention in response to me?
15:04 Xliff DrForr: If so, if you have a syntax graph of SQL, or something like it, I would really appreciate it.
15:05 ZzZombo m: (1,2,3,4,(123,'asd'),False,Nil,True).tree.say
15:05 camelia rakudo-moar e72eb01ed: OUTPUT: «(1 2 3 4 (123 asd) False Nil True)␤»
15:05 jnthn m: dd (1,2,3,4,(123,'asd'),False,Nil,True).tree
15:05 camelia rakudo-moar e72eb01ed: OUTPUT: «$((1, 2, 3, 4, $((123, "asd").Seq), Bool::False, Nil, Bool::True).Seq)␤»
15:05 jnthn Note the itemization
15:06 jkramer So what is it meant for? :) I guess there must be some purpose for it to be there?
15:07 gregf_ joined #perl6
15:08 jnthn To take a nested list structure and itemize things, so that they won't flatten away in flattening contexts
15:10 jkramer Someone should fix the docs then :) It currently only says "Returns Any."
15:10 jkramer Also I don't understand how the method name `tree` relates to what it's doing
15:11 zakharyas joined #perl6
15:13 Geth ¦ doc: bf0cf99efa | (Will "Coke" Coleda)++ | doc/Type/Exception.pod6
15:13 Geth ¦ doc: remove duplicate
15:13 Geth ¦ doc: review: https://github.com/perl6/doc/commit/bf0cf99efa
15:13 Geth ¦ doc: fabd8b51a9 | (Will "Coke" Coleda)++ | doc/Type/Exception.pod6
15:13 Geth ¦ doc: remove trailing whitespace
15:13 synopsebot Link: https://doc.perl6.org/type/Exception
15:13 Geth ¦ doc: review: https://github.com/perl6/doc/commit/fabd8b51a9
15:13 mcmillhj joined #perl6
15:21 Xliff m: my %a; %a{$_} = $_.ord - 65 for 'A'..'E'; %a.tree.say
15:21 camelia rakudo-moar e72eb01ed: OUTPUT: «(B => 1 A => 0 E => 4 D => 3 C => 2)␤»
15:22 Xliff m: my %a; %a{$_} = $_.ord - 65 for 'A'..'C'; %a<Z>{$_} = $_.ord - 65 for 'D'..'F'; %a.tree.say
15:22 camelia rakudo-moar e72eb01ed: OUTPUT: «(Z => {D => 3, E => 4, F => 5} B => 1 A => 0 C => 2)␤»
15:23 Xliff m: my %a; %a{$_} = $_.ord - 65 for 'A'..'C'; %a<Z>{$_} = $_.ord - 65 for 'D'..'F'; %a.keys.say
15:23 camelia rakudo-moar e72eb01ed: OUTPUT: «(Z B A C)␤»
15:24 mcmillhj joined #perl6
15:25 AlexDaniel joined #perl6
15:27 Xliff DrForr: YEEEEs! https://cdn.rawgit.com/GuntherRademacher/ad6a447fdc0d0c331c6ba24cc39882c4/raw/bc69f06fe4eb9f243b69e889657ca8763c6441ab/sql_yacc.xhtml
15:29 wamba joined #perl6
15:29 Xliff .tell DrForr SQL Diagram https://cdn.rawgit.com/GuntherRademacher/ad6a447fdc0d0c331c6ba24cc39882c4/raw/bc69f06fe4eb9f243b69e889657ca8763c6441ab/sql_yacc.xhtml
15:29 yoleaux Xliff: I'll pass your message to DrForr.
15:32 zakharyas joined #perl6
15:39 mcmillhj joined #perl6
15:43 unicodable6 joined #perl6
15:45 imcsk8 joined #perl6
15:47 Alikzus joined #perl6
15:51 mcmillhj joined #perl6
16:02 b2gills joined #perl6
16:04 alpha6 joined #perl6
16:06 troys joined #perl6
16:15 Xliff If I have a syntax that has 3 variations of a string: say "STRING1 OPT1"; "STRING1 OPT2"; and "STRING1 OPT3". How would I formulate a grammar so that I can detect the invalid input "STRING1 OPT4", and report that "OPT4" is invalid.
16:16 Xliff Something like...
16:17 [Coke] https://github.com/rakudo/rakudo/blob/master/src/Perl6/Grammar.nqp#L622-L633
16:17 [Coke] there's an example where there's an "or panic" in the token itself.
16:17 jnthn maybe something like: "STRING " [ "OPT1" | "OPT2" | "OPT3" | (\w+) { die "bad $0" }]
16:17 [Coke] (was trying to find a simpler one.)
16:18 MilkmanDan joined #perl6
16:18 [Coke] jnthn++ that's much simpler. :)
16:18 Xliff jnthn++ # So THAT'S what executable blocks in grammars are for!
16:20 moritz Xliff: if you find such things interesting, maybe read my book? :-)
16:20 moritz it explains a few more use cases
16:20 Xliff [Coke]: Are you trying to fry my brain? That grammar is not easy! :P
16:20 Xliff moritz: When I get the money.
16:20 Xliff Is it on Amazon?
16:21 moritz aye, https://smile.amazon.com/dp/1484232275/
16:21 natrys joined #perl6
16:21 moritz you can also get a DRM-free PDF from apress directly
16:21 moritz https://www.apress.com/us/book/9781484232279
16:21 Xliff moritz++ # Added to wishlist.
16:23 Xliff moritz: <!before... and <?before ... give me migraines when I look at them. Please tell me you make those easier to understand.
16:24 timotimo Xliff: "are we before" "are we not before" is how i think of them
16:25 Xliff !before == "not before"
16:25 Xliff ?before == "<query> before"
16:25 Xliff Rather... ?before == "before?"
16:26 Xliff Please tell me that simple mnemonic works.
16:27 timotimo yeah, ? and ! are simply opposites; both mean "zero-length assertion"
16:27 awwaiid joined #perl6
16:27 ZzZombo m: sub x($i(:$a)){say $a};x 1;x :a<2>
16:27 camelia rakudo-moar e72eb01ed: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Shape declaration with () is reserved;␤  please use whitespace if you meant a subsignature for unpacking,␤  or use the :() form if you meant to add signature info to the function's type␤at <tmp>:1…»
16:27 ZzZombo m: sub x(:$i(:$a)){say $a};x 1;x :a<2>
16:27 camelia rakudo-moar e72eb01ed: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Shape declaration with () is reserved;␤  please use whitespace if you meant a subsignature for unpacking,␤  or use the :() form if you meant to add signature info to the function's type␤at <tmp>:1…»
16:28 Xliff timotimo: I get that they are ZLA, but I never picked up on their proper use.
16:28 wamba joined #perl6
16:28 Xliff Time to read up on those, I guess.
16:28 Xliff Especially when reading SQL syntax diagrams.... (yeesh!)
16:29 moritz Xliff: I think look-around assertions are bound to give you headache, no matter how you approach them :(
16:30 ZzZombo m: sub x(i($a)){say $a};x 1;x :a<2>
16:30 camelia rakudo-moar e72eb01ed: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in typename; couldn't find final ')' (corresponding starter was at line 1)␤at <tmp>:1␤------> 3sub x(i(7⏏5$a)){say $a};x 1;x :a<2>␤»
16:30 moritz especially if you do nasty things like .* inside them
16:30 ZzZombo m: sub x(:i($a)){say $a};x 1;x :a<2>
16:30 camelia rakudo-moar e72eb01ed: OUTPUT: «Too many positionals passed; expected 0 arguments but got 1␤  in sub x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:30 ZzZombo m: sub x(:i($a)){say $a};x :a<2>
16:30 camelia rakudo-moar e72eb01ed: OUTPUT: «Unexpected named argument 'a' passed␤  in sub x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:31 Xliff moritz: <sarcasm type="dripping">Thanks for the warning</sarcasm>
16:31 ZzZombo m: sub x(:i($a)){say $a};x :i<2>
16:31 camelia rakudo-moar e72eb01ed: OUTPUT: «2␤»
16:31 ZzZombo what
16:32 Xliff m: sub x(:i($a)){say $a};x :i;
16:32 camelia rakudo-moar e72eb01ed: OUTPUT: «True␤»
16:32 Xliff ZzZombo: :i gets turned into a named parameter.
16:32 [Coke] looks right.
16:33 Xliff m: sub x(:$i){say $i};x :i;
16:33 camelia rakudo-moar e72eb01ed: OUTPUT: «True␤»
16:33 Xliff ^^ Equiv
16:33 ZzZombo How come it doesn't make `a` an alias to `i`?
16:33 Xliff It did.
16:33 [Coke] ... $a is the value of the named parameter.
16:33 ZzZombo m: sub x(:i($a)){say $a};x :a<2>
16:33 Xliff m: sub x(:i($a)){say $a};x :i(<a b c>);
16:33 camelia rakudo-moar e72eb01ed: OUTPUT: «Unexpected named argument 'a' passed␤  in sub x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:33 camelia rakudo-moar e72eb01ed: OUTPUT: «(a b c)␤»
16:34 moritz m: sub x(:i(:$a)){say $a};x :i(<a b c>);
16:34 [Coke] there is no :a, only :i
16:34 camelia rakudo-moar e72eb01ed: OUTPUT: «(a b c)␤»
16:34 ZzZombo m: sub x(:i(:$a)){say $a};x :a<2>
16:34 camelia rakudo-moar e72eb01ed: OUTPUT: «2␤»
16:34 Xliff [Coke]: "There is only Zuul!"
16:34 moritz if you add a : before the $a, then a becomes a possible alias
16:34 ZzZombo NOw there is
16:35 Xliff moritz: Aaaiee! That's hard to read. What's the usecase?
16:35 ZzZombo So I was thinking if it's possible to have a named argument be an alias to a positional, or vice versa.
16:35 Xliff Oh. Nevermind.
16:36 moritz Xliff: short and long options; color and colour. Backwards compat.
16:36 moritz we had that in earlier version of Perl 6
16:36 moritz it was very confusing :-)
16:36 Xliff Yeah. As soon as I asked, I figured it out.
16:36 shareable6 joined #perl6
16:37 benchable6 joined #perl6
16:37 Xliff ZzZombo: If you want to do that, it's better to do as a multi with either the named-arg or the positional version as the canonical method.
16:37 Xliff And the other properly aliasing to that.
16:38 ZzZombo Or how easier you can make custom constructor that accepts a positional and initializes an attribute with it, given you can't directly set one if it's private.
16:41 ZzZombo Currently the way I figured involves calling `bless` with this positional turned into named, and custom `BUILD` to set the private attribute from the passed named parameter, is it how the `Int` and other similar constructors in core do it?
16:43 moritz Int is kinda special, since it uses boxing, which is a concept not exposed to userland
16:44 ZzZombo And another thing that I wonder, why this
16:44 ZzZombo m: sub look{my &m;my $i=2;while !&m && try callframe($i++) -> $f {given $f.code {when Method {say $f.my.map({.key=>.value});&m=$_};when Sub {last}}};$i.say;&m};class A {method m{}};class B is A {method m{my $a=123;look.say}};B.new.m
16:44 camelia rakudo-moar e72eb01ed: OUTPUT: «($_ => (Any) $/ => Nil self => (Mu) %_ => (Mu) $*DISPATCHER => (MethodDispatcher) $! => Nil $a => 123 $¢ => Nil)␤3␤m␤»
16:45 ZzZombo has pretty much everything as its type object?
16:46 ZzZombo Most interesting is `self`, as you can clearly see it's not supposed to be undefined and `Mu` while at that.
16:48 shillo joined #perl6
16:48 shillo p6: say 0.333333333333333333333333333333333333333333333333333333333
16:48 camelia rakudo-moar e72eb01ed: OUTPUT: «0.333333333333333303727386009995825588703155517578125␤»
16:48 jnthn Mu tends to mean "this was optimized away"
16:48 Guest47043 Just here to report an amusing failure to dwim :)
16:49 ZzZombo Uh, huh, bad, bad optimization!
16:50 jnthn ZzZombo: Only things that are declared "is dynamic" can be expected to stick around for instropsection that way
16:50 jnthn If we don't do that, we can't optimize, well, much of anything
16:51 jnthn m: say <0.333333333333333333333333333333333333333333333333333333333>.FatRat
16:51 camelia rakudo-moar e72eb01ed: OUTPUT: «0.333333333333333333333333333333333333333333333333333333333␤»
16:51 moritz m: sy <0.333333333333333333333333333333333333333333333333333333333>
16:51 camelia rakudo-moar e72eb01ed: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    sy used at line 1. Did you mean 'so'?␤␤»
16:51 moritz m: say <0.333333333333333333333333333333333333333333333333333333333>
16:51 camelia rakudo-moar e72eb01ed: OUTPUT: «0.333333333333333333333333333333333333333333333333333333333␤»
16:52 Guest47043 I guess it should print fewer digits if it approximated with lower precision?
16:53 Guest47043 (bummer, somebody took my normal username. Eh... I guess I'll have to start coming as sh1llo
16:53 jnthn There's too many ways to DWIM. We once had it such that Rat had big integer numerator and denominator
16:53 tyil Guest47043: should've regged it :>
16:53 jnthn Turns out that can make certainly kinds of calculation crazily slow
16:54 AlexDaniel Guest47043: actually that looks kinda correct, but we can do better of course
16:54 Guest47043 jnthn: I wish there was a dynamic flag or pragma that I want to DWITY decimals, reading them as floats or doubles unconditionally.
16:55 jnthn If you want them as a double then just stick e0 after the literal
16:55 Guest47043 DWITY is, of course, 'do what I told you' ;) -- yeah, I know. It's not too bad.
16:55 Guest47043 ... I just want to use this acronym on a perl channel :)
16:56 ZzZombo What exactly is under `CALLER::`? What `caller` even stands for? Calling scope?
16:57 Geth ¦ perl6-most-wanted: cb6c8f333a | (Curt Tilmes)++ (committed using GitHub Web editor) | most-wanted/bindings.md
16:57 Geth ¦ perl6-most-wanted: Update bindings.md
16:57 Geth ¦ perl6-most-wanted: review: https://github.com/perl6/perl6-most-wanted/commit/cb6c8f333a
16:58 Guest47043 AlexDaniel: and I agree, it's plausible, I just wondered what I'll get when perl6 reads too many decimals and runs out of tolerance
16:58 Guest47043 AlexDaniel: My expectation was to approximate as 1/3
16:59 Guest47043 AlexDaniel: ... I already assumed it will clam down on precision, just not in this way
17:06 Guest47043 Anyway, need to go. Laters!
17:09 hoelzro_ joined #perl6
17:15 khisanth_ joined #perl6
17:20 statisfiable6 joined #perl6
17:27 Zoffix joined #perl6
17:28 Zoffix Guest14511: it's actually currently a bug. It creates a Rat with denominator over 64bits. You said you wanted it to DWIM. What would that be: create a Num (a float type) instead of a Rat or create a FatRat that could actually hold that precision?
17:28 Zoffix (or die)
17:28 Zoffix Wrong guest...
17:29 Zoffix And the right one left :(
17:36 dogbert17 joined #perl6
17:38 Zoffix Maybe die for literal in code (asking to clarify between FatRat/Rat/Num) and make &val make a FatRat
17:39 Zoffix Or FatRat in both cases if we pass literals through val
17:39 Zoffix RT#132313
17:39 synopsebot RT#132313 [open]: https://rt.perl.org/Ticket/Display.html?id=132313 Rat literal syntax creates Rats with denominators larger than 64 bits
17:40 Zoffix left #perl6
17:48 s0me0n3-unkn0wn joined #perl6
17:51 Geth ¦ doc: 55a94ac30e | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/glossary.pod6
17:51 Geth ¦ doc: add missing acronym
17:51 Geth ¦ doc:
17:51 Geth ¦ doc: add more details later if needd
17:51 Geth ¦ doc: review: https://github.com/perl6/doc/commit/55a94ac30e
17:51 synopsebot Link: https://doc.perl6.org/language/glossary
17:54 mcmillhj joined #perl6
17:56 setty1 joined #perl6
17:57 eroux joined #perl6
18:04 zakharyas joined #perl6
18:06 zakharyas joined #perl6
18:16 SmokeMachine m: multi trait_mod:<is>(Attribute $a, :$bla!) {$a does role :: {method set_value(Mu $obj, Mu \value) {say "HERE"; nextsame}}}; class C {has $.a is rw is bla}; C.new.a = 42 # why it doesn't print HERE?
18:16 camelia rakudo-moar e72eb01ed: ( no output )
18:28 SmokeMachine Is that expected?
18:33 timotimo the default accessor is implemented by returning the container in $!a as a read-writable one
18:33 timotimo it doesn't go through set_value
18:33 mcmillhj joined #perl6
18:33 timotimo but you can use set_value to set a value if all you have is the attribute object
18:41 aindilis` joined #perl6
18:51 b2gills joined #perl6
18:53 SmokeMachine Yes, of course! That’s not the first time I ask that... thank you!
18:57 vike joined #perl6
19:23 squashable6 joined #perl6
19:25 bdmatatu joined #perl6
19:33 mcmillhj joined #perl6
19:41 mcmillhj joined #perl6
19:50 Xliff What is the difference between '<ws>' and '<.ws>' in a grammar?
19:50 * Xliff blames [Coke]
19:50 moritz <ws> captures
19:51 Xliff Yes, moritz++. You have another customer. I just need to get the $$$
19:51 Xliff I will run out of karma to give you if you keep this up. :)
19:54 Xliff moritz: Now explain THIS! https://github.com/rakudo/rakudo/blob/master/src/Perl6/Grammar.nqp#L654-L668
19:55 Xliff :) :) :) :) :)
20:01 moritz Xliff: so, MARKED is basically a cache for whether a <.ws> has matched at the current cursor position before
20:01 moritz in particular, it caches the cursor where it matched
20:02 Xliff Got that part
20:04 moritz the highexpect part stores which of several alternatives are trying to match
20:04 Xliff But what is :dba?
20:04 moritz :dba('whitespace') means "do business as", and just sets the name of the current for reporting in the highwater marks
20:05 Xliff And is there a reason why this is written as self.'!fresh_highexpect'();
20:06 moritz basically interop with NQP
20:06 Xliff Ah! Thanks again, moritz++
20:06 moritz it's a method written in NQP, which intentionally uses a non-identifier name to not be accidentally called from perl 6 code
20:06 Xliff Is that all in your book?
20:06 moritz no :-)
20:06 Xliff LOL!
20:06 Xliff Still getting it, tho.
20:07 moritz that is... way too deep in rakudo guts to be interesting to the general public
20:07 moritz and doesn't fit into 180 pages or so :-)
20:08 Xliff Well, I am trying to build a grammar to parse SQL create statements.
20:08 Xliff Starting with MySQL.
20:08 Xliff Maybe I'll share it with DrForr... 8-)
20:08 moritz so, DDL, basically
20:08 Xliff Y
20:08 Xliff Eventually.
20:09 Xliff It's called "starting small"
20:09 Xliff https://cdn.rawgit.com/GuntherRademacher/ad6a447fdc0d0c331c6ba24cc39882c4/raw/bc69f06fe4eb9f243b69e889657ca8763c6441ab/sql_yacc.xhtml#create
20:11 bdmatatu joined #perl6
20:14 moritz very small :-)
20:14 moritz including DEFAULT <expr>
20:21 zakharyas joined #perl6
20:37 rindolf joined #perl6
20:38 aindilis joined #perl6
20:38 bart__ joined #perl6
20:44 aindilis` joined #perl6
20:55 zeddy__k joined #perl6
20:55 rindolf joined #perl6
21:04 cdg joined #perl6
21:07 cdg_ joined #perl6
21:08 psychoslave joined #perl6
21:14 TEttinger joined #perl6
21:26 Xliff <moritz> including DEFAULT <expr>
21:26 Xliff moritz: ^^ Was that directed at me?
21:28 moritz Xliff: it was a comment on the fact that a CREATE statment needs the full SQL expression grammar
21:28 moritz for example in DEFAULT clauses
21:32 Xliff Ooh. Right.
21:32 Xliff As you have rightly assumed, Happy Hour has long since started. :)
21:33 * Xliff hoists a pint.
21:39 Xliff moritz: Oooooh. The "full SQL expression grammar" finally hit me.
21:39 Xliff I think I can get it. %-)
21:41 Xliff Will grammars handle recursion?
21:45 Xliff Although I don't think MySQL allows you to use "DEFAULT <expr>"
21:46 Xliff It's just "DEFAULT <value>"
21:47 jimav joined #perl6
21:48 Geth ¦ doc/coke/build: 7 commits pushed by (Will "Coke" Coleda)++
21:48 Geth ¦ doc/coke/build: 69b2967448 | clean precompiled directory
21:48 Geth ¦ doc/coke/build: b0666c21a2 | DO NOT MERGE
21:48 Geth ¦ doc/coke/build: 599dea2f53 | use specific 6 version
21:48 Geth ¦ doc/coke/build: b907114b9e | Pull out info on the docs.perl6.org build
21:48 Geth ¦ doc/coke/build: f6586e2600 | Add Build::Dependency to require coffee for highlights
21:48 Geth ¦ doc/coke/build: ef336b9563 | make search a required step
21:48 Geth ¦ doc/coke/build: 6fa464f3b0 | Make disambiguation required
21:48 Geth ¦ doc/coke/build: review: https://github.com/perl6/doc/compare/dd46e5706d...6fa464f3b0
21:49 jimav I've found several doc issues and perhaps code bugs.   Should I file a separte issue/bug for each, or would
21:49 jimav it be better to send the whole list to someone?
21:49 Xliff Separate issues
21:50 Xliff That way it can be distributed.
21:51 jimav Ok, will do.  Thanks.
21:52 Xliff No proble. And thank YOU!
21:55 espadrine joined #perl6
22:00 [Coke] Thank you for asking; if you have small ones like "spelling error", those can be lumped together, but for anything bigger, separate is best. thanks.
22:00 [Coke] Xliff++ jimav++
22:09 bdmatatu joined #perl6
22:15 beatdown joined #perl6
22:18 greppable6 joined #perl6
22:31 Kaiepi joined #perl6
22:47 timotimo Xliff: grammars definitely handle recursion
22:51 mcmillhj joined #perl6
22:55 char_var[buffer] joined #perl6
23:06 mcmillhj joined #perl6
23:09 ZzZombo joined #perl6
23:09 dogbert2 joined #perl6
23:12 buggable New CPAN upload: PowerNap-0.0.2.tar.gz by SAMGWISE https://cpan.metacpan.org/authors/id/S/SA/SAMGWISE/Perl6/PowerNap-0.0.2.tar.gz
23:19 mcmillhj joined #perl6
23:22 buggable New CPAN upload: Music-Engine-0.0.2.tar.gz by SAMGWISE https://cpan.metacpan.org/authors/id/S/SA/SAMGWISE/Perl6/Music-Engine-0.0.2.tar.gz
23:34 mcmillhj joined #perl6
23:43 pochi joined #perl6
23:47 aindilis joined #perl6
23:48 zeddyk joined #perl6
23:51 skids joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo