»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
SmokeMachine Xliff: I think returning a Blob would be enough, no? 00:01
maybe a `native call Blob, MyCStruct` 00:02
cpan-p6 New module released to CPAN! Smack (0.1.0) by 03HANENKAMP 00:03
New module released to CPAN! Cofra (0.0.1) by 03HANENKAMP
Xliff SmokeMachine: You might be right, but probably best not to complicate things. 00:06
sortiz SmokeMachine, see gist.github.com/salortiz/572398932...b20ed5df7a 00:12
SmokeMachine m: gist.github.com/salortiz/572398932...b20ed5df7a 00:32
camelia ===SORRY!===
Could not find NativeHelpers::CStruct at line 1 in:
inst#/home/camelia/.perl6
inst#/home/camelia/rakudo-m-inst-2/share/perl6/site
inst#/home/camelia/rakudo-m-inst-2/share/perl6/vendor
inst#/home/camelia/rakudo-m-…
SmokeMachine sortiz: thanks, Ill try it here 00:33
SmokeMachine sortiz: its working! thanks!!! 00:34
sortiz SmokeMachine: YW 00:35
patrickb o/
patrickb sortiz: I'm currently trying to get DBDish::ODBC to run on FreeTDS. Problem is, FreeTDS doesn't support SQLDescribeParam. pyODBC kind of worked around that by deriving the SQL param types from the passed parameter types (except for NULL for which this is not possible). 00:38
patrickb sortiz: Would you be open for a PR to implement something similar in DBDish::ODBC? 00:39
sortiz patrickb: Sure!
patrickb A free benefit would be saving an extra round trip to the server for every SQLDescribeParam saved... 00:40
I'll give it a try then. 00:42
But not today alas.
o/
Xliff sortiz: Nice! I will have to read up on these! 00:46
SmokeMachine sortiz: Any chance of a `.new-from-list`? 00:48
sortiz: or maybe a `.push`? 00:50
sortiz SmokeMachine: If you have a Blob, you can try with new-from-pointer 00:51
Xliff sortiz: Could use this as a replacement for CArray, since CArray does not do CArray[CStruct], yes? 00:52
sortiz Xliff: Yep
Xliff sortiz++
SmokeMachine sortiz: no... :( I receive the Msg objects... I can't do `$la[0].bla = 179;`... Id prefer to `$la[0] = $msg;` 00:53
sortiz: or: `LinearArray[Msg].new-from-list: [ $msg ]` 00:54
sortiz: or `$la.push: $msg` 00:55
Xliff sortiz: Do you need any special mechanics for enabling BIND-POS on @!cache? 01:01
sortiz Yes. The problem is that a CStruct instance allocation is managed by its REPR, so it need to be "moved". I'll try to see what can be done. 01:08
timotimo SmokeMachine: it should be possible to "just" cast a CStruct to a CPointer[uint8] and read the bytes one by one until you reach nativesizeof(YourStruct) 01:26
yoleaux 3 Mar 2019 23:27Z <Xliff> timotimo: If you are having problems with GTK::Widget.get_window and GDK_WINDOW_XID, can you file an issue. I have not tested that routine sufficiently enough to know if there are any problems.
SmokeMachine m: use NativeCall; class Msg is repr<CStruct> { has uint16 $.bla }; say nativecast(CPointer[uint8], Msg.new: :bla(179)) 01:31
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
CPointer used at line 1. Did you mean 'Pointer'?
SmokeMachine m: use NativeCall; class Msg is repr<CStruct> { has uint16 $.bla }; say nativecast(Pointer[uint8], Msg.new: :bla(179))
camelia NativeCall::Types::Pointer[uint8]<0x5848a70>
SmokeMachine m: use NativeCall; class Msg is repr<CStruct> { has uint16 $.bla }; say nativecast(Pointer[uint8], Msg.new: :bla(179)).list 01:32
camelia (NativeCall::Types::Pointer[uint8]<0x4168e10>)
SmokeMachine m: use NativeCall; use NativeHelpers::Blob; class Msg is repr<CStruct> { has uint16 $.bla }; say blob-from-pointer nativecast(Pointer[uint8], Msg.new: :bla(179)), :type(Blob[int8]) 01:36
camelia ===SORRY!===
Could not find NativeHelpers::Blob at line 1 in:
inst#/home/camelia/.perl6
inst#/home/camelia/rakudo-m-inst-2/share/perl6/site
inst#/home/camelia/rakudo-m-inst-2/share/perl6/vendor
inst#/home/camelia/rakudo-m-ins…
Xliff timotimo: Ack! GDK_WINDOW_XID is preprocessor. I hope it expands to something usable. 01:38
SmokeMachine timotimo: this seems to work! Thanks! 01:43
m: use NativeCall; use NativeHelpers::Blob; class Msg is repr<CStruct> { has uint16 $.bla }; say blob-from-pointer nativecast(Pointer[uint8], Msg.new: :bla(179)), :1elems, :type(Blob[uint8])
camelia ===SORRY!===
Could not find NativeHelpers::Blob at line 1 in:
inst#/home/camelia/.perl6
inst#/home/camelia/rakudo-m-inst-2/share/perl6/site
inst#/home/camelia/rakudo-m-inst-2/share/perl6/vendor
inst#/home/camelia/rakudo-m-ins…
sortiz SmokeMachine: I just updated the gist for the simple case of one struct 01:49
guifa Is it safe to assume calling .Str will only use . (or even . or ,) for numbers with fractional units? 02:07
MasterDuke guifa: i think so 02:12
sortiz Xliff: I committed a change to add ASSIGN-POS to LinearArray. Seems to work. Gist updated. 02:43
sortiz SmokeMachine: Now the $la[$idx] = $msg case works (assign by-copy) 02:51
Xliff What about BIND-POS? 02:53
$la[$idx] := $msg 02:54
sortiz Xliff: I'm thinking in the semantic (Should result in both objects pointing to the same struct?) As LinearArray is well, "linear", should I change the location of the RHS? (!!) 02:57
sortiz Too much distant-action IMO 02:58
Xliff good point
Xliff sortiz: Although I would think only the LHS would change. You would either be assigning by copy, in which case the LHS copies the data from the RHS. 03:02
Or you bind, in which the LHS becomes the RHS. 03:03
sortiz For a disperse array, a simple Array[Msg] just works: 03:06
m: class Msg is repr<CStruct> { has uint16 $.bla is rw}; my @a = Array[Msg].new(:shape(2)); @a[0] = Msg.new(:10bla); say @a[0]; 03:07
camelia Msg.new(bla => 10)
sortiz m: class Msg is repr<CStruct> { has uint16 $.bla is rw}; my @a = Array[Msg].new(:shape(2)); @a[1] := Msg.new(:10bla); say @a[1]; 03:08
camelia Msg.new(bla => 10)
Xliff sortiz++ 03:16
jdv79 wow, the flat/slip/single arg rule is hard when coming back to it after a while 03:29
for example - nopaste.xyz/?802513c0a7caf0cd#kHHC...PwSYcLnrI= 03:30
i could no explain to someone why that works
s/no/not/ 03:31
and it took me 20mins to get it to work
sortiz o/ #perl6 03:36
Xliff m: my @a = <a b c>; say (1, 2, @a) 04:18
camelia (1 2 [a b c])
Xliff m: my @a = <a b c>; say (1, 2, @a.flat) 04:19
camelia (1 2 (a b c))
Xliff m: my @a = <a b c>; say (1, 2, |@a.flat)
camelia (1 2 a b c)
Xliff I am beginning to understand everything but .Slip
m: my @a = <a b c>; @a.append: (3, 4, 5); say (1, 2, |@a.flat)
camelia (1 2 a b c 3 4 5)
Xliff m: my @a = <a b c>; @a.append: (3, 4, 5); say (1, 2, @a.flat); say (1, 2, |@a.flat)
camelia (1 2 (a b c 3 4 5))
(1 2 a b c 3 4 5)
Xliff m: my @a = <a b c>; @a.append: (3, 4, 5); say |@a.WHAT 04:20
camelia Cannot look up attributes in a Array type object
in block <unit> at <tmp> line 1
Xliff m: my @a = <a b c>; @a.append: (3, 4, 5); say |@a.^name
camelia Array
Xliff m: my @a = <a b c>; @a.append: (3, 4, 5); say (|@a).^name 04:21
camelia Slip
jmerelo releasable6: status 06:14
releasable6 jmerelo, Next release will happen when it's ready. 2 blockers. 319 out of 337 commits logged
jmerelo, Details: gist.github.com/01feced5b4715a2576...2736a5a62a
Geth doc: 0c8e1498c7 | (JJ Merelo)++ | doc/Language/operators.pod6
Adds and clarifies #2648 for xx
06:34
synopsebot Link: doc.perl6.org/language/operators
doc: a059e9b9d5 | (JJ Merelo)++ | doc/Language/operators.pod6
Fixes X closes #2648
cpan-p6 New module released to CPAN! Perl6-Parser (0.3.0) by 03JGOFF 06:45
sena_kun committable6, source 07:28
committable6 sena_kun, github.com/perl6/whateverable
Xliff .tell timotimo OK, much of the gdk_x11_ calls that use GdkWindow as the first parameter are now in, please let me know what other routines you are looking for. 07:36
yoleaux Xliff: I'll pass your message to timotimo.
Geth whateverable/clarify-error-message: af08556ea9 | Altai-man++ | lib/Whateverable.pm6
Mention the exact channel name in error message
07:43
whateverable: Altai-man++ created pull request #349:
Mention the exact channel name in error message
07:44
Geth doc/supply-interval-6d: d02f2878f9 | Altai-man++ | doc/Type/Supply.pod6
Mention 6.d standard value of minimal interval
07:50
Geth doc: Altai-man++ created pull request #2649:
Mention 6.d standard value of minimal interval
07:52
Geth doc: d02f2878f9 | Altai-man++ | doc/Type/Supply.pod6
Mention 6.d standard value of minimal interval
08:28
synopsebot Link: doc.perl6.org/type/Supply
doc: e269df78c0 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Type/Supply.pod6
Merge pull request #2649 from perl6/supply-interval-6d

Mention 6.d standard value of minimal interval
cpan-p6 New module released to CPAN! XDG-BaseDirectory (0.0.11) by 03JSTOWE 09:50
scimon So pretty much all my module use v6.c going to be updating them today. 09:52
cpan-p6 New module released to CPAN! Proc-InvokeEditor (0.0.6) by 03SCIMON 10:06
New module released to CPAN! Proc-InvokeEditor (0.0.5) by 03SCIMON
New module released to CPAN! Algorithm-GooglePolylineEncoding (1.0.2) by 03SCIMON
antoniogamiz hi :) 10:23
antoniogamiz there is a mailing list for perl6? 10:27
El_Che antoniogamiz: perl6.org/archive/lists/ 10:29
sena_kun sure, perl6.org/community/
antoniogamiz thanks :)
El_Che this is the most reactive mediumn, though :) 10:31
antoniogamiz El_Che: yep, I've been coming lastly and all people here are very nice 10:34
antoniogamiz to type a unicode character in my perl6 script, must I know its code?O.o 10:56
sena_kun it is not necessary, there are input tools available. 10:57
it depends on the editor/OS you are using. 10:58
docs.perl6.org/language/unicode_entry <- antoniogamiz
antoniogamiz sena_kun: thanks, I'll take a look 10:59
El_Che antoniogamiz: I pretty much dislike the utf8 operators and never used them. It's a personal thing 11:10
cpan-p6 New module released to CPAN! Trait-Env (0.5.2) by 03SCIMON 12:26
cpan-p6 New module released to CPAN! Test-HTTP-Server (0.3.2) by 03SCIMON 12:41
New module released to CPAN! Range-SetOps (0.0.3) by 03SCIMON 12:56
sacomo hi all, I need some suggestions for reducing precomp parse stage. I am using PERL6LIB to include some dev modules that I am working on, but whenever I modify a single file it causes the parse stage to parse everything (or so it feels) again. Is there any way to force the precomp parse stage to ignore everything by modified files only? 13:03
dogbert2_ .seen rindolf 14:30
yoleaux I saw rindolf 3 Mar 2019 17:30Z in #perl6: <rindolf> jdv79: ah
rindolf dogbert2_: hi
dogbert2_ hi rindolf, do you still have your examples you pasted on friday somewhere, where p5 was 15 times faster than p6 14:31
'the paste links no longer works
possibly it was related to euler problem 658 14:32
rindolf dogbert2_: i do - yes 14:35
dogbert2_ they're nedded :) I want to write an issue so that lizmat can take a look at the slow hash operations. Unless you want to do it that is :9 14:38
sorry for the bad spelling
timotimo these slow hash operations could have something to do with how whence is handled, i.e. autovivification 14:39
dogbert2_ timotimo: is the handling less than optimal ?
rindolf dogbert2_: www.shlomifish.org/Files/files/arc...58par54.7z
timotimo perhaps there's something spesh-plugin-y we could put there
dogbert2_ rindolf: thx 14:40
rindolf dogbert2_: you're welcome
dogbert2_ a factor of 15 is a bit much methinks :)
rindolf: R#2735 14:50
synopsebot R#2735 [open]: github.com/rakudo/rakudo/issues/2735 %h{$a}{$b}{$c} = True in a loop with different abcs is really slow
rindolf dogbert2_: thanks 14:51
Geth doc: d7ce75c409 | cfa++ | xt/code.pws
Spelling: 'argsfiles'.
15:57
candr How can I create an immutable "constant" that is not assigned at compile time? I have a global I need to assign at run-time, but I want it to be immutable after the initial assignment. Is this possible? 16:20
sena_kun I think you can use docs.perl6.org/type/Proxy 16:23
just write it that I'll hold an internal e.g. flag used/unused and then throw an exception on attempt to STORE with the flag is up.
s/I'll/it'll/ 16:24
candr Hmm... looks like it might work... seems strange that there is not a more obvious way to work with immutable data though... 16:29
jmerelo Hey! 16:36
jmerelo releasable6: status 16:37
releasable6 jmerelo, Next release will happen when it's ready. 2 blockers. 319 out of 338 commits logged
jmerelo, Details: gist.github.com/ab3258b868af4ec2cf...fe505c7ff3
candr I want to do something like this: `my $a;` (declaration from global scope). then `$a = True;` (initial assignment from main). then later if `$a = False` should die with something like "cannot assign to an immutable value". 16:38
jmerelo candr: try binding 16:39
m: my $a := True; $a = False
camelia Cannot assign to an immutable value
in block <unit> at <tmp> line 1
candr m: my $a; $a := True; 16:40
camelia ( no output )
jmerelo m: my $a; $a := True; $a = False 16:41
camelia Cannot assign to an immutable value
in block <unit> at <tmp> line 1
candr In the REPL I get this:
jmerelo m: my $a; $a := True; $a := False # That could be a problem
camelia ( no output )
candr > my $a; (Any) > $a := True; ===SORRY!=== Error while compiling: Cannot use bind operator with this left-hand side ------> $a := True⏏;
seems you cant declare and assign seperately
mikfire Don't rebind? 16:42
jmerelo You can always rebind
You can't assign once you bound to something, but you can rebind as above 16:43
candr: you can maybe hack something using Proxy docs.perl6.org/language/containers...containers
candr: try StackOverflow also 16:44
Geth whateverable: af08556ea9 | Altai-man++ | lib/Whateverable.pm6
Mention the exact channel name in error message
whateverable: 5f210b4ca1 | (Aleks-Daniel Jakimenko-Aleksejev)++ (committed using GitHub Web editor) | lib/Whateverable.pm6
Merge pull request #349 from perl6/clarify-error-message

Mention the exact channel name in error message
candr Yeah that was mentioned earlier... I just figured there would be more standard way to do this... since so many other functional inspired langs have data types that are immutable by default... 16:45
jmerelo candr: data-types are inmmutable. Containers might not be. Lists are immutable, for instance, or Mixes. But you can assign anything else to the container. 16:46
Perl6 makes a nice distinction between containers and data
You can of course use constants, but what you are looking for are write-once variables, not constants (or immutable containers, which are constants) 16:47
candr I meant container then.
exactly
jmerelo If you can know the value in compile time, you could use a constant as a matter of fact. But if that's not the case, I guess that using your own Role or using Proxy is your best bet.
candr hmm... is there a declarator other than "my" that I can use from within main to bind to a container that will then be in the global scope? 16:50
sena_kun `our` and `is export` trait(our $foo is export) if you want to export it for other modules. or you probably want a dynamic variable. 16:51
candr Would be cool if there was a container that maybe had syntax like sub parameters. Immutable by default and mutable if `is rw` trait is used during declaration. 17:03
sena_kun m: grammar A { rule TOP { 'a' } }; grammar B { rule TOP { <A::TOP> } }; B.parse('a', :actions(Actions)); 17:28
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
Actions used at line 1
sena_kun m: grammar A { rule TOP { 'a' } }; grammar B { rule TOP { <A::TOP> } }; class Actions { method TOP($/) { say $/; make 'a'; } }; B.parse('a', :actions(Actions));
camelia 「a」
「a」
A::TOP => 「a」
sena_kun this looks totally like a bug to me. 17:29
moritz what's the bug? that TOP is called twice? 18:35
sena_kun yes. 18:38
it is logically expected to be used only for the outer grammar, but it works with inner too.
you can workaround it, but I cannot really say it is DWIM. 18:39
vrurg It looks like perl6.dev has been bought. Hopefully, it was taken by community? 19:08
jmerelo vrurg: can you find the owner? 19:10
vrurg No, Registrant Name: REDACTED FOR PRIVACY 19:10
AlexDaniel vrurg: well, people can buy all kinds of stuff… 19:39
vrurg AlexDaniel: sure. I just had a hope that we have that one. Seemingly not. Ok. 19:40
AlexDaniel raku is also taken, btw :) 19:44
Altai-man m: say 'a' ~~ / <[ \x01 .. \x1F ]> /
camelia Nil
Altai-man how to make it DWIW?
lizmat what do you want it to do? "a" is not in that range 19:46
Altai-man ah
but the syntax is correct, right?
AlexDaniel m: say 'a' ~~ / <[ \x01 .. \x7F ]> /
camelia 「a」
Altai-man I am just implementing RFC 4514 right now. :)
ok, thanks!
AlexDaniel Altai-man: I don't know if it's correct… 19:47
in the ascii range it is probably alright
Altai-man well, I know the codes.
or, rather, I have them in the RFC.
Altai-man just wasn't sure about the syntax. 19:47
AlexDaniel m: say “\x[8000000000000000]”.chr 19:55
camelia ===SORRY!===
chr codepoint cannot be negative
AlexDaniel meh
it's actually interesting 19:56
m: say “\x[800000000000000]”.chr
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5\0' (indicated by ⏏)
in block <unit> at <tmp> line 1
AlexDaniel m: say “\x[80000000000000000]”.chr
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5\0' (indicated by ⏏)
in block <unit> at <tmp> line 1
AlexDaniel but
m: say “\x[8000000000000000]”.chr
camelia ===SORRY!===
chr codepoint cannot be negative
AlexDaniel :)
oh 19:57
O_O
m: say “\x[800000]”.ord 19:58
camelia 8388608
AlexDaniel m: say “\x[800000000]”.ord
camelia 0
AlexDaniel m: say “\x[8000000]”.ord
camelia 134217728
AlexDaniel m: say “\x[80000000]”.ord
camelia MoarVM oops: MVM_nfg_get_synthetic_info call requested a synthetic codepoint that does not exist.
Requested synthetic -2147483648 when only 6 have been created.
at src/Perl6/World.nqp:2861 (/home/camelia/rakudo-m-inst-2/share/nqp/lib/Perl6/Wor…
timotimo fun 19:59
clearly we're not distinguishing well between unsigned and signed somewhere in moar
that should throw an exception rather than oops 20:00
AlexDaniel or maybe return 0 like all other huge codepoints do? 20:03
which is wrong but at least it'd be consistent with something
guifa Given a Role X, is there a way to see what classes do X? 20:03
lizmat no 20:05
currently in Perl 6, children know of their parents
but parents know nothing of their children 20:06
AlexDaniel R#2738
synopsebot R#2738 [open]: github.com/rakudo/rakudo/issues/2738 [Moar][UNI] MoarVM oops when .ord-ing garbage strings
lizmat guifa: It's a bad example to set in this world, but that's the current reality 20:07
guifa lizmat: ha, fair. I just have a lot of different classes that implement insanely similar functions (basically “does X count as zero/one/two/few/many/other?”) and made classes for identical models, with a languages array for the ones it goes with. I was debating the best way to group that 20:08
AlexDaniel timotimo: ha, `9999` label is still there! 20:09
guifa I guess I could seriously abuse multidispatch but … that seems the ugliest haha
AlexDaniel kinda miss the time when it was easy to poke large numbers into different routines and see rakudo go crazy :) 20:10
lizmat guifa
guifa: well, if you have a list of classes, you *can* check if they're doing a specific role
guifa Yeah. It’s a very finite (if long) list, so I’ll just have at the bottom an array of classes, loop through, and add them to the appropriate hash keys 20:12
Xliff \o 20:18
guifa Russian wins for most complicated number rule: v = 0 and i % 10 = 0 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 11..14 20:28
Altai-man .oO ( I feel myself so complicated right now ) 20:29
guifa Altai-man: Actually I just found a Polish rule that’s even more complicated (by a smidgen) 20:39
Altai-man :]
I am proud of Poland, but I don't know Polish.
drclaw clear 21:25
ls
antoniogamiz drclaw: that commands work here? O.o 21:26
drclaw hah hah. I haven't had coffee yet... wrong window :) 21:27
antoniogamiz drclaw: ahahh yep that's common :)
lizmat and yet another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2019/03/04/...is-summer/ 21:29
moritz lizmat++ 21:31
jmerelo lizmat++ 21:45
tbrowder lizmat: many thanks! 22:32
jdv79 m: class A { has Str:D $.b; submethod BUILD (:$!b = ''){}} A.new 23:12
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable definition of type Str:D requires an initializer
at <tmp>:1
------> 3class A { has Str:D $.b7⏏5; submethod BUILD (:$!b = ''){}} A.new
expecting any of:
constraint
jdv79 isn't the initializer covered by the BUILD sig?
sortiz \o #perl6 23:41
AlexDaniel o/ 23:43