»ö« 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.
todd Hi All. from linux.die.net/man/3/termios, how do I use `tcflush`? 01:16
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:
todd int tcflush(int fd, int queue_selector); 01:17
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 { * }
AlexDaniel todd: ↑ but use newlines instead of ␤
wait, maybe I'm too quick to treat this as a nativecall question… 01:19
todd: what problem are you trying to solve?
todd 1) What I want to do is to flush anything written to the terminal, but not hang if nothing is there. 01:20
2) then wait for any key on the keyboard to be press, including weird keys
press->pressed
AlexDaniel do we even have any buffering for stdin/stdout when it's in a terminal? 01:21
todd I have been erading 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:22
oh ya, yo press things and they stack up. Sometimes they show up after perl exits 01:23
AlexDaniel todd: hm, I've tried this and it kinda works, almost 01:28
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!
AlexDaniel todd: termios is needed there because otherwise your terminal will wait for you to type the whole line and press enter
se if we really want to process it character by character, we have to tell the terminal that we want to do so 01:30
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:33
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
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.
todd Okay. But how do I do that? I am confused
I thought $termios.makeraw; did that 01:36
geekosaur nom that changes the kernel terminal driver, not perl 6
todd How do I tell perl6? 01:37
geekosaur currently you have to reopen it in binary mode
skids "it" being $*IN
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:38
$*IN = open('/dev/tty', :bin); my $c = $*IN.getc; 01:40
Cannot do 'getc' on a handle in binary mode
what is the binary mode read commnd? 01:41
Geth doc/master: 5 commits pushed by (Wenzel P. P. Peppmeyer)++, (Rafael Schipiura)++ 01:47
todd Got to go. I will bang my head some more. 01:50
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.
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.
Geth doc: 83e4e30318 | (Rafael Schipiura)++ (committed using GitHub Web editor) | doc/Type/Failure.pod6
Update Failure.pod6
03:14
Geth doc: 5fb8ee8fc5 | (Rafael Schipiura)++ (committed using GitHub Web editor) | doc/Type/Failure.pod6
Update Failure.pod6
03:34
Xliff m: class A { method foo(Int $i where 1 | 0) { say ‘hello’ }; }; say A.new.foo(0) ; 03:58
camelia hello
True
Xliff m: class A { method hyphen-name(Int $i where 1 | 0) { say ‘hello’ }; }; say A.new.hyphen-name(0) ; 03:59
camelia hello
True
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 hello
True
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) ;
camelia 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
todd ".tell todd Please take a look" copied it down. [email@hidden.address] 04:09
yoleaux 02:10Z <japhb> todd: Please take a look at Terminal::Print (in particular, Terminal::Print::RawInput and Terminal::Print::DecodedInput).
geekosaur that's the one I pointed you at a couple days go; guess it got merged :) 04:18
todd github.com/ab5tract/Terminal-Print...w-input.p6 04:19
japhb todd: Do you have questions? RawInput and DecodedInput are my code. 04:37
(As well as the associated examples, including tris.p6) 04:38
araraloren_fake good noon 04:46
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
where is tris.pl6?
Found tris.pl6: github.com/ab5tract/Terminal-Print...es/tris.p6 05:10
nt seeing how to dump the keyboard buffer in tris.pl6. :'( 05:11
japhb Dump the buffer? You mean empty it of pending keystrokes? 05:36
todd Yes. But .......... if there are no keystrokes, do not hang/ 05:37
Maybe a better way of saying it would be to "clear strin" 05:38
"clear stdin" (Stinking typos) 05:39
In "C", it looks like : int c; while((c = getchar()) != '\n' && c != EOF); 05:41
japhb I don't think that's necessary. I think all that's needed is to change :DRAIN to :FLUSH in github.com/ab5tract/Terminal-Print...ut.pm6#L17 05:43
I could just support that as an option to raw-input-supply.
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.
todd testing 05:45
YIPPEE! Thnak you! Perfect! 05:49
japhb OK, cool, I'll add that option.
todd Kaisen (constant improvement) in action! 05:50
japhb todd: 0.93 now available. 06:03
japhb OK, about time to call it for the night. 06:08
todd: If you have any other questions/requests, please .tell me since I only skim this channel and might miss it otherwise. 06:09
todd no new questions. I am cleaning ujp my example so that it makes sense to me 07:27
Thank you!
samcv m: my $value = True; $value++; say $value 09:09
camelia True
samcv m: my $value = False; $value++; say $value 09:10
camelia True
lizmat m: my $value = True; $value--; say $value
camelia False
lizmat basically a consequence of:
m: say +True; say +False 09:11
camelia 1
0
lizmat with some magic added :-)
jonathon hi! getting an error compiling moarvm=2017.08.1, "'MP_GEN_RANDOM_MAX' undeclared (first use in this function)" -> bpaste.net/show/bf22dff0e266 10:23
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
Skarsnik What os ? 10:25
ilmari jonathon: did you do 'git submodule init'?
that's provided by 3rdparty/libtommath/tommath.h
jonathon ah 10:26
cool :)
jonathon let me try again 10:26
ilmari Configure.pl should do that for you, though
are you using a git checkout, or did you get the moarvm source some other way? 10:27
jonathon i'm building a Debian/Ubuntu package, so libtommath would explain it 10:27
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:29
Skarsnik was there a perl6-toolchain channel for these question? 10:31
jonathon there is indeed a #perl6-toolchain, i didn't know about that one :) 10:35
but i think the pointer to libtommath was all i needed
yup, i didn't have a new-enough libtommath1 in by chroot, moarvm has built correctly this time 10:36
so thank you! :)
daxim <p6steve.wordpress.com/2017/08/18/p...eally/> 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
4 Sep 2017 12:11Z <Zoffix> daxim: nevermind, your browser just has custom font size set. I reverted the commit
jonathon if you read it as "pent up demand" it makes a little more sense 11:38
(as in, "pent up frustration")
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:46
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
timotimo A::B::C will only work if C is declared "our", i think 11:47
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)
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?
scovit while B is just a silly name
timotimo oh, so more the "using namespace" thing
Skarsnik What I would have wanted if more java package. where you can have stuff accessible to a whole package but not other code
scovit Skarsnik sorry don 11:50
't know that language
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:52
scovit Skarsnik I can imagine that can be useful, too.. 11:53
Skarsnik That why I don't like much C++ namespace, they don't provide much aside anti name collision 11:54
leont Yeah I miss «using namespace», or «using» in general 11:55
scovit but a using namespace in perl6 you already have antiname collision, namespaces would provide syntesis of names and regrouping 11:56
scovit protection from external access is orthogonal to that 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
well error
But I stopped doing C++ outside along with Qt 11:58
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:05
namespace1::namespace2::namespace3::action I mean 12:06
Skarsnik It's more about what you want to expose 12:08
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:09
or make everyting Qt-object-action by exporting everything in Qt::NativeCall 12:10
for sure I cannot keep Qt::NativeCall. It totally misses the important information (Qt)
while I would be happy to keep it in just Qt::
Skarsnik hm. Not sure how you can import symbol from a sub module 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
scovit MasterDuke interesting 12:13
MasterDuke i'm not sure exactly how to do it, but i'm pretty sure jnthn++ has showed examples before 12:15
Skarsnik scovit, docs.perl6.org/language/modules#UNIT::EXPORT::*
samcv this isn't working for me: 12:19
use JSON::Fast:ver<0.4..*>;
even though i have a newer version than that. use JSON::Fast works fine
i have JSON::Fast:ver('0.9.2') 12:20
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
ugh
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
it's perl6 that is doing it thuogh
use JSON::Fast:ver<0.4..*>
doesn't work
and that's used in the module
samcv MasterDuke, does that work on your machine? 12:26
MasterDuke samcv: yep 12:28
samcv huh
where do you install your perl6 12:29
MasterDuke in my home
samcv in ~/.perl6 or somewhere else
MasterDuke ~/Source/perl6/install/... 12:30
samcv i'm gonna flush my perl6 install directory and try reinstalling
i have no clue what's going on
if that doesn't work 'ill dump zef's
samcv or maybe i should try thta first 12:30
MasterDuke samcv: JSON::Fast isn't installed with zef on the machine i just tested with 12:31
i just used -I and pointed to a git checkout
samcv oh
well any other versioned module i guess. it's not working on me for any of them
at least using that syntax 12:32
samcv well. ok dumping perl6 install folder and losing my insteled modules. then gonna retry 12:32
jonathon where's the best place/channel to ask about zef behaviour? 13:04
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:05
lizmat #perl6-toolchain probably 13:07
jonathon ta
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?
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
depends what you're trying to change/edit
pmurias samcv: I want to remove the property values aliases out of the list of property names 13:18
the ucd2c.pl script seems to also parse comments from the property aliases file :/
samcv well do you mean it doesn't parse and puts it into the data cause i know that issue 13:19
but it parses things after the # so it can make L/Letter = L*
for example
pmurias what is that used for? 13:20
samcv m: say "hi" ~~ /<:L>/
camelia 「h」
samcv m: say "h".uniprop
camelia Ll
samcv so anything L will match that
you're trying to change unicode_property_keypairs? 13:21
pmurias yes
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:22
pmurias I want to remove the property value aliases 13:23
samcv so it doesn't resolve with unipropcode ?
i wouldn't do that. it'll break unimatch 13:24
pmurias I can fix unimatch once the nqp::unipropcode is no longer crap 13:25
samcv how are you going to fix it?
create some new data structure to hold property values?
i mean i'd like to have some opcode that returns an array of propcodes associated with a property value 13:26
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
samcv what do you mean by that?
check every single property? 13:28
that's pretty wasteful?
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:30
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: github.com/samcv/Unicode-Grant/tree/master/t 13:34
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
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.
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:44
nic20 Hello \o 13:56
nic20 Anyone know of a way to get the IP address of a request in Bailador? 14:07
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:53
timotimo oh, huh! 14:55
that's a very bad failure mode :)
smls m: my &a = (++$ + *).say; a 0; a 0; a 0; 15:44
camelia 1
2
3
smls This is intended, right?
i.e. that the ++$ operation becomes part of the WhateverCode, and isn't evaluated only once.
jnthn Yeah, if the + is being whatever-curried then the LHS is going to be pulled into the thunk as a whole 15:49
It's a compile-time transform
smls Ok, that means I can close another RT... :P
ruoso___ Hey jnthn... is there a known issues with proto rules and Grammar::Debugger? 15:51
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:53
jsimonet m: my %data; dd %data{'foo'}:exists; 15:55
camelia Bool::False
jsimonet m: my %data; if True && %data{'foo'}:exists { } 15:56
camelia 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
ugexe precedence
jsimonet ok, so it is normal ?
ugexe m: my %data; if True && (%data{'foo'}:exists) { }
camelia ( no output )
ruoso___ Cannot invoke this object (REPR: Null; VMNull) on github.com/jnthn/grammar-debugger/...r.pm6#L116
ugexe yes
jsimonet It's weird :)
ugexe : is really loose 15:57
i never really use :exists that much because of that
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
ruoso___ Ok... whenever I try to write a reduced version it doesn't show up 15:59
perlpilot ugexe: maybe you should be using `and` instead of `&&` ;-) 16:00
jsimonet ugexe: ok. Is it usefull to add something in the doc ? (docs.perl6.org/type/Hash#:exists) 16:01
ugexe jsimonet: its all adverbs 16:02
ugexe perlpilot: thats probably better than what I usually do (.EXISTS-KEY) 16:03
perlpilot ugexe: indeed. 16:04
jsimonet: I think it should be documented somewhere if it's not already. Though I'd expect it in docs.perl6.org/language/traps
oh, and it's there ... docs.perl6.org/language/traps#Adve...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
camelia 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
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 :)
perlpilot: yep, it would be nice ! 16:08
maettu_ q 16:36
skids RT#124486 can be closed, if someone has the time/access to do so. 17:50
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=124486
perlpilot skids: can you put a comment on the ticket with the appropriate test output that shows why it may be closed? 17:53
skids perlpilot: I cannot. It's one of those tickets that won;t let me do anything to it. 17:56
skids c73ee308 is the roast commit. 17:57
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:00
Skarsnik probably not the job of the grammar 18:01
but what come after?
Lac123 do you mean termination character? or do you mean code-wise?
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:02
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:05
skids Lac123: I have not found a good way to do that in-grammar. 18:06
I wrote gist.github.com/skids/d1552470ba7c4ca6d318 two years ago, but maybe things have improved since then. 18:07
perlpilot Lac123: "flag per parameter" sounds wrong unless you mean in the sense that you have a hash-like thing. 18:09
(or set)
Lac123 skids: thank you, looks relevant, I'll read it thru 18:12
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:13
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:15
hoelzro o/ #perl6 19:23
long time no see!
timotimo yo ro 19:24
lizmat hoelzro o/
hoelzro I see you have all been very busy =)
o/ timotimo, lizmat 19:25
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?
lizmat hoelzro: if it's in utf-8 encoding, yes I believe 19:27
hoelzro ahhh
that explains what I'm seeing, then
hoelzro thanks lizmat! 19:27
lizmat yw, just passing on what I learned from I believe timotimo earlier today 19:28
hoelzro transitive thanks to timotimo, then =)
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
hoelzro ahhhhhhh
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
hoelzro thanks to you as well, jnthn! 19:32
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:34
skids commit: releases :a(Bool).perl 19:35
committable6 skids, ¦releases (22 commits): «»
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?
jnthn hoelzro: I kept meaning to get to 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
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)»
jnthn Oh wait
That's the wrong way around for what you want
that's flat structs in an array 19:37
You want flat array in structs
hoelzro yup!
I'm currently just unrolling by hand and providing a method to proxy the array's contents - it's ugly but it works
Xliff I had to do that as well
\o hoelzro 19:38
timotimo if you're doing stuff with termios, have you looked at Terminal::Print? 19:39
hoelzro o/ Xliff
hoelzro looks
hoelzro is there a simple way to make a byte-for-byte copy of a CStruct? 20:28
timotimo define a memset native sub that takes that struct :P 20:29
and use nativesizeof to get the right number of bytes
Skarsnik hm $var = $var2 should do a copy? x)
hoelzro that's kinda what I figured - thanks timotimo!
timotimo Skarsnik: not for CStruct; this is perl6, not C 20:30
hm. does assignment copy structs in C?
maybe only in the newer C versions?
Skarsnik yes
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
static void copy_to(MVMThreadContext *tc, MVMSTable *st, void *src, MVMObject *dest_root, void *dest) {
MVM_exception_throw_adhoc(tc, "cloning a CStruct is NYI");
timotimo that seems like too much magic
oh, right, .clone
that makes a whole lot more sense
Skarsnik should be possible to have a cline actually 20:32
maybe it's not good for the GC?
timotimo why would the gc complain?
Skarsnik Dunno. I have no idea how it work 20:32
Skarsnik I feel it should not be hard to implement clone 20:33
timotimo yeah
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
timotimo we still need something to track ownership, though, right?
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
hoelzro since it's the wild wild west in there 20:35
Skarsnik Well ptr value are copied
teatime afaik struct assignment is fine in C
obv. it is not a deep clone
timotimo hoelzro: all cloning we do is shallow
hoelzro right 20:36
timotimo Skarsnik: oh, do we actually have a managed attribute for those. neat
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
timotimo i wouldn't say that
Skarsnik github.com/MoarVM/MoarVM/blob/mast.../CStruct.h hm does not seems CStruct has this
timotimo it's quite a useful thing to have, and the user shouldn't be expecting anything different from how other things clone
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:38
Skarsnik hu 20:39
hoelzro every time I see "carray" I think "harry caray" =P 20:40
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:41
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.
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!
skids hoelzro: image.slidesharecdn.com/evolutiono...47-638.jpg <-- probably why. 20:50
Skarsnik C is a good portable assembler x) 20:54
Skarsnik skids, do you have the link to this presentation? 20:56
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
smls .tell TimToady Is it intended that LTM prefers \d and <[0..9]> over <digit> and <:Number>, as a tie-breaker? (re. RT #130612)
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=130612
yoleaux smls: I'll pass your message to TimToady.
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2017/09/11/...ng-sorted/ 21:18
Geth ecosystem: Tyil++ created pull request #365:
Add IRC::Client::Plugin::Github
21:41
Geth ecosystem: d0be49be1e | (Patrick Spek)++ | META.list
Add IRC::Client::Plugin::Github
21:52
ecosystem: 9b58955aaf | lizmat++ (committed using GitHub Web editor) | META.list
Merge pull request #365 from Tyil/add-IRC-Client-Plugin-Github

Add IRC::Client::Plugin::Github
hoelzro lizmat++ # title 21:56
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)
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=130612
yoleaux TimToady: I'll pass your message to smls.
jnthn m: say '1' ~~ / \d | <digit> { say 'digit' }/ 22:15
camelia 「1」
jnthn m: say '1' ~~ / <digit> { say 'digit' } | \d /
camelia 「1」
jnthn Interesting
Though I can guess why
m: say '1' ~~ / \d | <:N> { say 'digit' }/
camelia 「1」
jnthn m: say '1' ~~ /<:N> { say 'digit' } | \d/
camelia 「1」
jnthn That one I don't understand 22:16