perl.perl6.users http://www.nntp.perl.org/group/perl.perl6.users/ ... Copyright 1998-2016 perl.org Wed, 27 Jul 2016 00:38:42 +0000 ask@perl.org Re: How to properly represent c++ class hiearchy in nativecall? by Vladimir Marek Ok, it all boils down to this:<br/><br/>===================================== a.h ======================================<br/>#ifndef _A_H_<br/>#define _A_H_<br/><br/>class A {<br/> public:<br/> int a(void);<br/>};<br/><br/>class B : public A {<br/> public:<br/> int b(void);<br/>};<br/><br/>#endif /* _A_H_ */<br/>================================================================================<br/><br/><br/><br/>==================================== a.cpp =====================================<br/>#include &quot;a.h&quot;<br/><br/>int<br/>A::a(void) {<br/> return 1;<br/>}<br/><br/>int<br/>B::b(void) {<br/> return 2;<br/>}<br/>================================================================================<br/><br/>g++ -shared -o liba.so a.cpp<br/><br/>===================================== a.pl =====================================<br/>#!/home/neuron/.rakudobrew/bin/perl6<br/><br/>use NativeCall;<br/><br/>class A is repr&lt;CPPStruct&gt; {<br/> has Pointer $.vtable;<br/> method a is native(&#39;./a&#39;) returns Int { * };<br/><br/>}<br/><br/>class B is A {<br/> method b is native(&#39;./a&#39;) returns Int { * };<br/>}<br/><br/>A.new.a.say; # works<br/>B.new.a.say; # err 1<br/>B.new.b.say; # err 2<br/>================================================================================<br/><br/><br/>err 1:<br/>Native call expected return type with CPPStruct representation, but got a P6opaque (B)<br/> in method CALL-ME at /home/neuron/.rakudobrew/moar-nom/install/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 328<br/> in block &lt;unit&gt; at ./a.pl line 16<br/><br/><br/>err 2:<br/>Unknown type B used in native call.<br/>If you want to pass a struct, be sure to use the CStruct or<br/>CPPStruct representation.<br/>If you want to pass an array, be sure to use the CArray type.<br/> in sub type_code_for at /home/neuron/.rakudobrew/moar-nom/install/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 174<br/> in sub param_hash_for at /home/neuron/.rakudobrew/moar-nom/install/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 71<br/> in sub param_list_for at /home/neuron/.rakudobrew/moar-nom/install/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 89<br/> in method setup at /home/neuron/.rakudobrew/moar-nom/install/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 304<br/> in method CALL-ME at /home/neuron/.rakudobrew/moar-nom/install/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 317<br/> in block &lt;unit&gt; at ./a.pl line 17<br/><br/><br/>Does it make sense to file this bug?<br/><br/>Thank you<br/>__ <br/> Vlad<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2882.html Tue, 26 Jul 2016 07:32:47 +0000 Re: How to properly represent c++ class hiearchy in nativecall? by yary On Mon, Jul 25, 2016 at 4:07 AM, Vladimir Marek<br/>&lt;Vladimir.Marek@oracle.com&gt; wrote:<br/>&gt; Understood. My question is, whether there is one, or two $.vtable<br/>&gt; Pointers allocated in this case:<br/><br/>&gt; class A {has $.x}<br/>&gt; class B is A {has $.x}<br/>&gt; B.new.perl<br/>B.new(x =&gt; Any, x =&gt; Any)<br/><br/>makes me think there are 2 $.vtables. Not sure how to specify which<br/>one you want!<br/><br/>-y<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2881.html Mon, 25 Jul 2016 14:27:16 +0000 Re: How to properly represent c++ class hiearchy in nativecall? by Vladimir Marek &gt; Hi, the $.vtable Pointer is just there to allocate more space for the<br/>&gt; CPPStruct, and to properly align the struct attributes.<br/>&gt; <br/>&gt; C++ itself cares about the vtable, not NativeCall.<br/><br/>Understood. My question is, whether there is one, or two $.vtable<br/>Pointers allocated in this case:<br/><br/>class QObject is repr&lt;CPPStruct&gt; {<br/> has Pointer $.vtable;<br/>}<br/><br/>class QPushButton is repr&lt;CPPStruct&gt; is QObject {<br/> has Pointer $.vtable;<br/>}<br/><br/>my QPushButton $a;<br/><br/><br/><br/><br/><br/>&gt; What would help to fix any issues would be to prove a sample code in the<br/>&gt; style of the rakudo/t/04-nativecall/* tests.<br/>&gt; (Without depending on qt of course)<br/><br/>I&#39;m more than happy to do that, but I thought the presented errors are<br/>my misunderstanding of the language than actual problems.<br/><br/><br/><br/><br/>Thank you<br/>-- <br/> Vlad<br/><br/><br/>&gt; <br/>&gt; Cheers, Tobias<br/>&gt; <br/>&gt; Am 24.07.2016 um 09:03 schrieb Vladimir Marek:<br/>&gt; &gt;Hi,<br/>&gt; &gt;<br/>&gt; &gt;I&#39;m playing with QT library in perl6. I got it somehow working, but now I<br/>&gt; &gt;wonder whether I&#39;m doing it right.<br/>&gt; &gt;<br/>&gt; &gt;QT objects are C++ classes. Roughly there is base class QObject. From that<br/>&gt; &gt;object QWidget isderived.<br/>&gt; &gt;<br/>&gt; &gt;class QObject;<br/>&gt; &gt;class QWidget : public QObject;<br/>&gt; &gt;class QAbstractButton : public QWidget;<br/>&gt; &gt;class QPushButton : public QAbstractButton;<br/>&gt; &gt;<br/>&gt; &gt;you get the picture.<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;I have represented these in p6 like:<br/>&gt; &gt;<br/>&gt; &gt;class QObject is repr&lt;CPPStruct&gt; {<br/>&gt; &gt; has Pointer $.vtable;<br/>&gt; &gt; ...<br/>&gt; &gt;}<br/>&gt; &gt;<br/>&gt; &gt;class QPushButton is repr&lt;CPPStruct&gt; is QObject {<br/>&gt; &gt; has Pointer $.vtable;<br/>&gt; &gt; ...<br/>&gt; &gt;}<br/>&gt; &gt;<br/>&gt; &gt;I have skipped for now QWidget and QAbstractButton for now. It works, but:<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;- isn&#39;t it a problem that both classes have the $.vtable variable? QPushButton<br/>&gt; &gt;overriding QObject one? I guess that is ok though, there&#39;s always just a<br/>&gt; &gt;single pointer.<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;- I have tried to mimick GTK::Simple tap providers, but failed.<br/>&gt; &gt;class QPushButton is repr&lt;CPPStruct&gt; is QObject {<br/>&gt; &gt; has Pointer $.vtable;<br/>&gt; &gt; has $!clicked_supply;<br/>&gt; &gt;}<br/>&gt; &gt;===SORRY!=== Error while compiling /home/neuron/qt/qt.pl<br/>&gt; &gt;CPPStruct representation only handles int, num, CArray, CPointer, CStruct, CPPStruct and CUnion<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;- I have tried to view QPushButton as a role to QObject<br/>&gt; &gt;<br/>&gt; &gt;role QPushButton is repr&lt;CPPStruct&gt; is QObject {<br/>&gt; &gt; # line 63:<br/>&gt; &gt; my sub qt_QPushButton_show(QPushButton) is native(&#39;p6&#39;, v1) is mangled(False) { * };<br/>&gt; &gt;<br/>&gt; &gt;===SORRY!=== Error while compiling /home/neuron/qt/qt.pl<br/>&gt; &gt;Too many positionals passed; expected 2 arguments but got 3<br/>&gt; &gt;at /home/neuron/qt/qt.pl:63<br/>&gt; &gt;<br/>&gt; &gt;The same for<br/>&gt; &gt;<br/>&gt; &gt;role QPushButton is QObject {<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;- I have tried<br/>&gt; &gt;<br/>&gt; &gt;class QPushButton does QObject {<br/>&gt; &gt;===SORRY!=== Error while compiling /home/neuron/qt/qt.pl<br/>&gt; &gt;QObject is not composable, so QPushButton cannot compose it<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;I have not tried making QObject a unit, is it the way to go? I&#39;m trying to chew<br/>&gt; &gt;on the line from GTK::Simple. I&#39;m not sure yet what it is and how relevant it<br/>&gt; &gt;is.<br/>&gt; &gt;<br/>&gt; &gt;unit class GTK::Simple::Button does GTK::Simple::Widget;<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;Thank you<br/>&gt; &gt;__<br/>&gt; &gt; Vlad<br/>&gt; &gt;<br/>&gt; <br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2880.html Mon, 25 Jul 2016 08:07:51 +0000 Re: How to properly represent c++ class hiearchy in nativecall? by Tobias Leich Hi, the $.vtable Pointer is just there to allocate more space for the <br/>CPPStruct, and to properly align the struct attributes.<br/><br/>C++ itself cares about the vtable, not NativeCall.<br/><br/><br/>What would help to fix any issues would be to prove a sample code in the <br/>style of the rakudo/t/04-nativecall/* tests.<br/>(Without depending on qt of course)<br/><br/>Cheers, Tobias<br/><br/>Am 24.07.2016 um 09:03 schrieb Vladimir Marek:<br/>&gt; Hi,<br/>&gt;<br/>&gt; I&#39;m playing with QT library in perl6. I got it somehow working, but now I<br/>&gt; wonder whether I&#39;m doing it right.<br/>&gt;<br/>&gt; QT objects are C++ classes. Roughly there is base class QObject. From that<br/>&gt; object QWidget isderived.<br/>&gt;<br/>&gt; class QObject;<br/>&gt; class QWidget : public QObject;<br/>&gt; class QAbstractButton : public QWidget;<br/>&gt; class QPushButton : public QAbstractButton;<br/>&gt;<br/>&gt; you get the picture.<br/>&gt;<br/>&gt;<br/>&gt; I have represented these in p6 like:<br/>&gt;<br/>&gt; class QObject is repr&lt;CPPStruct&gt; {<br/>&gt; has Pointer $.vtable;<br/>&gt; ...<br/>&gt; }<br/>&gt;<br/>&gt; class QPushButton is repr&lt;CPPStruct&gt; is QObject {<br/>&gt; has Pointer $.vtable;<br/>&gt; ...<br/>&gt; }<br/>&gt;<br/>&gt; I have skipped for now QWidget and QAbstractButton for now. It works, but:<br/>&gt;<br/>&gt;<br/>&gt; - isn&#39;t it a problem that both classes have the $.vtable variable? QPushButton<br/>&gt; overriding QObject one? I guess that is ok though, there&#39;s always just a<br/>&gt; single pointer.<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; - I have tried to mimick GTK::Simple tap providers, but failed.<br/>&gt; class QPushButton is repr&lt;CPPStruct&gt; is QObject {<br/>&gt; has Pointer $.vtable;<br/>&gt; has $!clicked_supply;<br/>&gt; }<br/>&gt; ===SORRY!=== Error while compiling /home/neuron/qt/qt.pl<br/>&gt; CPPStruct representation only handles int, num, CArray, CPointer, CStruct, CPPStruct and CUnion<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; - I have tried to view QPushButton as a role to QObject<br/>&gt;<br/>&gt; role QPushButton is repr&lt;CPPStruct&gt; is QObject {<br/>&gt; # line 63:<br/>&gt; my sub qt_QPushButton_show(QPushButton) is native(&#39;p6&#39;, v1) is mangled(False) { * };<br/>&gt;<br/>&gt; ===SORRY!=== Error while compiling /home/neuron/qt/qt.pl<br/>&gt; Too many positionals passed; expected 2 arguments but got 3<br/>&gt; at /home/neuron/qt/qt.pl:63<br/>&gt;<br/>&gt; The same for<br/>&gt;<br/>&gt; role QPushButton is QObject {<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; - I have tried<br/>&gt;<br/>&gt; class QPushButton does QObject {<br/>&gt; ===SORRY!=== Error while compiling /home/neuron/qt/qt.pl<br/>&gt; QObject is not composable, so QPushButton cannot compose it<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; I have not tried making QObject a unit, is it the way to go? I&#39;m trying to chew<br/>&gt; on the line from GTK::Simple. I&#39;m not sure yet what it is and how relevant it<br/>&gt; is.<br/>&gt;<br/>&gt; unit class GTK::Simple::Button does GTK::Simple::Widget;<br/>&gt;<br/>&gt;<br/>&gt; Thank you<br/>&gt; __<br/>&gt; Vlad<br/>&gt;<br/><br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2879.html Sun, 24 Jul 2016 11:13:33 +0000 How to properly represent c++ class hiearchy in nativecall? by Vladimir Marek Hi,<br/><br/>I&#39;m playing with QT library in perl6. I got it somehow working, but now I<br/>wonder whether I&#39;m doing it right.<br/><br/>QT objects are C++ classes. Roughly there is base class QObject. From that<br/>object QWidget isderived.<br/><br/>class QObject;<br/>class QWidget : public QObject;<br/>class QAbstractButton : public QWidget;<br/>class QPushButton : public QAbstractButton;<br/><br/>you get the picture.<br/><br/><br/>I have represented these in p6 like:<br/><br/>class QObject is repr&lt;CPPStruct&gt; {<br/> has Pointer $.vtable;<br/> ...<br/>}<br/><br/>class QPushButton is repr&lt;CPPStruct&gt; is QObject {<br/> has Pointer $.vtable;<br/> ...<br/>}<br/><br/>I have skipped for now QWidget and QAbstractButton for now. It works, but:<br/><br/><br/>- isn&#39;t it a problem that both classes have the $.vtable variable? QPushButton<br/>overriding QObject one? I guess that is ok though, there&#39;s always just a<br/>single pointer.<br/><br/><br/><br/><br/>- I have tried to mimick GTK::Simple tap providers, but failed.<br/>class QPushButton is repr&lt;CPPStruct&gt; is QObject {<br/> has Pointer $.vtable;<br/> has $!clicked_supply;<br/>}<br/>===SORRY!=== Error while compiling /home/neuron/qt/qt.pl<br/>CPPStruct representation only handles int, num, CArray, CPointer, CStruct, CPPStruct and CUnion<br/><br/><br/><br/><br/>- I have tried to view QPushButton as a role to QObject<br/><br/>role QPushButton is repr&lt;CPPStruct&gt; is QObject {<br/> # line 63:<br/> my sub qt_QPushButton_show(QPushButton) is native(&#39;p6&#39;, v1) is mangled(False) { * };<br/><br/>===SORRY!=== Error while compiling /home/neuron/qt/qt.pl<br/>Too many positionals passed; expected 2 arguments but got 3<br/>at /home/neuron/qt/qt.pl:63<br/><br/>The same for<br/><br/>role QPushButton is QObject {<br/><br/><br/><br/>- I have tried<br/><br/>class QPushButton does QObject {<br/>===SORRY!=== Error while compiling /home/neuron/qt/qt.pl<br/>QObject is not composable, so QPushButton cannot compose it<br/><br/><br/><br/>I have not tried making QObject a unit, is it the way to go? I&#39;m trying to chew<br/>on the line from GTK::Simple. I&#39;m not sure yet what it is and how relevant it<br/>is.<br/><br/>unit class GTK::Simple::Button does GTK::Simple::Widget;<br/><br/><br/>Thank you<br/>__ <br/> Vlad<br/><br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2878.html Sun, 24 Jul 2016 07:03:58 +0000 Re: Announce: Rakudo Star Release 2016.07 by James Ellis Osborne III That is quite a step forward! Happy 22nd, All! <br/> <br/>On Jul 22, 2016 4:01 AM, &quot;Steve Mynott&quot; &lt;steve.mynott@gmail.com&gt; wrote: <br/> <br/>&gt; <br/>&gt; On behalf of the Rakudo and Perl 6 development teams, I&rsquo;m pleased to <br/>&gt; announce the July 2016 release of &ldquo;Rakudo Star&rdquo;, a useful and usable <br/>&gt; production distribution of Perl 6. The tarball for the July 2016 release is <br/>&gt; available from http://rakudo.org/downloads/star/. <br/>&gt; <br/>&gt; This is the third post-Christmas (production) release of Rakudo Star and <br/>&gt; implements Perl v6.c. It comes with support for the MoarVM backend (all <br/>&gt; module tests pass on supported platforms). <br/>&gt; <br/>&gt; Please note that this release of Rakudo Star is not fully functional with <br/>&gt; the JVM backend from the Rakudo compiler. Please use the MoarVM backend <br/>&gt; only. <br/>&gt; <br/>&gt; In the Perl 6 world, we make a distinction between the language (&ldquo;Perl 6&Prime;) <br/>&gt; and specific implementations of the language such as &ldquo;Rakudo Perl&rdquo;. This <br/>&gt; Star release includes release 2016.07 of the Rakudo Perl 6 compiler, <br/>&gt; version 2016.07 of MoarVM, plus various modules, documentation, and other <br/>&gt; resources collected from the Perl 6 community. <br/>&gt; <br/>&gt; Some of the new compiler features since the last Rakudo Star release <br/>&gt; include: <br/>&gt; <br/>&gt; + Ability to use a customer debugger module <br/>&gt; + The &ldquo;is-approx&rdquo; sub from Test.pm6 now allows for relative/absolute <br/>&gt; tolerance <br/>&gt; + A fail in a custom BUILD will now be returned, rather than thrown <br/>&gt; + Introduce .Map coercer <br/>&gt; + Implement alternate ways to call subtest <br/>&gt; + Support for new leap-second at the end of 2016 <br/>&gt; + The &ldquo;is required&rdquo; trait on Attributes can now take a Bool or a Str <br/>&gt; + IO::[Path,Handle] gained a .mode method which returns the POSIX file <br/>&gt; permissions <br/>&gt; + Distribution is now a role interface that enables encapsulating IO used <br/>&gt; for distribution installation <br/>&gt; + CompUnit::Repository::Installation now uses the new Distribution <br/>&gt; interface <br/>&gt; + Custom repository implementations now supported, including precompilation <br/>&gt; <br/>&gt; Compiler maintenance since the last Rakudo Star release includes: <br/>&gt; <br/>&gt; + Basic object creation (using either .new or .bless) now up to 3x faster <br/>&gt; + All routines now have less overhead <br/>&gt; + The MMD cache accepts candidates with named parameters if it can. (This <br/>&gt; made adverbed slices about 18x as fast) <br/>&gt; + Sigificant optimizations for speed in many parts of the system (.map, <br/>&gt; gather/take etc.) <br/>&gt; + Many precompilation fixes (including EVAL and improved support of OS <br/>&gt; packaging) <br/>&gt; + Arrays with holes (e.g. from :delete) now correctly iterate/auto-vivify <br/>&gt; + An issue with reverse dependencies of installed modules was fixed <br/>&gt; + &ldquo;is_approx&rdquo; sub (note underscore) from Test.pm6 deprecated <br/>&gt; + Harden Mu.Str against moving GC <br/>&gt; + Simplify $USER/$GROUP initialization <br/>&gt; + Mu can now be the result of a Promise <br/>&gt; + samewith() now also works on non-multi&rsquo;s <br/>&gt; + Many fixes in the area of pre-compilation and installing modules <br/>&gt; + count-only and bool-only now are optional methods in Iterators (only to <br/>&gt; be implemented if they can work without generating anything) <br/>&gt; + IO::ArgFiles.slurp / IO::ArgFiles.eof are fixed <br/>&gt; + REPL whitespace and error handling <br/>&gt; + CompUnit::Repository::Installation no longer considers bin/xxx and <br/>&gt; resources/bin/xxx the same content address <br/>&gt; + min/max on Failures throw instead of returning &plusmn;Inf <br/>&gt; + NativeCall&rsquo;s is mangled trait no longer ignored for CPPStruct <br/>&gt; + Many Str, List and Array methods much faster <br/>&gt; + Map/Hash initializations are now 30% faster <br/>&gt; + make DESTDIR now correctly finds CompUnit::Repository::Staging <br/>&gt; + Output from Test.pm6&prime;s diag() is no longer lost in non-verbose prove <br/>&gt; output when called at the start of the test file or during TODO tests <br/>&gt; + Improved error messages <br/>&gt; <br/>&gt; Notable changes in modules shipped with Rakudo Star: <br/>&gt; <br/>&gt; + DBIish: v0.5.9 (with many Oracle/MySQL fixes) plus README.pod and <br/>&gt; mojibake fixes <br/>&gt; + NativeHelpers-Blob: v0.1.10 <br/>&gt; + PSGI: v1.2.0 supports P6SGI 0.7Draft <br/>&gt; + Pod-To-HTML: v0.1.2 plus fixes <br/>&gt; + debugger-ui-commandline: README fixes <br/>&gt; + doc: many fixes to documentation content and HTML generation <br/>&gt; + panda: Avoid Rakudo internals deprecation warning and don&rsquo;t require <br/>&gt; Build.pm to inherit Panda::Builder <br/>&gt; + perl6-file-which: CI fixes <br/>&gt; + perl6-http-easy: v1.1.0 (with more flexible P6SGI support) plus avoid <br/>&gt; errors in binary request <br/>&gt; + shell-command: Mention already implemented commands missing from README <br/>&gt; + perl6-lwp-simple: track github.com/perl6/perl6-lwp-simple as upstream <br/>&gt; (as panda does) which has a test fix needed since we don&rsquo;t support https in <br/>&gt; R* and a test url had a new https redirect <br/>&gt; <br/>&gt; perl6intro.pdf has also been updated. <br/>&gt; <br/>&gt; There are some key features of Perl 6 that Rakudo Star does not yet handle <br/>&gt; appropriately, although they will appear in upcoming releases. Some of the <br/>&gt; not-quite-there features include: <br/>&gt; <br/>&gt; + advanced macros <br/>&gt; + non-blocking I/O (in progress) <br/>&gt; + some bits of Synopsis 9 and 11 <br/>&gt; + There is an online resource at http://perl6.org/compilers/features that <br/>&gt; lists the known implemented and missing features of Rakudo&rsquo;s backends and <br/>&gt; other Perl 6 implementations. <br/>&gt; <br/>&gt; In many places we&rsquo;ve tried to make Rakudo smart enough to inform the <br/>&gt; programmer that a given feature isn&rsquo;t implemented, but there are many that <br/>&gt; we&rsquo;ve missed. Bug reports about missing and broken features are welcomed at <br/>&gt; rakudobug@perl.org. <br/>&gt; <br/>&gt; See http://perl6.org/ for links to much more information about Perl 6, <br/>&gt; including documentation, example code, tutorials, presentations, reference <br/>&gt; materials, design documents, and other supporting resources. Some Perl 6 <br/>&gt; tutorials are available under the &ldquo;docs&rdquo; directory in the release tarball. <br/>&gt; <br/>&gt; The development team thanks all of the contributors and sponsors for <br/>&gt; making Rakudo Star possible. If you would like to contribute, see <br/>&gt; http://rakudo.org/how-to-help, ask on the perl6-compiler@perl.org mailing <br/>&gt; list, or join us on IRC #perl6 on freenode. <br/>&gt; <br/>&gt; <br/>&gt; -- <br/>&gt; 4096R/EA75174B Steve Mynott &lt;steve.mynott@gmail.com&gt; <br/>&gt; http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2877.html Fri, 22 Jul 2016 13:55:16 +0000 Announce: Rakudo Star Release 2016.07 by Steve Mynott On behalf of the Rakudo and Perl 6 development teams, I&rsquo;m pleased to <br/>announce the July 2016 release of &ldquo;Rakudo Star&rdquo;, a useful and usable <br/>production distribution of Perl 6. The tarball for the July 2016 release is <br/>available from http://rakudo.org/downloads/star/. <br/> <br/>This is the third post-Christmas (production) release of Rakudo Star and <br/>implements Perl v6.c. It comes with support for the MoarVM backend (all <br/>module tests pass on supported platforms). <br/> <br/>Please note that this release of Rakudo Star is not fully functional with <br/>the JVM backend from the Rakudo compiler. Please use the MoarVM backend <br/>only. <br/> <br/>In the Perl 6 world, we make a distinction between the language (&ldquo;Perl 6&Prime;) <br/>and specific implementations of the language such as &ldquo;Rakudo Perl&rdquo;. This <br/>Star release includes release 2016.07 of the Rakudo Perl 6 compiler, <br/>version 2016.07 of MoarVM, plus various modules, documentation, and other <br/>resources collected from the Perl 6 community. <br/> <br/>Some of the new compiler features since the last Rakudo Star release <br/>include: <br/> <br/>+ Ability to use a customer debugger module <br/>+ The &ldquo;is-approx&rdquo; sub from Test.pm6 now allows for relative/absolute <br/>tolerance <br/>+ A fail in a custom BUILD will now be returned, rather than thrown <br/>+ Introduce .Map coercer <br/>+ Implement alternate ways to call subtest <br/>+ Support for new leap-second at the end of 2016 <br/>+ The &ldquo;is required&rdquo; trait on Attributes can now take a Bool or a Str <br/>+ IO::[Path,Handle] gained a .mode method which returns the POSIX file <br/>permissions <br/>+ Distribution is now a role interface that enables encapsulating IO used <br/>for distribution installation <br/>+ CompUnit::Repository::Installation now uses the new Distribution interface <br/>+ Custom repository implementations now supported, including precompilation <br/> <br/>Compiler maintenance since the last Rakudo Star release includes: <br/> <br/>+ Basic object creation (using either .new or .bless) now up to 3x faster <br/>+ All routines now have less overhead <br/>+ The MMD cache accepts candidates with named parameters if it can. (This <br/>made adverbed slices about 18x as fast) <br/>+ Sigificant optimizations for speed in many parts of the system (.map, <br/>gather/take etc.) <br/>+ Many precompilation fixes (including EVAL and improved support of OS <br/>packaging) <br/>+ Arrays with holes (e.g. from :delete) now correctly iterate/auto-vivify <br/>+ An issue with reverse dependencies of installed modules was fixed <br/>+ &ldquo;is_approx&rdquo; sub (note underscore) from Test.pm6 deprecated <br/>+ Harden Mu.Str against moving GC <br/>+ Simplify $USER/$GROUP initialization <br/>+ Mu can now be the result of a Promise <br/>+ samewith() now also works on non-multi&rsquo;s <br/>+ Many fixes in the area of pre-compilation and installing modules <br/>+ count-only and bool-only now are optional methods in Iterators (only to <br/>be implemented if they can work without generating anything) <br/>+ IO::ArgFiles.slurp / IO::ArgFiles.eof are fixed <br/>+ REPL whitespace and error handling <br/>+ CompUnit::Repository::Installation no longer considers bin/xxx and <br/>resources/bin/xxx the same content address <br/>+ min/max on Failures throw instead of returning &plusmn;Inf <br/>+ NativeCall&rsquo;s is mangled trait no longer ignored for CPPStruct <br/>+ Many Str, List and Array methods much faster <br/>+ Map/Hash initializations are now 30% faster <br/>+ make DESTDIR now correctly finds CompUnit::Repository::Staging <br/>+ Output from Test.pm6&prime;s diag() is no longer lost in non-verbose prove <br/>output when called at the start of the test file or during TODO tests <br/>+ Improved error messages <br/> <br/>Notable changes in modules shipped with Rakudo Star: <br/> <br/>+ DBIish: v0.5.9 (with many Oracle/MySQL fixes) plus README.pod and <br/>mojibake fixes <br/>+ NativeHelpers-Blob: v0.1.10 <br/>+ PSGI: v1.2.0 supports P6SGI 0.7Draft <br/>+ Pod-To-HTML: v0.1.2 plus fixes <br/>+ debugger-ui-commandline: README fixes <br/>+ doc: many fixes to documentation content and HTML generation <br/>+ panda: Avoid Rakudo internals deprecation warning and don&rsquo;t require <br/>Build.pm to inherit Panda::Builder <br/>+ perl6-file-which: CI fixes <br/>+ perl6-http-easy: v1.1.0 (with more flexible P6SGI support) plus avoid <br/>errors in binary request <br/>+ shell-command: Mention already implemented commands missing from README <br/>+ perl6-lwp-simple: track github.com/perl6/perl6-lwp-simple as upstream (as <br/>panda does) which has a test fix needed since we don&rsquo;t support https in R* <br/>and a test url had a new https redirect <br/> <br/>perl6intro.pdf has also been updated. <br/> <br/>There are some key features of Perl 6 that Rakudo Star does not yet handle <br/>appropriately, although they will appear in upcoming releases. Some of the <br/>not-quite-there features include: <br/> <br/>+ advanced macros <br/>+ non-blocking I/O (in progress) <br/>+ some bits of Synopsis 9 and 11 <br/>+ There is an online resource at http://perl6.org/compilers/features that <br/>lists the known implemented and missing features of Rakudo&rsquo;s backends and <br/>other Perl 6 implementations. <br/> <br/>In many places we&rsquo;ve tried to make Rakudo smart enough to inform the <br/>programmer that a given feature isn&rsquo;t implemented, but there are many that <br/>we&rsquo;ve missed. Bug reports about missing and broken features are welcomed at <br/>rakudobug@perl.org. <br/> <br/>See http://perl6.org/ for links to much more information about Perl 6, <br/>including documentation, example code, tutorials, presentations, reference <br/>materials, design documents, and other supporting resources. Some Perl 6 <br/>tutorials are available under the &ldquo;docs&rdquo; directory in the release tarball. <br/> <br/>The development team thanks all of the contributors and sponsors for making <br/>Rakudo Star possible. If you would like to contribute, see <br/>http://rakudo.org/how-to-help, ask on the perl6-compiler@perl.org mailing <br/>list, or join us on IRC #perl6 on freenode. <br/> <br/> <br/>-- <br/>4096R/EA75174B Steve Mynott &lt;steve.mynott@gmail.com&gt; http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2876.html Fri, 22 Jul 2016 11:00:23 +0000 resource limits by mt1957 Hi,<br/><br/>I am running tests with a lot of threads. I&#39;ve seen that when I push it <br/>to about 200 threads, it can get into trouble when the task of the <br/>thread is large enough. Now, looking at some system monitor(atop on <br/>linux), I can see that the user time of 3 or 4 processors(of 8) soared <br/>up to 100% but not finishing the tasks. In one of those sessions I even <br/>got got an error (reported bug #128172):<br/><br/>*** Error in `/home/marcel/Software/perl6/rakudo/install/bin/moar&#39;: <br/>double free or corruption (fasttop): 0x0000000005da0090 ***<br/><br/>or the test is finished in a abrupt way saying that there are &#39;no <br/>subtests run&#39;. Or it can give other errors like;<br/><br/>Cannot invoke this object (REPR: Null; VMNull)<br/> in block at t/100-rw.t line 118<br/> in block &lt;unit&gt; at t/100-rw.t line 118<br/><br/>It gives an indication that the program gets corrupted at some point <br/>which is of course not good but where it happens is not tracable for me. <br/>Not easy to golf this down e.g. less treads (50 or even a 100 with less <br/>work) always finish properly.<br/><br/>The question I have now is how to check in a program for resource info <br/>so that the program can behave like a nice computer citizen.<br/><br/>Greetings,<br/>Marcel<br/><br/>I&#39;ve included the sources for anyone interested. The tests are commented <br/>out except for the &#39;readers and writers&#39; test. Here the number of <br/>threads is 100 with 40 writers and 60 readers. This is to test the <br/>semaphore readers writers pattern. The module is not yet completed. It <br/>will be published in the ecosystem when ready.<br/><br/>This is Rakudo version 2016.06-178-gf7c6e60 built on MoarVM version <br/>2016.06-9-g8fc21d5<br/>implementing Perl 6.c.<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2875.html Fri, 08 Jul 2016 20:56:38 +0000 Re: GUI, CPAN by =?UTF-8?Q?Tadeusz_So=c5=9bnierz?= On 01/07/16 15:59, The Holy Ghost wrote:<br/>&gt; Hello,<br/>&gt;<br/>&gt; without the good interface to C<br/><br/>Waitwaitwait.<br/><br/>AFAICT, perl 6 has about the best interface to C that I&#39;ve used in the <br/>similarly-leveled language; is there anything you&#39;re missing from <br/>https://docs.perl6.org/language/nativecall?<br/><br/>boost::regards,<br/>Tadzik<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2874.html Fri, 01 Jul 2016 21:43:25 +0000 Re: GUI, CPAN by Vytas D Hi, Check http://modules.perl6.org/#q=sdl modules, I have never dealt with<br/>SDL, so can&#39;t advise any more.<br/><br/>Thanks,<br/>Vytas<br/><br/>P.S. you can install SDL by executing -&gt; panda install SDL<br/><br/>On Fri, Jul 1, 2016 at 2:59 PM, The Holy Ghost &lt;holyghost@yellowcouch.org&gt;<br/>wrote:<br/><br/>&gt; Hello,<br/>&gt;<br/>&gt; without the good interface to C, is there a library such as SDL available<br/>&gt; such as SDLx::SDL or something ?<br/>&gt;<br/>&gt; Is there a CPAN to register libraries and products for perl 6 ?<br/>&gt;<br/>&gt; Kind regards,<br/>&gt; holly<br/>&gt; http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2873.html Fri, 01 Jul 2016 14:06:53 +0000 Re: GUI, CPAN by Tom Browder On Fri, Jul 1, 2016 at 8:59 AM, The Holy Ghost<br/>&lt;holyghost@yellowcouch.org&gt; wrote:<br/>&gt; Hello,<br/>&gt; without the good interface to C, is there a library such as SDL available<br/>&gt; such as SDLx::SDL or something ?<br/><br/>As far as I know, the definitive source of Perl 6 modules is here:<br/><br/> https://modules.perl6.org/<br/><br/>Best,<br/><br/>-Tom<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2872.html Fri, 01 Jul 2016 14:06:40 +0000 GUI, CPAN by The Holy Ghost Hello,<br/><br/>without the good interface to C, is there a library such as SDL available <br/>such as SDLx::SDL or something ?<br/><br/>Is there a CPAN to register libraries and products for perl 6 ?<br/><br/>Kind regards,<br/>holly<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/07/msg2871.html Fri, 01 Jul 2016 13:59:38 +0000 Re: Perl 6 adoption by Zdenek Bohunek Hi, there is tutorial on NativeCall on Zoffix Znet blog http://blogs.perl.org/users/zoffix_znet/2016/05/perl-6-nativecall-look-ma-im-a-c-programmer-1.html <br/> <br/>z <br/> <br/>&gt; On Jun 30, 2016, at 06:14, Kaare Rasmussen &lt;kaare@jasonic.dk&gt; wrote: <br/>&gt; <br/>&gt;&gt; On 2016-06-29 12:26, webmind wrote: <br/>&gt;&gt;&gt; On 28/06/16 05:26, Kaare Rasmussen wrote: <br/>&gt;&gt;&gt; <br/>&gt;&gt;&gt; In that vein, I&#39;m surprised how easy it is to bind to C libraries. This <br/>&gt;&gt;&gt; could very well be a killer feature for Perl 6 compared to other high <br/>&gt;&gt;&gt; level languages. The resource usage has to come down to a reasonable <br/>&gt;&gt;&gt; level for that to be interesting, though. <br/>&gt;&gt; Can you perhaps recommend a tutorial or something on how this works? <br/>&gt; <br/>&gt; I don&#39;t really know of any tutorial. I just wanted to implement listen/notify support for PostgreSQL in DBIish (https://github.com/perl6/DBIish), so I looked at PostgreSQL&#39;s excellent documentation and at the existing native bindings in DBIish. <br/>&gt; <br/>&gt; I think this https://docs.perl6.org/language/nativecall has been updated since, so perhaps it&#39;s a good place to start. Otherwise take a look at the modules list, there are plenty of modules linking to native libraries, incl gtk, misc compression and sound libraries, etc. <br/>&gt; <br/>&gt; There&#39;s even a module to generate a stub class to start with, https://github.com/Skarsnik/gptrixie <br/>&gt; <br/>&gt; I think that for more advanced interfaces, these helpers might come in handy: <br/>&gt; <br/>&gt; https://github.com/jonathanstowe/NativeHelpers-Array <br/>&gt; https://github.com/salortiz/NativeHelpers-Blob <br/>&gt; <br/>&gt; But things may have changed or may change in the future, I haven&#39;t looked at it for several months now. Which is equivalent to years in normal Internet life :-) <br/>&gt; <br/>&gt; <br/>&gt; /kaare <br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2870.html Thu, 30 Jun 2016 11:06:56 +0000 Re: Perl 6 adoption by Kaare Rasmussen On 2016-06-29 12:26, webmind wrote:<br/>&gt; On 28/06/16 05:26, Kaare Rasmussen wrote:<br/>&gt;&gt;<br/>&gt;&gt; In that vein, I&#39;m surprised how easy it is to bind to C libraries. This<br/>&gt;&gt; could very well be a killer feature for Perl 6 compared to other high<br/>&gt;&gt; level languages. The resource usage has to come down to a reasonable<br/>&gt;&gt; level for that to be interesting, though.<br/>&gt; Can you perhaps recommend a tutorial or something on how this works?<br/>&gt;<br/><br/>I don&#39;t really know of any tutorial. I just wanted to implement <br/>listen/notify support for PostgreSQL in DBIish <br/>(https://github.com/perl6/DBIish), so I looked at PostgreSQL&#39;s excellent <br/>documentation and at the existing native bindings in DBIish.<br/><br/>I think this https://docs.perl6.org/language/nativecall has been updated <br/>since, so perhaps it&#39;s a good place to start. Otherwise take a look at <br/>the modules list, there are plenty of modules linking to native <br/>libraries, incl gtk, misc compression and sound libraries, etc.<br/><br/>There&#39;s even a module to generate a stub class to start with, <br/>https://github.com/Skarsnik/gptrixie<br/><br/>I think that for more advanced interfaces, these helpers might come in <br/>handy:<br/><br/>https://github.com/jonathanstowe/NativeHelpers-Array<br/>https://github.com/salortiz/NativeHelpers-Blob<br/><br/>But things may have changed or may change in the future, I haven&#39;t <br/>looked at it for several months now. Which is equivalent to years in <br/>normal Internet life :-)<br/><br/><br/>/kaare<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2869.html Thu, 30 Jun 2016 04:15:13 +0000 Re: Perl 6 adoption by webmind On 28/06/16 05:26, Kaare Rasmussen wrote:<br/>&gt; On 2016-06-27 15:11, Parrot Raiser wrote:<br/>&gt;&gt; We should all be thinking about the &quot;killer application&quot; for Perl 6;<br/>&gt;&gt; the sort of job that is made so much easier by it that people will<br/>&gt;&gt; overlook all sorts of problems.<br/>&gt; <br/>&gt; In that vein, I&#39;m surprised how easy it is to bind to C libraries. This<br/>&gt; could very well be a killer feature for Perl 6 compared to other high<br/>&gt; level languages. The resource usage has to come down to a reasonable<br/>&gt; level for that to be interesting, though.<br/><br/>Can you perhaps recommend a tutorial or something on how this works?<br/><br/>cheers,<br/><br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2868.html Wed, 29 Jun 2016 14:08:54 +0000 Re: Perl 6 adoption by Kaare Rasmussen On 2016-06-27 15:11, Parrot Raiser wrote:<br/>&gt; We should all be thinking about the &quot;killer application&quot; for Perl 6;<br/>&gt; the sort of job that is made so much easier by it that people will<br/>&gt; overlook all sorts of problems.<br/><br/>In that vein, I&#39;m surprised how easy it is to bind to C libraries. This <br/>could very well be a killer feature for Perl 6 compared to other high <br/>level languages. The resource usage has to come down to a reasonable <br/>level for that to be interesting, though.<br/><br/>/kaare<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2867.html Tue, 28 Jun 2016 03:26:36 +0000 Re: Perl 6 adoption by B. Estrade On Mon, Jun 27, 2016 at 8:11 AM, Parrot Raiser &lt;1parrota@gmail.com&gt; wrote:<br/><br/>&gt; We should all be thinking about the &quot;killer application&quot; for Perl 6;<br/>&gt; the sort of job that is made so much easier by it that people will<br/>&gt; overlook all sorts of problems.<br/>&gt;<br/><br/>Look towards the kinds of problems being solved by Go and Python in the<br/>parallel (message passing and tight smp)/distributed/scientific computing<br/>space.<br/><br/>As Larry pointed out in his YAPC::NA Q&amp;A, he wanted to make things like PDL<br/>easier and more naturally expressed in the available language features.<br/><br/>Similarly, Damian pointed out in hist keynote how natural it was to express<br/>scientific ideas in Perl 6.<br/><br/>Providing development tools, in particular static-ish analyzers for Perl 6<br/>*and* Perl 5 (among other languages) might also be a rich area to explore.<br/><br/>Time spent on CMS software and replicated tired applications is going to a<br/>waste of time (though not the framework(s) to make creating them easier).<br/><br/>Brett<br/><br/><br/>&gt;<br/>&gt; On 6/27/16, Kaare Rasmussen &lt;kaare@jasonic.dk&gt; wrote:<br/>&gt; &gt; Hi List<br/>&gt; &gt;<br/>&gt; &gt; Now that 6c is 6 months old, I&#39;m wondering if there is any sign of Perl<br/>&gt; &gt; 6 adoption in companies, startups, etc for professional use?<br/>&gt; &gt;<br/>&gt; &gt; It may be premature to expect any widespread professional use, but I<br/>&gt; &gt; would like to know more about what ecosystem we have. With<br/>&gt; &gt; &quot;professional&quot; I don&#39;t refer to the code quality, but if anybody is<br/>&gt; &gt; seeing Perl 6 as giving them a business advantage.<br/>&gt; &gt;<br/>&gt; &gt; /kaare<br/>&gt; &gt;<br/>&gt; http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2866.html Mon, 27 Jun 2016 17:09:20 +0000 Re: Perl 6 adoption by Parrot Raiser We should all be thinking about the &quot;killer application&quot; for Perl 6;<br/>the sort of job that is made so much easier by it that people will<br/>overlook all sorts of problems.<br/><br/>On 6/27/16, Kaare Rasmussen &lt;kaare@jasonic.dk&gt; wrote:<br/>&gt; Hi List<br/>&gt;<br/>&gt; Now that 6c is 6 months old, I&#39;m wondering if there is any sign of Perl<br/>&gt; 6 adoption in companies, startups, etc for professional use?<br/>&gt;<br/>&gt; It may be premature to expect any widespread professional use, but I<br/>&gt; would like to know more about what ecosystem we have. With<br/>&gt; &quot;professional&quot; I don&#39;t refer to the code quality, but if anybody is<br/>&gt; seeing Perl 6 as giving them a business advantage.<br/>&gt;<br/>&gt; /kaare<br/>&gt;<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2865.html Mon, 27 Jun 2016 13:11:56 +0000 Perl 6 adoption by Kaare Rasmussen Hi List<br/><br/>Now that 6c is 6 months old, I&#39;m wondering if there is any sign of Perl <br/>6 adoption in companies, startups, etc for professional use?<br/><br/>It may be premature to expect any widespread professional use, but I <br/>would like to know more about what ecosystem we have. With <br/>&quot;professional&quot; I don&#39;t refer to the code quality, but if anybody is <br/>seeing Perl 6 as giving them a business advantage.<br/><br/>/kaare<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2864.html Mon, 27 Jun 2016 08:12:43 +0000 Re: problem installing GTK::Simple by Timo Paulssen On 06/22/2016 06:33 PM, Theo van den Heuvel wrote:<br/>&gt; Thanks Timo,<br/>&gt;<br/>&gt; this brings be further, but not quite out of the woods. I now get the<br/>&gt; following (Windows 10):<br/>&gt;<br/>&gt;<br/>&gt; # Failed test at t/01-sanity.t line 10<br/>&gt; # Dynamic variable @*INC not found<br/>&gt;<br/>&gt; with the ensuing failures.<br/>&gt;<br/>&gt; Any ideas?<br/>&gt;<br/>&gt; thanks,<br/>&gt; Theo<br/><br/>Wow, @*INC has been deprecated since a little bit before christmas. The<br/>code that looks for the downloaded DLLs has to be re-worked to use<br/>%*RESOURCES, but I&#39;ve never used that feature so far, so I&#39;m not sure<br/>how that&#39;d look.<br/><br/>Maybe someone&#39;ll be nice enough to do the necessary changes for us ...<br/><br/>Until then, you can probably hack around that stuff locally. Don&#39;t<br/>forget you can just git clone the gtk-simple repo locally and &quot;panda<br/>install .&quot; to install your local changes.<br/><br/>HTH<br/> - Timo<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2863.html Wed, 22 Jun 2016 18:30:42 +0000 Re: problem installing GTK::Simple by Theo van den Heuvel Thanks Timo,<br/><br/>this brings be further, but not quite out of the woods. I now get the <br/>following (Windows 10):<br/><br/><br/># Failed test at t/01-sanity.t line 10<br/># Dynamic variable @*INC not found<br/><br/>with the ensuing failures.<br/><br/>Any ideas?<br/><br/>thanks,<br/>Theo<br/><br/>Timo Paulssen schreef op 2016-06-22 18:01:<br/>&gt; I just committed a fix to GTK::Simple&#39;s Build.pm. It was using the Z<br/>&gt; metaop to iterate over download URLs and the hashsums it was<br/>&gt; expecting, but it forgot to flatten the list before taking<br/>&gt; 2-at-a-time, so it was getting a URL with a space in it (followed by<br/>&gt; the hash) as the download URL.<br/>&gt; <br/>&gt; It should now install on windows even if you lack the .dll files.<br/>&gt; <br/>&gt; HTH<br/>&gt; - Timo<br/>&gt; <br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2862.html Wed, 22 Jun 2016 16:33:10 +0000 Re: problem installing GTK::Simple by Timo Paulssen I just committed a fix to GTK::Simple&#39;s Build.pm. It was using the Z <br/>metaop to iterate over download URLs and the hashsums it was expecting, <br/>but it forgot to flatten the list before taking 2-at-a-time, so it was <br/>getting a URL with a space in it (followed by the hash) as the download URL.<br/><br/>It should now install on windows even if you lack the .dll files.<br/><br/>HTH<br/> - Timo<br/><br/>On 22/06/16 11:16, Theo van den Heuvel wrote:<br/>&gt; Hi all,<br/>&gt;<br/>&gt; I am trying to install GTK::Simple using panda. On Windows10 <br/>&gt; installation fails and the log contains the line:<br/>&gt;<br/>&gt; Could not parse URI: http://gtk-dlls.p6c.org/libatk-1.0-0.dll <br/>&gt; 1FF7464EDA0C7EC9B87D23A075F7486C13D74C02A3B5D83A267AD091424185D9<br/>&gt;<br/>&gt; This is Rakudo version 2016.04 built on MoarVM version 2016.04<br/>&gt; implementing Perl 6.c.<br/>&gt;<br/>&gt; Trying on Ubuntu14.04 gives me:<br/>&gt;<br/>&gt; This is Rakudo version 2016.06-9-g57f8f8f built on MoarVM version 2016.06<br/>&gt; implementing Perl 6.c.<br/>&gt;<br/>&gt; $ panda --force install GTK::Simple<br/>&gt; ==&gt; Fetching GTK::Simple<br/>&gt; ==&gt; Building GTK::Simple<br/>&gt; Failed<br/>&gt; in method build at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>&gt; (Panda::Builder) line 8<br/>&gt; in method install at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 148<br/>&gt; in method resolve at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 234<br/>&gt; in sub MAIN at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 18<br/>&gt; in block &lt;unit&gt; at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 152<br/>&gt;<br/>&gt; Actually thrown at:<br/>&gt; in any at gen/moar/m-Metamodel.nqp line 3055<br/>&gt; in block at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>&gt; (Panda::Builder) line 11<br/>&gt; in sub indir at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/24811C576EF8F85E7672B26955C802BB2FC94675 <br/>&gt; (Panda::Common) line 20<br/>&gt; in method build at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>&gt; (Panda::Builder) line 7<br/>&gt; in method install at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 148<br/>&gt; in method resolve at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 234<br/>&gt; in sub MAIN at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 18<br/>&gt; in block &lt;unit&gt; at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 152<br/>&gt;<br/>&gt; Am I missing something here?<br/>&gt;<br/>&gt; thanks<br/>&gt;<br/>&gt;<br/><br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2861.html Wed, 22 Jun 2016 16:02:07 +0000 Follow up - Re: problem installing GTK::Simple by Richard Hainsworth I just tried re-installing GTK::Simple on Ubuntu 16.04 (not 14.04, but I <br/>don&#39;t see why a less recent Ubuntu would make a difference).<br/><br/>$ panda --force install GTK::Simple<br/>==&gt; Fetching GTK::Simple<br/>==&gt; Building GTK::Simple<br/>Found system gtk library.<br/>==&gt; Testing GTK::Simple<br/>t/01-sanity.t .. ok<br/>All tests successful.<br/>Files=1, Tests=3, 55 wallclock secs ( 0.02 usr 0.00 sys + 53.18 cusr <br/>1.52 csys = 54.72 CPU)<br/>Result: PASS<br/>==&gt; Installing GTK::Simple<br/>==&gt; Successfully installed GTK::Simple<br/><br/><br/>It did take a LONG time.<br/><br/>Richard<br/><br/>On Wednesday, June 22, 2016 10:16 AM, Theo van den Heuvel wrote:<br/>&gt; Hi all,<br/>&gt;<br/>&gt; I am trying to install GTK::Simple using panda. On Windows10 <br/>&gt; installation fails and the log contains the line:<br/>&gt;<br/>&gt; Could not parse URI: http://gtk-dlls.p6c.org/libatk-1.0-0.dll <br/>&gt; 1FF7464EDA0C7EC9B87D23A075F7486C13D74C02A3B5D83A267AD091424185D9<br/>&gt;<br/>&gt; This is Rakudo version 2016.04 built on MoarVM version 2016.04<br/>&gt; implementing Perl 6.c.<br/>&gt;<br/>&gt; Trying on Ubuntu14.04 gives me:<br/>&gt;<br/>&gt; This is Rakudo version 2016.06-9-g57f8f8f built on MoarVM version 2016.06<br/>&gt; implementing Perl 6.c.<br/>&gt;<br/>&gt; $ panda --force install GTK::Simple<br/>&gt; ==&gt; Fetching GTK::Simple<br/>&gt; ==&gt; Building GTK::Simple<br/>&gt; Failed<br/>&gt; in method build at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>&gt; (Panda::Builder) line 8<br/>&gt; in method install at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 148<br/>&gt; in method resolve at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 234<br/>&gt; in sub MAIN at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 18<br/>&gt; in block &lt;unit&gt; at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 152<br/>&gt;<br/>&gt; Actually thrown at:<br/>&gt; in any at gen/moar/m-Metamodel.nqp line 3055<br/>&gt; in block at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>&gt; (Panda::Builder) line 11<br/>&gt; in sub indir at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/24811C576EF8F85E7672B26955C802BB2FC94675 <br/>&gt; (Panda::Common) line 20<br/>&gt; in method build at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>&gt; (Panda::Builder) line 7<br/>&gt; in method install at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 148<br/>&gt; in method resolve at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 234<br/>&gt; in sub MAIN at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 18<br/>&gt; in block &lt;unit&gt; at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 152<br/>&gt;<br/>&gt; Am I missing something here?<br/>&gt;<br/>&gt; thanks<br/>&gt;<br/>&gt;<br/><br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2860.html Wed, 22 Jun 2016 10:07:14 +0000 Re: problem installing GTK::Simple by Richard Hainsworth The problem is very recent.<br/><br/>I noticed this morning on the perl6 modules page, the module is failing. <br/>It appears to be something in TextView (line 18 of GTK::Simple)<br/><br/>Shouldn&#39;t be long to fix, if only by reverting recent commits.<br/><br/>On Wednesday, June 22, 2016 10:16 AM, Theo van den Heuvel wrote:<br/>&gt; Hi all,<br/>&gt;<br/>&gt; I am trying to install GTK::Simple using panda. On Windows10 <br/>&gt; installation fails and the log contains the line:<br/>&gt;<br/>&gt; Could not parse URI: http://gtk-dlls.p6c.org/libatk-1.0-0.dll <br/>&gt; 1FF7464EDA0C7EC9B87D23A075F7486C13D74C02A3B5D83A267AD091424185D9<br/>&gt;<br/>&gt; This is Rakudo version 2016.04 built on MoarVM version 2016.04<br/>&gt; implementing Perl 6.c.<br/>&gt;<br/>&gt; Trying on Ubuntu14.04 gives me:<br/>&gt;<br/>&gt; This is Rakudo version 2016.06-9-g57f8f8f built on MoarVM version 2016.06<br/>&gt; implementing Perl 6.c.<br/>&gt;<br/>&gt; $ panda --force install GTK::Simple<br/>&gt; ==&gt; Fetching GTK::Simple<br/>&gt; ==&gt; Building GTK::Simple<br/>&gt; Failed<br/>&gt; in method build at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>&gt; (Panda::Builder) line 8<br/>&gt; in method install at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 148<br/>&gt; in method resolve at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 234<br/>&gt; in sub MAIN at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 18<br/>&gt; in block &lt;unit&gt; at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 152<br/>&gt;<br/>&gt; Actually thrown at:<br/>&gt; in any at gen/moar/m-Metamodel.nqp line 3055<br/>&gt; in block at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>&gt; (Panda::Builder) line 11<br/>&gt; in sub indir at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/24811C576EF8F85E7672B26955C802BB2FC94675 <br/>&gt; (Panda::Common) line 20<br/>&gt; in method build at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>&gt; (Panda::Builder) line 7<br/>&gt; in method install at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 148<br/>&gt; in method resolve at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>&gt; (Panda) line 234<br/>&gt; in sub MAIN at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 18<br/>&gt; in block &lt;unit&gt; at <br/>&gt; /home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>&gt; line 152<br/>&gt;<br/>&gt; Am I missing something here?<br/>&gt;<br/>&gt; thanks<br/>&gt;<br/>&gt;<br/><br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2859.html Wed, 22 Jun 2016 09:45:51 +0000 problem installing GTK::Simple by Theo van den Heuvel Hi all,<br/><br/>I am trying to install GTK::Simple using panda. On Windows10 <br/>installation fails and the log contains the line:<br/><br/>Could not parse URI: http://gtk-dlls.p6c.org/libatk-1.0-0.dll <br/>1FF7464EDA0C7EC9B87D23A075F7486C13D74C02A3B5D83A267AD091424185D9<br/><br/>This is Rakudo version 2016.04 built on MoarVM version 2016.04<br/>implementing Perl 6.c.<br/><br/>Trying on Ubuntu14.04 gives me:<br/><br/>This is Rakudo version 2016.06-9-g57f8f8f built on MoarVM version <br/>2016.06<br/>implementing Perl 6.c.<br/><br/>$ panda --force install GTK::Simple<br/>==&gt; Fetching GTK::Simple<br/>==&gt; Building GTK::Simple<br/>Failed<br/> in method build at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>(Panda::Builder) line 8<br/> in method install at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>(Panda) line 148<br/> in method resolve at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>(Panda) line 234<br/> in sub MAIN at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>line 18<br/> in block &lt;unit&gt; at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>line 152<br/><br/>Actually thrown at:<br/> in any at gen/moar/m-Metamodel.nqp line 3055<br/> in block at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>(Panda::Builder) line 11<br/> in sub indir at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/24811C576EF8F85E7672B26955C802BB2FC94675 <br/>(Panda::Common) line 20<br/> in method build at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/9661E79563A62B3ABD3CB5E61B41BB801509267A <br/>(Panda::Builder) line 7<br/> in method install at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>(Panda) line 148<br/> in method resolve at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A <br/>(Panda) line 234<br/> in sub MAIN at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>line 18<br/> in block &lt;unit&gt; at <br/>/home/fibo/.rakudobrew/moar-nom/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 <br/>line 152<br/><br/>Am I missing something here?<br/><br/>thanks<br/><br/><br/>-- <br/>Theo van den Heuvel<br/>Van den Heuvel HLT Consultancy<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2858.html Wed, 22 Jun 2016 09:16:51 +0000 Re: Variant of 'with' which returns target object by Eduardo Cavazos Here&#39;s another example from gtk-simple:<br/><br/>https://github.com/perl6/gtk-simple/blob/d1fcc6efe1da3fd88a26b4328d6537c58607dee7/examples/07-text.pl6<br/><br/>Written with cascade:<br/><br/>https://gist.github.com/dharmatech/b8e8a71da8149382f192603e1b92d9b8<br/><br/>Ed<br/><br/>On Mon, Jun 6, 2016 at 4:12 PM, Eduardo Cavazos &lt;wayo.cavazos@gmail.com&gt;<br/>wrote:<br/><br/>&gt; Looks like I can get pretty close to what I was looking for with this<br/>&gt; subroutine:<br/>&gt;<br/>&gt; sub cascade ($obj, &amp;proc) { proc($obj); $obj; }<br/>&gt;<br/>&gt; Then, given the Point class again:<br/>&gt;<br/>&gt; class Point { has $.x is rw; has $.y is rw; }<br/>&gt;<br/>&gt; this:<br/>&gt;<br/>&gt; (Point.new.&amp;cascade: {.x = 10;}; Point.new.&amp;cascade: {.y = 20;})<br/>&gt;<br/>&gt; returns:<br/>&gt;<br/>&gt; (Point.new(x =&gt; 10, y =&gt; Any) Point.new(x =&gt; Any, y =&gt; 20))<br/>&gt;<br/>&gt; This came out of looking to see if it was possible to support method<br/>&gt; cascade syntax in Perl 6. See this question on stackoverflow:<br/>&gt;<br/>&gt; http://stackoverflow.com/questions/37559870/method-cascade-syntax<br/>&gt;<br/>&gt; Below, I&#39;ve included the gtk-simple example written to use &#39;cascade&#39;.<br/>&gt;<br/>&gt; As an aside, the Swift community has been discussing adding something like<br/>&gt; &#39;cascade&#39; to their standard library under the name &#39;with&#39;:<br/>&gt;<br/>&gt; https://gist.github.com/erica/96d9c5bb4eaa3ed3b2ff82dc35aa8dae<br/>&gt;<br/>&gt; Ed<br/>&gt;<br/>&gt; use v6;<br/>&gt;<br/>&gt; use GTK::Simple;<br/>&gt;<br/>&gt; sub cascade ($obj, &amp;proc) { proc($obj); $obj; }<br/>&gt;<br/>&gt; GTK::Simple::App.new(title =&gt; &#39;abc&#39;).&amp;cascade: {<br/>&gt;<br/>&gt; my $app = $_;<br/>&gt;<br/>&gt; my $button;<br/>&gt;<br/>&gt; .set-content:<br/>&gt; GTK::Simple::VBox.new(<br/>&gt; GTK::Simple::Button.new(label =&gt; &#39;bcd&#39;).&amp;cascade: {<br/>&gt; .clicked.tap({ .sensitive = False; $button.sensitive =<br/>&gt; True; });<br/>&gt; };<br/>&gt;<br/>&gt; $button = GTK::Simple::Button.new(label =&gt; &#39;cde&#39;).&amp;cascade: {<br/>&gt; .clicked.tap({ $app.exit; });<br/>&gt; }<br/>&gt; );<br/>&gt;<br/>&gt; .border-width = 20;<br/>&gt;<br/>&gt; .run;<br/>&gt; };<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; On Mon, Jun 6, 2016 at 1:12 PM, Eduardo Cavazos &lt;wayo.cavazos@gmail.com&gt;<br/>&gt; wrote:<br/>&gt;<br/>&gt;&gt; Hello,<br/>&gt;&gt;<br/>&gt;&gt; Here&#39;s a simple class:<br/>&gt;&gt;<br/>&gt;&gt; class Point { has $.x is rw; has $.y is rw; }<br/>&gt;&gt;<br/>&gt;&gt; &#39;with&#39; seems to return the result of evaluating the block. E.g. this<br/>&gt;&gt; expression will return a Point:<br/>&gt;&gt;<br/>&gt;&gt; with Point.new { .x = 10; $_; }<br/>&gt;&gt;<br/>&gt;&gt; Whereas this will return 10:<br/>&gt;&gt;<br/>&gt;&gt; with Point.new { .x = 10; }<br/>&gt;&gt;<br/>&gt;&gt; Is there a way for a user to define a variant of &#39;with&#39; which returns the<br/>&gt;&gt; target object instead of the result of the evaluating the block? I.e.:<br/>&gt;&gt;<br/>&gt;&gt; with_alt Point.new { .x = 10; }<br/>&gt;&gt;<br/>&gt;&gt; would return a Point.<br/>&gt;&gt;<br/>&gt;&gt; And this:<br/>&gt;&gt;<br/>&gt;&gt; (with_alt Point.new {.x = 10}; with_alt Point.new {.y = 20})<br/>&gt;&gt;<br/>&gt;&gt; would return a list of two Points.<br/>&gt;&gt;<br/>&gt;&gt; Thanks!<br/>&gt;&gt;<br/>&gt;&gt; Ed<br/>&gt;&gt;<br/>&gt;<br/>&gt; http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2857.html Mon, 06 Jun 2016 22:25:13 +0000 Re: Variant of 'with' which returns target object by yary On Mon, Jun 6, 2016 at 5:47 PM, yary &lt;not.com@gmail.com&gt; wrote:<br/><br/>&gt; GTK::Simple::Button.new(label =&gt; &#39;bcd&#39;).clicked. ...<br/><br/><br/>whoops, that should be<br/><br/> with GTK::Simple::Button.new(label =&gt; &#39;bcd&#39;) {<br/> .clicked.tap({ .sensitive = False; $button.sensitive =<br/>True; });<br/> }<br/><br/>alas I am on windows and Panda can&#39;t install GTK::Simple on my machine, not<br/>able to test.<br/><br/>-y http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2856.html Mon, 06 Jun 2016 21:53:28 +0000 Re: Variant of 'with' which returns target object by yary That&#39;s a nice &amp; small answer. It does seem overkill for the gtk example...<br/><br/>use v6;<br/><br/>use GTK::Simple;<br/><br/>with GTK::Simple::App.new(title =&gt; &#39;abc&#39;) {<br/><br/> my $app = $_;<br/><br/> my $button;<br/><br/> .set-content:<br/> GTK::Simple::VBox.new(<br/> GTK::Simple::Button.new(label =&gt; &#39;bcd&#39;).clicked.tap({<br/>.sensitive = False; $button.sensitive = True; });<br/><br/> $button = GTK::Simple::Button.new(label =&gt; &#39;cde&#39;);<br/> $button.clicked.tap({ $app.exit; });<br/>);<br/><br/> .border-width = 20;<br/><br/> .run;<br/>}; http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2855.html Mon, 06 Jun 2016 21:47:47 +0000 Re: Variant of 'with' which returns target object by Eduardo Cavazos Looks like I can get pretty close to what I was looking for with this<br/>subroutine:<br/><br/> sub cascade ($obj, &amp;proc) { proc($obj); $obj; }<br/><br/>Then, given the Point class again:<br/><br/> class Point { has $.x is rw; has $.y is rw; }<br/><br/>this:<br/><br/> (Point.new.&amp;cascade: {.x = 10;}; Point.new.&amp;cascade: {.y = 20;})<br/><br/>returns:<br/><br/> (Point.new(x =&gt; 10, y =&gt; Any) Point.new(x =&gt; Any, y =&gt; 20))<br/><br/>This came out of looking to see if it was possible to support method<br/>cascade syntax in Perl 6. See this question on stackoverflow:<br/><br/> http://stackoverflow.com/questions/37559870/method-cascade-syntax<br/><br/>Below, I&#39;ve included the gtk-simple example written to use &#39;cascade&#39;.<br/><br/>As an aside, the Swift community has been discussing adding something like<br/>&#39;cascade&#39; to their standard library under the name &#39;with&#39;:<br/><br/> https://gist.github.com/erica/96d9c5bb4eaa3ed3b2ff82dc35aa8dae<br/><br/>Ed<br/><br/>use v6;<br/><br/>use GTK::Simple;<br/><br/>sub cascade ($obj, &amp;proc) { proc($obj); $obj; }<br/><br/>GTK::Simple::App.new(title =&gt; &#39;abc&#39;).&amp;cascade: {<br/><br/> my $app = $_;<br/><br/> my $button;<br/><br/> .set-content:<br/> GTK::Simple::VBox.new(<br/> GTK::Simple::Button.new(label =&gt; &#39;bcd&#39;).&amp;cascade: {<br/> .clicked.tap({ .sensitive = False; $button.sensitive =<br/>True; });<br/> };<br/><br/> $button = GTK::Simple::Button.new(label =&gt; &#39;cde&#39;).&amp;cascade: {<br/> .clicked.tap({ $app.exit; });<br/> }<br/>);<br/><br/> .border-width = 20;<br/><br/> .run;<br/>};<br/><br/><br/><br/>On Mon, Jun 6, 2016 at 1:12 PM, Eduardo Cavazos &lt;wayo.cavazos@gmail.com&gt;<br/>wrote:<br/><br/>&gt; Hello,<br/>&gt;<br/>&gt; Here&#39;s a simple class:<br/>&gt;<br/>&gt; class Point { has $.x is rw; has $.y is rw; }<br/>&gt;<br/>&gt; &#39;with&#39; seems to return the result of evaluating the block. E.g. this<br/>&gt; expression will return a Point:<br/>&gt;<br/>&gt; with Point.new { .x = 10; $_; }<br/>&gt;<br/>&gt; Whereas this will return 10:<br/>&gt;<br/>&gt; with Point.new { .x = 10; }<br/>&gt;<br/>&gt; Is there a way for a user to define a variant of &#39;with&#39; which returns the<br/>&gt; target object instead of the result of the evaluating the block? I.e.:<br/>&gt;<br/>&gt; with_alt Point.new { .x = 10; }<br/>&gt;<br/>&gt; would return a Point.<br/>&gt;<br/>&gt; And this:<br/>&gt;<br/>&gt; (with_alt Point.new {.x = 10}; with_alt Point.new {.y = 20})<br/>&gt;<br/>&gt; would return a list of two Points.<br/>&gt;<br/>&gt; Thanks!<br/>&gt;<br/>&gt; Ed<br/>&gt; http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2854.html Mon, 06 Jun 2016 21:12:38 +0000 Re: "with" definedness check by yary On Mon, Jun 6, 2016 at 3:47 PM, Brandon Allbery &lt;allbery.b@gmail.com&gt; wrote:<br/>&gt; But for that there is &quot;given&quot;. I thought the whole point of &quot;with&quot; vs.<br/>&gt; &quot;given&quot; was the definedness check.<br/><br/>Ah yes, and that&#39;s a great feature. I forgot that &quot;with&quot; skips over<br/>the block when the topic is undefined, and that is very useful. I just<br/>had some not-great examples in my REPL, and had forgotten it.<br/><br/>-y<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2853.html Mon, 06 Jun 2016 19:52:16 +0000 Re: "with" definedness check by Brandon Allbery On Mon, Jun 6, 2016 at 3:45 PM, yary &lt;not.com@gmail.com&gt; wrote: <br/> <br/>&gt; On Mon, Jun 6, 2016 at 3:27 PM, Elizabeth Mattijsen &lt;liz@dijkmat.nl&gt; <br/>&gt; wrote: <br/>&gt; &gt; &ldquo;with&rdquo; is completely agnostic about what it is working on. It merely <br/>&gt; checks for definedness and sets the topicalizer if so. <br/>&gt; <br/>&gt; Hmm- what&#39;s the benefit of with&#39;s defined check? Seems like it makes <br/>&gt; &quot;with&quot; break if used with type objects. <br/>&gt; <br/> <br/>But for that there is &quot;given&quot;. I thought the whole point of &quot;with&quot; vs. <br/>&quot;given&quot; was the definedness check. <br/> <br/>-- <br/>brandon s allbery kf8nh sine nomine associates <br/>allbery.b@gmail.com ballbery@sinenomine.net <br/>unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2852.html Mon, 06 Jun 2016 19:47:55 +0000 "with" definedness check by yary On Mon, Jun 6, 2016 at 3:27 PM, Elizabeth Mattijsen &lt;liz@dijkmat.nl&gt; wrote: <br/>&gt; &ldquo;with&rdquo; is completely agnostic about what it is working on. It merely checks for definedness and sets the topicalizer if so. <br/> <br/>Hmm- what&#39;s the benefit of with&#39;s defined check? Seems like it makes <br/>&quot;with&quot; break if used with type objects. <br/> <br/>&gt; $_ = Complex; say .does(Numeric) <br/>True <br/>&gt; with Complex { say .does(Numeric) } <br/>() <br/> <br/>-y <br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2851.html Mon, 06 Jun 2016 19:46:01 +0000 Re: Variant of 'with' which returns target object by Elizabeth Mattijsen <br/>&gt; On 06 Jun 2016, at 21:17, Eduardo Cavazos &lt;wayo.cavazos@gmail.com&gt; wrote: <br/>&gt; <br/>&gt; On Mon, Jun 6, 2016 at 2:08 PM, yary &lt;not.com@gmail.com&gt; wrote: <br/>&gt; <br/>&gt; For your particular case, would it be sufficient to set the values in <br/>&gt; the constructor? <br/>&gt; <br/>&gt; with Point.new( :x(10) ) { .say } <br/>&gt; # says &quot;Point.new(x =&gt; 10, y =&gt; Any)&quot; <br/>&gt; <br/>&gt; Normally, that would be a good way to construct the Points in my example. I&#39;m just using the approach in my note to demonstrate &#39;with&#39;. <br/> <br/>&ldquo;with&rdquo; is completely agnostic about what it is working on. It merely checks for definedness and sets the topicalizer if so. <br/> <br/>Please also note there is nothing special about the method .new per se: it&rsquo;s just that there is some nice functionality built into the core if you don&rsquo;t create your own method &ldquo;new&rdquo; in your class and you inherit from Any (which is the default). <br/> <br/>Your suggestion seems rather specialized for your situation. <br/> <br/> <br/>Liz http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2850.html Mon, 06 Jun 2016 19:27:21 +0000 Re: Variant of 'with' which returns target object by Eduardo Cavazos On Mon, Jun 6, 2016 at 2:08 PM, yary &lt;not.com@gmail.com&gt; wrote:<br/><br/>&gt;<br/>&gt; For your particular case, would it be sufficient to set the values in<br/>&gt; the constructor?<br/>&gt;<br/>&gt; with Point.new( :x(10) ) { .say }<br/>&gt; # says &quot;Point.new(x =&gt; 10, y =&gt; Any)&quot;<br/>&gt;<br/><br/>Normally, that would be a good way to construct the Points in my example.<br/>I&#39;m just using the approach in my note to demonstrate &#39;with&#39;.<br/><br/>Ed http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2849.html Mon, 06 Jun 2016 19:17:25 +0000 Re: Variant of 'with' which returns target object by yary On Mon, Jun 6, 2016 at 2:12 PM, Eduardo Cavazos &lt;wayo.cavazos@gmail.com&gt; wrote:<br/>&gt;<br/>&gt; with_alt Point.new { .x = 10; }<br/>&gt;<br/>&gt; would return a Point.<br/>&gt;<br/>&gt; And this:<br/>&gt;<br/>&gt; (with_alt Point.new {.x = 10}; with_alt Point.new {.y = 20})<br/><br/>For your particular case, would it be sufficient to set the values in<br/>the constructor?<br/><br/>with Point.new( :x(10) ) { .say }<br/> # says &quot;Point.new(x =&gt; 10, y =&gt; Any)&quot;<br/><br/>with Point.new( :x(10) ), Point.new( :y(20) ) { .perl }<br/> # says &quot;(Point.new(x =&gt; 10, y =&gt; Any), Point.new(x =&gt; Any, y =&gt; 20))&quot;<br/><br/>It&#39;s not the general solution, but it does the trick for the examples.<br/><br/>-y<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2848.html Mon, 06 Jun 2016 19:08:47 +0000 Variant of 'with' which returns target object by Eduardo Cavazos Hello,<br/><br/>Here&#39;s a simple class:<br/><br/> class Point { has $.x is rw; has $.y is rw; }<br/><br/>&#39;with&#39; seems to return the result of evaluating the block. E.g. this<br/>expression will return a Point:<br/><br/> with Point.new { .x = 10; $_; }<br/><br/>Whereas this will return 10:<br/><br/> with Point.new { .x = 10; }<br/><br/>Is there a way for a user to define a variant of &#39;with&#39; which returns the<br/>target object instead of the result of the evaluating the block? I.e.:<br/><br/> with_alt Point.new { .x = 10; }<br/><br/>would return a Point.<br/><br/>And this:<br/><br/> (with_alt Point.new {.x = 10}; with_alt Point.new {.y = 20})<br/><br/>would return a list of two Points.<br/><br/>Thanks!<br/><br/>Ed http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2847.html Mon, 06 Jun 2016 18:13:06 +0000 Re: Fwd: perl6 INC by Bennett Todd Thanks, very much.<br/><br/>That talk inspired unhappiness in me, and I&#39;ve even written my thoughts out, but as all I&#39;ve got is an unconstructive rant, I&#39;m keeping it as an inspiration until I can offer my own perl6 package manager that suits my prejudices. <br/><br/>A sample of one: if the problem is that perl6 is intolerably slow to compile, arranging things so folks almost never notice should be the last resort.<br/><br/>Ok, two, I don&#39;t _want_ to install modules whose name I can&#39;t write, or unambiguously read.<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2846.html Sun, 05 Jun 2016 19:13:02 +0000 Re: Fwd: perl6 INC by Steve Mynott The video I was talking about is now at <br/> <br/>https://www.youtube.com/watch?v=uu8auCKCUN4 <br/> <br/>On 11 May 2016 at 15:38, Steve Mynott &lt;steve.mynott@gmail.com&gt; wrote: <br/>&gt; It&#39;s not a hack and the use of SHA files is basic to the requirements <br/>&gt; of how Perl 6 precomp works (totally different to how Perl 5 modules <br/>&gt; are used). Perl 6 is using bytecode not the actual perl module. This <br/>&gt; is also a moving target with work continuing. <br/>&gt; <br/>&gt; nine gave a good talk on this at the recent German Perl Workshop and <br/>&gt; hopefully videos will appear soon. <br/>&gt; <br/>&gt; On 11 May 2016 at 15:30, Bennett Todd &lt;bennett.e.todd@gmail.com&gt; wrote: <br/>&gt;&gt; Thanks for the explanation. Sounds like an unfortunate situation, rather than letting the system admin choose modules within the limits of filesystem namespace, it&#39;s using a separate database, opaque to filesystem tools. I hope this is just a temporary hack until a mature solution is hammered out. <br/>&gt; <br/>&gt; <br/>&gt; <br/>&gt; -- <br/>&gt; 4096R/EA75174B Steve Mynott &lt;steve.mynott@gmail.com&gt; <br/> <br/> <br/> <br/>-- <br/>4096R/EA75174B Steve Mynott &lt;steve.mynott@gmail.com&gt; <br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/06/msg2845.html Sun, 05 Jun 2016 19:04:30 +0000 Re: NativeCall interface for a char ** argument by Fernando Santagata On Fri, May 27, 2016 at 11:20 AM, Moritz Lenz &lt;moritz@faui2k3.org&gt; wrote:<br/><br/>&gt; In my experience, &quot;is rw&quot; doesn&#39;t always work, and I have no idea when<br/>&gt; or why.<br/>&gt;<br/>&gt; In DBIish (a DB interface with backends for PostgreSQL, mysql, sqlite3<br/>&gt; and Oracle, iirc) we tend to use CArray[Str] for the parameters, see for<br/>&gt; example<br/>&gt; https://github.com/perl6/DBIish/blob/master/lib/DBDish/Pg/Native.pm6#L83-92<br/>&gt;<br/><br/>Thank you Moritz, I&#39;ll start from that.<br/><br/>-- <br/>Fernando Santagata http://www.nntp.perl.org/group/perl.perl6.users/2016/05/msg2844.html Fri, 27 May 2016 09:31:46 +0000 Re: NativeCall interface for a char ** argument by Moritz Lenz Hi,<br/><br/>On 25.05.2016 17:35, Fernando Santagata wrote:<br/>&gt; Hello,<br/>&gt; <br/>&gt; Please excuse my naivety, I&#39;m trying to use NativeCall to interface a<br/>&gt; Perl6 program with a C library and I have a problem mapping a char **<br/>&gt; argument.<br/>&gt; <br/>&gt; The C function has this prototype:<br/>&gt; <br/>&gt; void function(char **arg1, char **arg2);<br/>&gt; <br/>&gt; I read that declaring a sub with Str rw parameters would do the trick:<br/>&gt; <br/>&gt; sub test(Str $arg1 is rw, Str $arg2 is rw) is native(&#39;mylibrary&#39;) { * }<br/>&gt; <br/>&gt; When I use the imported test function:<br/>&gt; <br/>&gt; my Str ($arg1, $arg2);<br/>&gt; test($arg1, $arg2);<br/>&gt; say $arg1, $arg2;<br/>&gt; <br/>&gt; what appears is just<br/>&gt; <br/>&gt; (Str)(Str)<br/><br/>In my experience, &quot;is rw&quot; doesn&#39;t always work, and I have no idea when<br/>or why.<br/><br/>In DBIish (a DB interface with backends for PostgreSQL, mysql, sqlite3<br/>and Oracle, iirc) we tend to use CArray[Str] for the parameters, see for<br/>example<br/>https://github.com/perl6/DBIish/blob/master/lib/DBDish/Pg/Native.pm6#L83-92<br/><br/>Cheers,<br/>Moritz<br/> http://www.nntp.perl.org/group/perl.perl6.users/2016/05/msg2843.html Fri, 27 May 2016 09:20:47 +0000