Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-09-11

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:36 Actualeyes joined #perl6
00:42 snarkyboojum joined #perl6
00:49 aborazmeh joined #perl6
00:49 aborazmeh joined #perl6
00:59 astj joined #perl6
01:02 dalek joined #perl6
01:04 ecocode joined #perl6
01:08 cognominal joined #perl6
01:16 todd joined #perl6
01:16 todd Hi All.  from https://linux.die.net/man/3/termios, how do I use `tcflush`?
01:16 todd tcflush() discards data written to the object referred to by fd but not transmitted, or data received but not read, depending on the value of queue_selector:
01:17 todd int tcflush(int fd, int queue_selector);
01:18 AlexDaniel nativecallable6: int tcflush(int fd, int queue_selector);
01:18 nativecallable6 AlexDaniel, sub tcflush(int32 $fd # int␤ ,int32 $queue_selector # int␤ ) is native(LIB) returns int32 is export { * }
01:18 AlexDaniel todd: ↑ but use newlines instead of ␤
01:19 AlexDaniel wait, maybe I'm too quick to treat this as a nativecall question…
01:19 AlexDaniel todd: what problem are you trying to solve?
01:20 todd 1) What I want to do is to flush anything written to the terminal, but not hang if nothing is there.
01:20 todd 2) then wait for any key on the keyboard to be press, including weird keys
01:20 todd press->pressed
01:21 AlexDaniel do we even have any buffering for stdin/stdout when it's in a terminal?
01:22 todd I have been erading https://github.com/krunen/term-termios, but have no clue what he is doing.  Also his example required two keystrokes to exit and wonb't exit on a return
01:23 todd oh ya, yo press things and they stack up.  Sometimes they show up after perl exits
01:28 Cabanossi joined #perl6
01:28 AlexDaniel todd: hm, I've tried this and it kinda works, almost
01:29 AlexDaniel use Term::termios; my $termios := Term::termios.new(fd => 1).getattr; $termios.unset_lflags(<ECHO ICANON IEXTEN>);; $termios.setattr(:DRAIN); loop { my $x = getc; say $x x 5 }'
01:29 todd testing!
01:29 AlexDaniel todd: termios is needed there because otherwise your terminal will wait for you to type the whole line and press enter
01:30 AlexDaniel se if we really want to process it character by character, we have to tell the terminal that we want to do so
01:33 geekosaur todd, the 2 keypresses thing was explained. you need to set the terminal to either hbinary or atin-1, so rakudo isn't looking for combining characters following the read character
01:34 todd which do I want to use?
01:34 geekosaur because perl 6 considers something like a̋ to be one "character", but it's actually two at unicode level
01:35 geekosaur if you are turning off terminal processing, you probably want binary so you have full control
01:35 skids if you are going to use terminal sequences, then binary.
01:35 todd Okay.  But how do I do that?  I am confused
01:36 todd I thought $termios.makeraw; did that
01:36 geekosaur nom that changes the kernel terminal driver, not perl 6
01:37 todd How do I tell perl6?
01:37 geekosaur currently you have to reopen it in binary mode
01:37 skids "it" being $*IN
01:38 geekosaur $*IN = open('/dev/tty', :bin);
01:38 todd my $c = $*IN.getc;  is what I am using.  Should I put the open commend in front of it?
01:40 todd $*IN = open('/dev/tty', :bin);    my $c = $*IN.getc;
01:40 todd Cannot do 'getc' on a handle in binary mode
01:41 todd what is the binary mode read commnd?
01:42 Guest23973 joined #perl6
01:54 ilbot3 joined #perl6
01:54 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!
02:10 japhb .tell todd Please take a look at Terminal::Print (in particular, Terminal::Print::RawInput and Terminal::Print::DecodedInput).
02:10 yoleaux japhb: I'll pass your message to todd.
02:13 noganex joined #perl6
02:28 Xliff .tell FROGGS I have a few questions about XML::LibXML if you have some time. Particularly about t/02parse.t
02:28 yoleaux Xliff: I'll pass your message to FROGGS.
02:43 Cabanossi joined #perl6
02:53 kyan joined #perl6
03:11 zakame joined #perl6
03:13 Cabanossi joined #perl6
03:14 Geth ¦ doc: 83e4e30318 | (Rafael Schipiura)++ (committed using GitHub Web editor) | doc/Type/Failure.pod6
03:14 Geth ¦ doc: Update Failure.pod6
03:14 Geth ¦ doc: review: https://github.com/perl6/doc/commit/83e4e30318
03:18 TimToady joined #perl6
03:34 Geth ¦ doc: 5fb8ee8fc5 | (Rafael Schipiura)++ (committed using GitHub Web editor) | doc/Type/Failure.pod6
03:34 Geth ¦ doc: Update Failure.pod6
03:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/5fb8ee8fc5
03:42 Cabanossi joined #perl6
03:58 Xliff m: class A { method foo(Int $i where 1 | 0) { say ‘hello’ }; }; say A.new.foo(0) ;
03:58 camelia rakudo-moar 7da0c2: OUTPUT: «hello␤True␤»
03:59 Xliff m: class A { method hyphen-name(Int $i where 1 | 0) { say ‘hello’ }; }; say A.new.hyphen-name(0) ;
03:59 camelia rakudo-moar 7da0c2: OUTPUT: «hello␤True␤»
04:00 Xliff m: class A { multi method hyphen-name(Bool $b) { }; multi method hyphen-name(Int $i where 1 | 0) { say ‘hello’ }; }; say A.new.hyphen-name(0) ;
04:00 camelia rakudo-moar 7da0c2: OUTPUT: «hello␤True␤»
04:00 Xliff m: class A { multi method hyphen-name(Bool $b) { }; multi method hyphen-name(Int $i where 1 | 0) { say ‘hello’ }; }; say A.new.hyphen-name(2) ;
04:00 camelia rakudo-moar 7da0c2: OUTPUT: «Cannot resolve caller hyphen-name(A.new: 2); none of these signatures match:␤    (A $: Bool $b, *%_)␤    (A $: Int $i where { ... }, *%_)␤  in block <unit> at <tmp> line 1␤␤»
04:09 armin joined #perl6
04:09 todd ".tell todd Please take a look" copied it down.  toddandmargo@zoho.com
04:09 yoleaux 02:10Z <japhb> todd: Please take a look at Terminal::Print (in particular, Terminal::Print::RawInput and Terminal::Print::DecodedInput).
04:18 geekosaur that's the one I pointed you at a couple days go; guess it got merged :)
04:19 todd https://github.com/ab5tract/Terminal-Print/blob/1c05a17dd0390447d5a26da29467729d5803bea8/examples/raw-input.p6
04:19 raschipi joined #perl6
04:35 piojo joined #perl6
04:37 japhb todd: Do you have questions?  RawInput and DecodedInput are my code.
04:38 japhb (As well as the associated examples, including tris.p6)
04:46 araraloren_fake joined #perl6
04:46 araraloren_fake good noon
04:58 wamba joined #perl6
05:03 todd Yes,  I want to dump the buffer.  Then wait for any key on the keyboard to be pressed (even the weird ones).  The example would be great, but after the buffer was dumped.  I can not figure out how to dump the buffer.
05:03 todd where is tris.pl6?
05:10 todd Found tris.pl6: https://github.com/ab5tract/Terminal-Print/blob/1c05a17dd0390447d5a26da29467729d5803bea8/examples/tris.p6
05:11 todd nt seeing how to dump the keyboard buffer in tris.pl6.  :'(
05:22 domidumont joined #perl6
05:23 Exodist joined #perl6
05:27 xtreak joined #perl6
05:27 domidumont joined #perl6
05:36 japhb Dump the buffer?  You mean empty it of pending keystrokes?
05:37 todd Yes.  But .......... if there are no keystrokes, do not hang/
05:38 todd Maybe a better way of saying it would be to "clear strin"
05:39 todd "clear stdin"  (Stinking typos)
05:41 todd In "C", it looks like : int c; while((c = getchar()) != '\n' && c != EOF);
05:43 japhb I don't think that's necessary.  I think all that's needed is to change :DRAIN to :FLUSH in https://github.com/ab5tract/Terminal-Print/blob/master/lib/Terminal/Print/RawInput.pm6#L17
05:43 japhb I could just support that as an option to raw-input-supply.
05:44 todd line 17?: Term::termios.new(:$fd).getattr.makeraw.setattr(:FLUSH);   ??
05:44 japhb Yeah.  If that works for you, I can just add it as an optional arg to the whole function.
05:45 todd testing
05:49 todd YIPPEE!   Thnak you!  Perfect!
05:49 japhb OK, cool, I'll add that option.
05:50 todd Kaisen (constant improvement) in action!
05:55 xtreak joined #perl6
05:57 xtreak joined #perl6
06:03 japhb todd: 0.93 now available.
06:05 andrzejku joined #perl6
06:08 japhb OK, about time to call it for the night.
06:09 japhb todd: If you have any other questions/requests, please .tell me since I only skim this channel and might miss it otherwise.
06:12 silug joined #perl6
06:20 nadim joined #perl6
06:21 domidumont joined #perl6
06:27 Cabanossi joined #perl6
06:29 domidumont joined #perl6
07:06 Lasse joined #perl6
07:07 darutoko joined #perl6
07:21 jonas1 joined #perl6
07:25 eliasr joined #perl6
07:27 todd no new questions.  I am cleaning ujp my example so that it makes sense to me
07:27 todd Thank you!
07:27 Cabanossi joined #perl6
07:28 xtreak joined #perl6
07:28 xtreak joined #perl6
07:33 zakharyas joined #perl6
08:08 shmibs joined #perl6
08:08 dogbert2 joined #perl6
08:08 tony-o joined #perl6
08:12 Cabanossi joined #perl6
08:14 xtreak joined #perl6
08:32 cgfbee joined #perl6
08:33 leont joined #perl6
08:41 mr-foobar joined #perl6
09:04 Skarsnik joined #perl6
09:09 samcv m: my $value = True; $value++; say $value
09:09 camelia rakudo-moar 0ca5ff: OUTPUT: «True␤»
09:09 ggoebel joined #perl6
09:10 samcv m:  my $value = False; $value++; say $value
09:10 camelia rakudo-moar 0ca5ff: OUTPUT: «True␤»
09:10 lizmat m: my $value = True; $value--; say $value
09:10 camelia rakudo-moar 0ca5ff: OUTPUT: «False␤»
09:10 lizmat basically a consequence of:
09:11 lizmat m: say +True; say +False
09:11 camelia rakudo-moar 0ca5ff: OUTPUT: «1␤0␤»
09:11 lizmat with some magic added :-)
09:11 margeas joined #perl6
09:15 sproctor joined #perl6
09:23 wamba joined #perl6
09:28 Cabanossi joined #perl6
09:40 integral joined #perl6
09:40 integral joined #perl6
09:58 Cabanossi joined #perl6
10:08 raydiak__ joined #perl6
10:10 rindolf joined #perl6
10:11 xtreak joined #perl6
10:22 jonathon joined #perl6
10:23 jonathon hi! getting an error compiling moarvm=2017.08.1, "'MP_GEN_RANDOM_MAX' undeclared (first use in this function)" -> https://bpaste.net/show/bf22dff0e266
10:24 jonathon doing a grep the only reference to MP_GEN_RANDOM_MAX is the comparison on line 950 of math/bigintops.c
10:24 Skarsnik hm weird
10:25 Skarsnik What os ?
10:25 ilmari jonathon: did you do 'git submodule init'?
10:25 ilmari that's provided by 3rdparty/libtommath/tommath.h
10:26 jonathon ah
10:26 jonathon cool :)
10:26 ShalokShalom_ joined #perl6
10:26 jonathon let me try again
10:26 ilmari Configure.pl should do that for you, though
10:27 ilmari are you using a git checkout, or did you get the moarvm source some other way?
10:27 Cabanossi joined #perl6
10:27 jonathon i'm building a Debian/Ubuntu package, so libtommath would explain it
10:29 ilmari if you want to to use the system versions of the bundled libraries, you need to use the various --has-foo options to configure
10:31 Skarsnik was there a perl6-toolchain channel for these question?
10:34 breinbaas joined #perl6
10:35 jonathon there is indeed a #perl6-toolchain, i didn't know about that one :)
10:35 jonathon but i think the pointer to libtommath was all i needed
10:36 jonathon yup, i didn't have a new-enough libtommath1 in by chroot, moarvm has built correctly this time
10:36 jonathon so thank you! :)
10:49 Ptolemarch joined #perl6
10:53 llfourn joined #perl6
11:08 nadim joined #perl6
11:09 wamba joined #perl6
11:36 daxim <https://p6steve.wordpress.com/2017/08/18/perl6-really/>  when he writes: "demand for p6 is pent up", what is the intended meaning? "demand cannot be expressed"? "there is demand"? "there is no demand"?
11:36 yoleaux 4 Sep 2017 12:02Z <Zoffix> daxim: what browser is that on do you have any user styles enabled? I can't repro your issue
11:36 yoleaux 4 Sep 2017 12:11Z <Zoffix> daxim: nevermind, your browser just has custom font size set. I reverted the commit
11:37 scovit joined #perl6
11:38 jonathon if you read it as "pent up demand" it makes a little more sense
11:38 jonathon (as in, "pent up frustration")
11:44 skids joined #perl6
11:46 rindolf joined #perl6
11:46 scovit Hello, let's say you are making a module named A::B, if you put a symbol C "is export" in A::B, then you 'use A::B', and you can either directly type C, or the long version A::B::C. Correct?
11:47 scovit what if I would like that A::B export the symbol in A, so that it can be accessed only by either A::C or A::B::C ?
11:47 awwaiid joined #perl6
11:47 timotimo A::B::C will only work if C is declared "our", i think
11:48 scovit timotimo, I am wondering if it is possible to create something akin to C++ namespaces
11:48 Skarsnik why would you want annoying c++ namespace? x)
11:49 scovit Skarsnik because otherwise people will have to type A::B::C
11:49 timotimo stuff that gets merged from anywhere and you can open and close them inside your files?
11:49 scovit while B is just a silly name
11:49 timotimo oh, so more the "using namespace" thing
11:49 Skarsnik What I would have wanted if more java package. where you can have stuff accessible to a whole package but not other code
11:50 scovit Skarsnik sorry don
11:50 scovit 't know that language
11:52 Skarsnik well you can have stuff that are private to a whole package. Like if you have a package Foo. you can have class/variable available for everything in Foo but not outside the package.
11:53 scovit Skarsnik I can imagine that can be useful, too..
11:54 Skarsnik That why I don't like much C++ namespace, they don't provide much aside anti name collision
11:55 leont Yeah I miss «using namespace», or «using» in general
11:56 scovit but a using namespace in perl6 you already have antiname collision, namespaces would provide syntesis of names and regrouping
11:57 scovit protection from external access is orthogonal to that
11:57 Cabanossi joined #perl6
11:57 Skarsnik I hope name collision get better warning. I remember defining a class map; and somewhere was a using namespace std; the warning was rather bad xD
11:57 Skarsnik well error
11:58 Skarsnik But I stopped doing C++ outside along with Qt
11:59 AlexDaniel joined #perl6
12:05 scovit I'm a fan of C++. I am here asking because I have the impression that with Perl6 I need to choose between the C way of things: long variables names namespace-object-action or some silly namespace1-namespace2-namespace3-action. But I suspect there is also a more perlish way of doing...
12:06 scovit namespace1::namespace2::namespace3::action I mean
12:08 Skarsnik It's more about what you want to expose
12:09 scovit let's suppose that namespace1 is "Qt" and namespace2 is "NativeCall". (no namespace3). I would be tempted to rename "namespace2" as "NC" just so that I dont have to retype the whole "NativeCall" everytime
12:10 scovit or make everyting Qt-object-action by exporting everything in Qt::NativeCall
12:10 scovit for sure I cannot keep Qt::NativeCall. It totally misses the important information (Qt)
12:10 scovit while I would be happy to keep it in just Qt::
12:12 Skarsnik hm. Not sure how you can import symbol from a sub module
12:12 ignis joined #perl6
12:12 scovit Skarsnik that whole file -> symbol thing seems superunflexible to me
12:12 Skarsnik maybe if you have access to the EXPORT array like in Perl 5
12:12 MasterDuke scovit: i think you can do something like 'my constant QtNC = Qt::NativeCall', which would at least reduce the number of characters to type
12:13 someuser joined #perl6
12:13 scovit MasterDuke interesting
12:15 MasterDuke i'm not sure exactly how to do it, but i'm pretty sure jnthn++ has showed examples before
12:15 Skarsnik scovit, https://docs.perl6.org/language/modules#UNIT::EXPORT::*
12:16 ChoHag joined #perl6
12:17 xtreak joined #perl6
12:19 samcv this isn't working for me:
12:19 samcv use JSON::Fast:ver<0.4..*>;
12:19 samcv even though i have a newer version than that. use JSON::Fast works fine
12:20 samcv i have JSON::Fast:ver('0.9.2')
12:21 samcv that is maybe the wrong notation? but it's used in JSON::Marshal and JSON::Class and i can't install anything for whatever reason
12:21 samcv ugh
12:23 MasterDuke samcv: is your zef up to date? i thought there were some recent updates to it about version comparisons
12:23 samcv i just updated it
12:23 samcv it's perl6 that is doing it thuogh
12:23 samcv use JSON::Fast:ver<0.4..*>
12:23 samcv doesn't work
12:23 samcv and that's used in the module
12:26 samcv MasterDuke, does that work on your machine?
12:28 MasterDuke samcv: yep
12:28 samcv huh
12:29 samcv where do you install your perl6
12:29 MasterDuke in my home
12:29 samcv in ~/.perl6 or somewhere else
12:30 MasterDuke ~/Source/perl6/install/...
12:30 samcv i'm gonna flush my perl6 install directory and try reinstalling
12:30 samcv i have no clue what's going on
12:30 samcv if that doesn't work 'ill dump zef's
12:30 SHODAN joined #perl6
12:30 samcv or maybe i should try thta first
12:31 MasterDuke samcv: JSON::Fast isn't installed with zef on the machine i just tested with
12:31 MasterDuke i just used -I and pointed to a git checkout
12:31 samcv oh
12:31 samcv well any other versioned module i guess. it's not working on me for any of them
12:32 samcv at least using that syntax
12:32 samcv well. ok dumping perl6 install folder and losing my insteled modules. then gonna retry
12:35 zakharyas joined #perl6
12:51 mcmillhj joined #perl6
12:53 araraloren_fake joined #perl6
12:54 jeromelanteri joined #perl6
12:55 Skarsnik_ joined #perl6
12:57 Cabanossi joined #perl6
13:04 sproctor joined #perl6
13:04 jonathon where's the best place/channel to ask about zef behaviour?
13:05 ChoHag joined #perl6
13:05 jonathon (it's picking up the flags moarvm was compiled with, need to know if it should be doing that, so i need to add some dependencies to its package, or if it shouldn't be)
13:07 lizmat #perl6-toolchain probably
13:07 jonathon ta
13:13 cdg joined #perl6
13:16 pmurias joined #perl6
13:16 pmurias samcv: is ucd2c.pl something that will be replaced by Perl 6 or should I change it?
13:16 scovit Almost there, now I get this error 'P6M Merging GLOBAL symbols failed: duplicate definition of symbol sajsadh', does it says anything to you?
13:17 scovit I make a package, then use a package that uses that package
13:17 samcv pmurias, well eventually i am replacing it with perl 6
13:17 samcv depends what you're trying to change/edit
13:18 pmurias samcv: I want to remove the property values aliases out of the list of property names
13:18 pmurias the ucd2c.pl script seems to also parse comments from the property aliases file :/
13:19 samcv well do you mean it doesn't parse and puts it into the data cause i know that issue
13:19 samcv but it parses things after the # so it can make L/Letter = L*
13:19 samcv for example
13:20 pmurias what is that used for?
13:20 samcv m: say "hi" ~~ /<:L>/
13:20 camelia rakudo-moar 760530: OUTPUT: «「h」␤»
13:20 samcv m: say "h".uniprop
13:20 camelia rakudo-moar 760530: OUTPUT: «Ll␤»
13:20 samcv so anything L will match that
13:21 samcv you're trying to change unicode_property_keypairs?
13:21 pmurias yes
13:22 samcv To remove property aliases? well you can't remove some of them. like for Script or for general categories aliases. why are you trying to remove them?
13:23 pmurias I want to remove the property value aliases
13:23 samcv so it doesn't resolve with unipropcode ?
13:24 samcv i wouldn't do that. it'll break unimatch
13:25 pmurias I can fix unimatch once the nqp::unipropcode is no longer crap
13:25 samcv how are you going to fix it?
13:25 samcv create some new data structure to hold property values?
13:26 samcv i mean i'd like to have some opcode that returns an array of propcodes associated with a property value
13:27 samcv though i guess you could solve it from rakudo but. that's going to be a lot slower
13:27 pmurias I can look it up in all properties
13:27 samcv what do you mean by that?
13:28 samcv check every single property?
13:28 samcv that's pretty wasteful?
13:30 samcv pmurias, what's your end goal, what are you trying to achieve? you're trying to get certain things working on the JVM right? that is your goal?
13:34 samcv and if you want code to make something nqp level for jvm or something or want to play around, i wouldn't use ucd2c.pl i would use this: https://github.com/samcv/Unicode-Grant/tree/master/t
13:35 nadim joined #perl6
13:39 samcv i am going to be using those libs for my rewrite of the moarvm unicode database when that happens. i mean i think you should implement it using java, and not mess with moarvm until we figure out how we want to change the opcodes.we'll get the best performance if we have java code that does it on the jvm and c code on moarvm. though i'm all for sharing the code to generate some of it between VM's
13:39 pyrimidi_ joined #perl6
13:40 samcv .tell pmurias i am going to sleep now. i'll talk with you more about this tomorrow. looks like you got disconnected, but check the log for my full response
13:40 yoleaux samcv: I'll pass your message to pmurias.
13:44 scovit Cannot import symbol A from B::A, because it already exists in this lexical scope. Is there a way to merge packages and check for conflicts inside?
13:50 skids joined #perl6
13:50 pmurias joined #perl6
13:55 nic20 joined #perl6
13:56 nic20 Hello \o
13:57 Cabanossi joined #perl6
13:59 araujo joined #perl6
14:01 astj joined #perl6
14:07 nic20 Anyone know of a way to get the IP address of a request in Bailador?
14:08 maettu joined #perl6
14:10 maettu_ joined #perl6
14:10 astj joined #perl6
14:11 Skarsnik_ joined #perl6
14:13 Skarsnik__ joined #perl6
14:15 Kyo91_ joined #perl6
14:30 Kyo91 joined #perl6
14:31 maettu_ joined #perl6
14:33 sena_kun joined #perl6
14:39 tphblu joined #perl6
14:40 domidumont joined #perl6
14:43 wamba joined #perl6
14:45 maettu joined #perl6
14:50 rindolf joined #perl6
14:52 domidumont joined #perl6
14:53 tyil moritz, timotimo: my Bailador issue was due to an old code sample I copied, baile() doesnt accept arguments, it should be set in config.port
14:55 timotimo oh, huh!
14:55 timotimo that's a very bad failure mode :)
14:57 bdmatatu joined #perl6
14:57 Cabanossi joined #perl6
15:00 ruoso___ joined #perl6
15:03 khw joined #perl6
15:27 Cabanossi joined #perl6
15:36 kerframil joined #perl6
15:41 troys joined #perl6
15:43 smls joined #perl6
15:44 smls m:  my &a = (++$ + *).say;  a 0;  a 0;  a 0;
15:44 camelia rakudo-moar 760530: OUTPUT: «1␤2␤3␤»
15:44 smls This is intended, right?
15:44 smls i.e. that the ++$ operation becomes part of the WhateverCode, and isn't evaluated only once.
15:49 jnthn Yeah, if the + is being whatever-curried then the LHS is going to be pulled into the thunk as a whole
15:49 jnthn It's a compile-time transform
15:49 smls Ok, that means I can close another RT... :P
15:50 piojo joined #perl6
15:51 ruoso___ Hey jnthn... is there a known issues with proto rules and Grammar::Debugger?
15:53 ruoso___ I couldn't quite reduce it to a small-enough test case yet, but in complex grammars, it seems it ends up trying to invoke a null moar object
15:55 jsimonet m: my %data; dd %data{'foo'}:exists;
15:55 camelia rakudo-moar 760530: OUTPUT: «Bool::False␤»
15:56 jsimonet m: my %data; if True && %data{'foo'}:exists { }
15:56 camelia rakudo-moar 760530: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤You can't adverb &infix:<&&>␤at <tmp>:1␤------> 3my %data; if True && %data{'foo'}:exists7⏏5 { }␤    expecting any of:␤        pair value␤»
15:56 ugexe precedence
15:56 jsimonet ok, so it is normal ?
15:56 ugexe m: my %data; if True && (%data{'foo'}:exists) { }
15:56 camelia rakudo-moar 760530: ( no output )
15:56 ruoso___ Cannot invoke this object (REPR: Null; VMNull) on https://github.com/jnthn/grammar-debugger/blob/master/lib/Grammar/Debugger.pm6#L116
15:56 ugexe yes
15:56 jsimonet It's weird :)
15:57 ugexe : is really loose
15:57 ugexe i never really use :exists that much because of that
15:58 dzove855 (2
15:58 jnthn ruoso___: Not aware of a specific issue in that area, no. Though I haven't touched it since the Cursor/Match unification, so it's possible that (or something else) has thrown it off
15:59 ruoso___ Ok... whenever I try to write a reduced version it doesn't show up
16:00 perlpilot ugexe: maybe you should be using `and` instead of `&&`  ;-)
16:01 jsimonet ugexe: ok. Is it usefull to add something in the doc ? (https://docs.perl6.org/type/Hash#:exists)
16:02 ugexe jsimonet: its all adverbs
16:02 Ven`` joined #perl6
16:03 ugexe perlpilot: thats probably better than what I usually do (.EXISTS-KEY)
16:04 perlpilot ugexe: indeed.
16:04 perlpilot jsimonet: I think it should be documented somewhere if it's not already.  Though I'd expect it in https://docs.perl6.org/language/traps
16:05 perlpilot oh, and it's there ... https://docs.perl6.org/language/traps#Adverbs_and_Precedence  but maybe that could use a few more examples or some more words about the problem.
16:05 ugexe m: my @data; if True && @data[0]:exists { }; # not just hashes
16:05 camelia rakudo-moar 760530: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤You can't adverb &infix:<&&>␤at <tmp>:1␤------> 3my @data; if True && @data[0]:exists7⏏5 { }; # not just hashes␤    expecting any of:␤        pair value␤»
16:07 perlpilot jsimonet: a link from everywhere that mentions specific adverbs back to that section on traps would be nice too.
16:07 jsimonet perlpilot: maybe :)
16:08 jsimonet perlpilot: yep, it would be nice !
16:10 skids joined #perl6
16:21 cdg joined #perl6
16:23 piojo_ joined #perl6
16:24 mcmillhj joined #perl6
16:25 dogbert17 joined #perl6
16:27 Cabanossi joined #perl6
16:28 hobbs joined #perl6
16:28 hobbs joined #perl6
16:33 nicq20 joined #perl6
16:35 mcmillhj joined #perl6
16:35 maettu left #perl6
16:35 grondilu joined #perl6
16:36 maettu_ q
16:36 domidumont joined #perl6
16:40 piojo joined #perl6
16:44 shadoxx joined #perl6
16:45 pyrimidine joined #perl6
16:48 pyrimidi_ joined #perl6
16:50 mcmillhj joined #perl6
16:50 pyrimidine joined #perl6
16:52 pmurias joined #perl6
16:53 piojo joined #perl6
16:53 eroux joined #perl6
16:58 robertle joined #perl6
16:58 Cabanossi joined #perl6
16:58 mcmillhj joined #perl6
17:00 riatre joined #perl6
17:21 cdg joined #perl6
17:33 Kyo91 joined #perl6
17:34 kc0tjtn joined #perl6
17:38 ggoebel joined #perl6
17:44 zakharyas joined #perl6
17:46 mcmillhj joined #perl6
17:50 skids RT#124486 can be closed, if someone has the time/access to do so.
17:50 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=124486
17:53 perlpilot skids: can you put a comment on the ticket with the appropriate test output that shows why it may be closed?
17:56 skids perlpilot: I cannot.  It's one of those tickets that won;t let me do anything to it.
17:56 Lac123 joined #perl6
17:57 skids c73ee308 is the roast commit.
18:00 Lac123 I'm teaching myself Perl6 grammar.  I can't find a way to do the following:  allow a cmd to take several different optional parameters in any order but only once per parameter.  e.g. allow "CMD A B C" and "CMD B A" but not "CMD A B A".  What am I missing? (Obviously I could code every combination, but that seems longwinded).
18:01 Skarsnik probably not the job of the grammar
18:01 Skarsnik but what come after?
18:01 Lac123 do you mean termination character?  or do you mean code-wise?
18:02 Skarsnik I don't know enought about grammar and language. but it's probably the part that came after to see that your 3 parameter are not valid?
18:05 Lac123 well I was just hoping for a parse fail.   Thinking about it, maybe I could have action methods that set and check a boolean flag per parameter and then force a fail (somehow).  I just thought I was missing a way of capturing it in the grammar alone.  I've not got on to the action stuff yet.
18:06 skids Lac123: I have not found a good way to do that in-grammar.
18:07 skids I wrote https://gist.github.com/skids/d1552470ba7c4ca6d318 two years ago, but maybe things have improved since then.
18:09 perlpilot Lac123: "flag per parameter" sounds wrong unless you mean in the sense that you have a hash-like thing.
18:09 perlpilot (or set)
18:12 Lac123 skids: thank you, looks relevant, I'll read it thru
18:13 Cabanossi joined #perl6
18:13 skids ISTR someone also made a pretty good suggestion about adding a phaser that can trigger when an in-regex closure block gets backtracked over.
18:15 Lac123 i did trip over something that  might be relevant if I fully understood it ("The Perl 5 ?...? syntax (succeed once) was rarely used and can be now emulated more cleanly with a state variable: $result = do { state $x ||= m/ pattern /; }    # only matches first time"
18:21 Lac123_ joined #perl6
18:21 lancew joined #perl6
18:24 Kyo91 joined #perl6
18:27 cdg joined #perl6
18:28 setty1 joined #perl6
18:32 wamba joined #perl6
18:35 andrzejku joined #perl6
18:42 pyrimidine joined #perl6
18:47 pyrimidine joined #perl6
18:51 pyrimidine joined #perl6
18:54 pyrimidine joined #perl6
18:56 ggoebel joined #perl6
18:57 Cabanossi joined #perl6
19:00 pyrimidine joined #perl6
19:07 AlexDaniel joined #perl6
19:08 pyrimidine joined #perl6
19:11 cdg joined #perl6
19:18 espadrine joined #perl6
19:20 cdg joined #perl6
19:20 hoelzro joined #perl6
19:21 robertle joined #perl6
19:23 hankache joined #perl6
19:23 hoelzro o/ #perl6
19:23 hoelzro long time no see!
19:24 kyan joined #perl6
19:24 timotimo yo ro
19:24 lizmat hoelzro o/
19:24 hoelzro I see you have all been very busy =)
19:25 hoelzro o/ timotimo, lizmat
19:26 Kyo91 joined #perl6
19:26 tyil anyone knows how to get the request headers in bailador?
19:26 hoelzro so I have a quick question about a secret project (actually I have many questions) - does IO::Handle.getc implement a sort of "look ahead" buffer that would cause unbuffered results to lag a character behind what is typed?
19:27 lizmat hoelzro: if it's in utf-8 encoding, yes I believe
19:27 hoelzro ahhh
19:27 hoelzro that explains what I'm seeing, then
19:27 Cabanossi joined #perl6
19:27 hoelzro thanks lizmat!
19:28 lizmat yw, just passing on what I learned from I believe timotimo earlier today
19:28 hoelzro transitive thanks to timotimo, then =)
19:28 jnthn hoelzro: Yes, it's for the sake of NFG; we can't spit out a grapheme until we know the next codepoint doesn't join with the current ones we've seen
19:28 hoelzro ahhhhhhh
19:29 hoelzro well, that will make what I'm trying to do a lot more interesting
19:29 jnthn It's not specific to the UTF-8 decoder, though yes, that is where you're most likely to encounter the behavior, as latin-1 and ascii know that the only combining thing they have is \r\n
19:32 hoelzro thanks to you as well, jnthn!
19:32 pecastro joined #perl6
19:34 hoelzro so my next question is about creating NativeCall equivalents to static buffers in C structs - ex. struct termios { ... uint8_t c_cc[32]; }
19:35 skids commit: releases :a(Bool).perl
19:35 committable6 skids, ¦releases (22 commits): «»
19:35 hoelzro using CArray[uint8] doesn't work because that's heap allocated - is there a way to do this other than has uint8 $.c_cc0; has uint8 $.c_cc1; etc?
19:36 jnthn hoelzro: I kept meaning to get to https://github.com/MoarVM/MoarVM/pull/577 which I believe aims to do that... So many things and so little time :S
19:36 skids commit: releases :a(Bool).perl.say
19:36 committable6 skids, ¦2015.12,2016.01.1,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1,2016.09,2016.10,2016.11,2016.12,2017.01,2017.02,2017.03,2017.04.3,2017.05: «:!a» ¦2017.06,2017.07,2017.08,HEAD(760530a): «:a(Bool)»
19:36 jnthn Oh wait
19:36 jnthn That's the wrong way around for what you want
19:37 jnthn that's flat structs in an array
19:37 jnthn You want flat array in structs
19:37 hoelzro yup!
19:37 hoelzro I'm currently just unrolling by hand and providing a method to proxy the array's contents - it's ugly but it works
19:37 Xliff I had to do that as well
19:38 Xliff \o hoelzro
19:39 timotimo if you're doing stuff with termios, have you looked at Terminal::Print?
19:39 hoelzro o/ Xliff
19:39 * hoelzro looks
19:42 TEttinger joined #perl6
19:55 kyan joined #perl6
19:57 Cabanossi joined #perl6
20:07 perlpilot joined #perl6
20:08 sftp joined #perl6
20:13 nohuhu joined #perl6
20:16 DrParis_ joined #perl6
20:17 timeless_ joined #perl6
20:18 lumimies_ joined #perl6
20:18 PotatoGim_ joined #perl6
20:19 freeze_ joined #perl6
20:19 Brock joined #perl6
20:19 brimonk_ joined #perl6
20:19 kubrat_ joined #perl6
20:19 plicease_ joined #perl6
20:19 mithaldu__ joined #perl6
20:22 ccakes_ joined #perl6
20:22 charsbar_ joined #perl6
20:22 sftp_ joined #perl6
20:23 cdg joined #perl6
20:26 dg joined #perl6
20:27 lancew joined #perl6
20:28 hoelzro is there a simple way to make a byte-for-byte copy of a CStruct?
20:29 timotimo define a memset native sub that takes that struct :P
20:29 timotimo and use nativesizeof to get the right number of bytes
20:29 Skarsnik hm $var = $var2 should do a copy? x)
20:29 hoelzro that's kinda what I figured - thanks timotimo!
20:30 timotimo Skarsnik: not for CStruct; this is perl6, not C
20:30 timotimo hm. does assignment copy structs in C?
20:30 timotimo maybe only in the newer C versions?
20:30 Skarsnik yes
20:30 pm51 joined #perl6
20:31 JimmyZ joined #perl6
20:31 timotimo i mean, we totally could support assignment from struct to struct, but our structs are usually in scalar containers which means you'll get the store functionality of the scalar rather than what the cstruct could do
20:31 Skarsnik haha
20:31 Skarsnik static void copy_to(MVMThreadContext *tc, MVMSTable *st, void *src, MVMObject *dest_root, void *dest) {
20:31 Skarsnik MVM_exception_throw_adhoc(tc, "cloning a CStruct is NYI");
20:31 timotimo that seems like too much magic
20:31 timotimo oh, right, .clone
20:31 timotimo that makes a whole lot more sense
20:31 leedo joined #perl6
20:32 Skarsnik should be possible to have a cline actually
20:32 Skarsnik maybe it's not good for the GC?
20:32 timotimo why would the gc complain?
20:32 gdonald joined #perl6
20:32 Skarsnik Dunno. I have no idea how it work
20:33 wictory[m] joined #perl6
20:33 Skarsnik I feel it should not be hard to implement clone
20:33 timotimo yeah
20:33 ilmari[m] joined #perl6
20:34 hoelzro timotimo: I think it *does*, but I don't know if that's C89 behavior
20:34 Skarsnik since like the code in nativecall_refresh manage to go through each field addr
20:34 timotimo we still need something to track ownership, though, right?
20:35 hoelzro I think part of it might be that parts of the struct might be referring to things that shouldn't have duplicate reference
20:35 Skarsnik There is probably a managed attribute like for CArray
20:35 Kyo91 joined #perl6
20:35 hoelzro since it's the wild wild west in there
20:35 Skarsnik Well ptr value are copied
20:35 teatime afaik struct assignment is fine in C
20:35 teatime obv. it is not a deep clone
20:35 timotimo hoelzro: all cloning we do is shallow
20:36 hoelzro right
20:36 timotimo Skarsnik: oh, do we actually have a managed attribute for those. neat
20:37 timotimo that decides whether it'll grow the underlying storage blob with realloc if we access something "out of bounds"?
20:37 hoelzro I would just guess that instead of assuming that cloning works fine for *all* the structs, just report it as an error and have the user figure out the proper way to clone them
20:37 timotimo i wouldn't say that
20:37 Skarsnik https://github.com/MoarVM/MoarVM/blob/master/src/6model/reprs/CStruct.h hm does not seems CStruct has this
20:37 timotimo it's quite a useful thing to have, and the user shouldn't be expecting anything different from how other things clone
20:38 timotimo i recently got a mean double-free from casting from a pointer to a carray and then casting the carray to a carray of different type or something like that
20:39 Skarsnik hu
20:39 silug joined #perl6
20:40 hoelzro every time I see "carray" I think "harry caray" =P
20:41 Skarsnik I had issue when trying to use typed pointer in gumbo and doing .unref instead of calling nativecast directly (was a long time ago) maybe ncast is not that safe?
20:42 tbrowder .tell timotimo using perl6-debug did the trick--i had stopped wrking on some old code in a hurry and left an incomplete statement with an open '<' at the end of a line which caused the problem. thanks!
20:42 yoleaux tbrowder: I'll pass your message to timotimo.
20:42 leah2 joined #perl6
20:44 timotimo interesting. good to know!
20:44 yoleaux 20:42Z <tbrowder> timotimo: using perl6-debug did the trick--i had stopped wrking on some old code in a hurry and left an incomplete statement with an open '<' at the end of a line which caused the problem. thanks!
20:46 mcmillhj joined #perl6
20:50 skids hoelzro: https://image.slidesharecdn.com/evolutionofprogramminglanguages-130805081903-phpapp01/95/evolution-of-programming-languages-47-638.jpg <-- probably why.
20:50 Caelum joined #perl6
20:54 Skarsnik C is a good portable assembler x)
20:54 zacts joined #perl6
20:56 Skarsnik skids, do you have the link to this presentation?
20:56 cdg joined #perl6
20:57 Cabanossi joined #perl6
21:10 smls .seen TimToady
21:10 yoleaux I saw TimToady 17:55Z in #perl6-dev: <TimToady> of course, we could always just say it's a DIHWIDT if 'native' comes too early too
21:10 smls .tell TimToady Is it intended that LTM prefers \d and <[0..9]> over <digit> and <:Number>, as a tie-breaker? (re. RT #130612)
21:10 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=130612
21:10 yoleaux smls: I'll pass your message to TimToady.
21:10 u-ou joined #perl6
21:14 smls_ joined #perl6
21:18 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/09/11/2017-37-collating-sorted/
21:18 ugexe joined #perl6
21:28 perlpilot_ joined #perl6
21:31 nativecallable6 joined #perl6
21:31 releasable6 joined #perl6
21:31 zakharyas joined #perl6
21:41 Geth ¦ ecosystem: Tyil++ created pull request #365: Add IRC::Client::Plugin::Github
21:41 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/pull/365
21:52 Geth ¦ ecosystem: d0be49be1e | (Patrick Spek)++ | META.list
21:52 Geth ¦ ecosystem: Add IRC::Client::Plugin::Github
21:52 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/d0be49be1e
21:52 Geth ¦ ecosystem: 9b58955aaf | lizmat++ (committed using GitHub Web editor) | META.list
21:52 Geth ¦ ecosystem: Merge pull request #365 from Tyil/add-IRC-Client-Plugin-Github
21:52 Geth ¦ ecosystem:
21:52 Geth ¦ ecosystem: Add IRC::Client::Plugin::Github
21:52 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/9b58955aaf
21:56 hoelzro lizmat++ # title
21:57 Cabanossi joined #perl6
22:11 TimToady .tell smls no, that wasn't intended
22:11 yoleaux 21:10Z <smls> TimToady: Is it intended that LTM prefers \d and <[0..9]> over <digit> and <:Number>, as a tie-breaker? (re. RT #130612)
22:11 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=130612
22:11 yoleaux TimToady: I'll pass your message to smls.
22:14 Kyo91 joined #perl6
22:15 jnthn m: say '1' ~~ / \d | <digit> { say 'digit' }/
22:15 camelia rakudo-moar 760530: OUTPUT: «「1」␤»
22:15 jnthn m: say '1' ~~ / <digit> { say 'digit' } | \d /
22:15 camelia rakudo-moar 760530: OUTPUT: «「1」␤»
22:15 jnthn Interesting
22:15 jnthn Though I can guess why
22:15 jnthn m: say '1' ~~ / \d | <:N> { say 'digit' }/
22:15 camelia rakudo-moar 760530: OUTPUT: «「1」␤»
22:15 jnthn m: say '1' ~~ /<:N> { say 'digit' } | \d/
22:15 camelia rakudo-moar 760530: OUTPUT: «「1」␤»
22:15 ggherdov joined #perl6
22:16 jnthn That one I don't understand
22:17 committable6 joined #perl6
22:17 lancew joined #perl6
22:18 kyan joined #perl6
22:22 pyrimidine joined #perl6
22:23 lancew joined #perl6
22:24 pyrimidi_ joined #perl6
22:29 pyrimidine joined #perl6
22:32 pyrimidi_ joined #perl6
22:36 pyrimidine joined #perl6
22:41 pyrimidine joined #perl6
22:46 pyrimidine joined #perl6
22:46 _28_ria joined #perl6
22:49 pyrimidine joined #perl6
22:57 pyrimidine joined #perl6
22:58 skids joined #perl6
23:12 Cabanossi joined #perl6
23:14 pyrimidine joined #perl6
23:17 pyrimidi_ joined #perl6
23:44 pilne joined #perl6
23:45 cdg joined #perl6
23:54 raschipi joined #perl6
23:58 Cabanossi joined #perl6
23:59 MasterDuke joined #perl6

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

Perl 6 | Reference Documentation | Rakudo