Re: How to use WHY on a object's method?

2022-01-17 Thread David Emanuel da Costa Santiago
Super! That's what i was looking for. Thanks! David Santiago Às 18:43 de 17/01/22, Clifton Wood escreveu: You need the method object, and you can't get that from $a.test  -- Try using the following: when X::AdHoc { say $a.^lookup('test').WHY; # TODO: This is wrong :-( } I've tested

Re: How to use WHY on a object's method?

2022-01-17 Thread Clifton Wood
You need the method object, and you can't get that from $a.test -- Try using the following: when X::AdHoc { say $a.^lookup('test').WHY; # TODO: This is wrong :-( } I've tested it here ( https://replit.com/@Xliff/ThinDutifulExtensions#main.raku) and it works! :) -X On Mon, Jan 17, 2022 at 12

How to use WHY on a object's method?

2022-01-17 Thread David Emanuel da Costa Santiago
Hello Rakuns, How do i access the declarator block of my object method? I'm trying to do this, but it's not working: class A { #|( This is just a test with 3 parameters: * p1 - parameter 1 * p2 - parameter 1 * p2 - parameter 1 ) method test($p1, $p2, $p3) {

Re: why not raku ?

2021-11-22 Thread Ralph Mellor
On Mon, Nov 22, 2021 at 3:33 AM Clifton Wood wrote: > > It has two compelling use cases, and it's the ones that > brought me to Raku in the first place: It has compelling use cases for me too, and I agree that grammars and nativecall are both contenders. :) But, fwiw, I didn't say just

why not raku ?

2021-11-22 Thread Clifton Wood
Tom: Thanks for the mention of gptrixie. I am aware of it. When C++ support is added, I will circle back to it. > Not so easy to find in the docs, but here is a useful module that might be > the first place to start helping with: https://github.com/Skarsnik/gptrixie > It says support for C++ is

Re: why not raku ?

2021-11-22 Thread Tom Browder
On Mon, Nov 22, 2021 at 12:13 PM Clifton Wood wrote: > Aureliano: > You are correct. That is an effective workaround, but it will be a > maintenance nightmare for large C++ libraries if you have to wrap every > method. > There has to be a better way. Not so easy to find in the docs, but here

Re: why not raku ?

2021-11-22 Thread Clifton Wood
Aureliano: You are correct. That is an effective workaround, but it will be a maintenance nightmare for large C++ libraries if you have to wrap every method. There has to be a better way. - X On Mon, Nov 22, 2021 at 1:06 PM Aureliano Guedes wrote: > Clifton, I think the best solution is wrap

Re: why not raku ?

2021-11-22 Thread Aureliano Guedes
Clifton, I think the best solution is wrap with C and then use Raku's NativeCall. Like this example #include extern "C" { std::vector* intvec_new() { return new std::vector(); } void

Re: why not raku ?

2021-11-22 Thread Clifton Wood
Aureliano: How are you attempting to call xframe functions? On Mon, Nov 22, 2021 at 11:24 AM Aureliano Guedes < guedes.aureli...@gmail.com> wrote: > Hi Clifton Wood, > Here it is. > https://andrewshitov.com/2020/01/08/calling-cpp-and-fortran-functions-from-raku-using-the-nativecall-interface/ >

Re: why not raku ?

2021-11-22 Thread Aureliano Guedes
Hi Clifton Wood, Here it is. https://andrewshitov.com/2020/01/08/calling-cpp-and-fortran-functions-from-raku-using-the-nativecall-interface/ It was, by far, the best example I founded. But as simple as it is, I fail to call functions from xframe to raku.

Re: why not raku ?

2021-11-22 Thread rir
CURI? rob

Re: why not raku ?

2021-11-22 Thread Clifton Wood
Aureliano, where was this example for C++? I'd love to take a look at it! Raku could really use a dose of Qt. On Mon, Nov 22, 2021 at 8:52 AM Salve J Nilsen wrote: > Piper H said: > > > Has Larry Wall joined the development team of raku? > > He's been part of it since the very beginning. He's

Re: why not raku ?

2021-11-22 Thread Salve J Nilsen
Piper H said: > Has Larry Wall joined the development team of raku? He's been part of it since the very beginning. He's also on this list, chipping in now and then (last time was in June this year). - Salve -- #!/usr/bin/env perl sub AUTOLOAD{$AUTOLOAD=~/.*::(\d+)/;seek(DATA,$1,0);print#

Re: why not raku ?

2021-11-22 Thread Piper H
, and then the >>>>> program would die. But instead it dies at compile-time >>>>> (`constant`s are initialized at compile-time). >>>>> >>>>> That said, the usual way of using it is to run a program, >>>>> which compiles it, an

Re: why not raku ?

2021-11-22 Thread Aureliano Guedes
it is to run a program, >>>> which compiles it, and then, if it successfully compiles, >>>> immediately runs the compiled program. >>>> >>>> > I don't raku that much and most of the time, i read the >>>> > doc more than i actually write

Re: why not raku ?

2021-11-21 Thread Clifton Wood
>>> > I don't raku that much and most of the time, i read the >>> > doc more than i actually write code but when it's writen, >>> > it's always elegant and concise the way i never seen before. >>> >>> Many folk who like Ruby or Python o

Re: why not raku ?

2021-11-21 Thread Clifton Wood
ore than i actually write code but when it's writen, >> > it's always elegant and concise the way i never seen before. >> >> Many folk who like Ruby or Python or Lang X say much the >> same thing about those PLs. >> >> > > Maybe perl6 is still not prod

Re: why not raku ?

2021-11-21 Thread Piper H
't raku that much and most of the time, i read the > > doc more than i actually write code but when it's writen, > > it's always elegant and concise the way i never seen before. > > Many folk who like Ruby or Python or Lang X say much the > same thing about those PLs. > > > >

Re: why not raku ?

2021-11-21 Thread Ralph Mellor
is still not production-ready? Imo it's as production ready as Python. > > but why so few open source projects which were developed by perl6? It's all relative. Compared to most of the thousands of PLs with less projects, there are lots of projects developed in Raku. But you presum

Re: why not raku ?

2021-11-19 Thread Piper H
I know Numpy well, i can help provide some suggestions. I even use Rumale for ML. On Friday, November 19, 2021, Tom Browder wrote: > On Fri, Nov 19, 2021 at 07:48 Aureliano Guedes > wrote: > >> I am still defending that we need a package for data >> analysis/science/engineer (like the Perl5

Re: why not raku ?

2021-11-19 Thread Tom Browder
On Fri, Nov 19, 2021 at 07:48 Aureliano Guedes wrote: > I am still defending that we need a package for data > analysis/science/engineer (like the Perl5 PDL, Python Pandas or R > data.table) and an IDE for streaming programming like jupyter or rstudio. > Speaking for myself, I agree, and I

Re: why not raku ?

2021-11-19 Thread Aureliano Guedes
such as xtensor and xframe. Why? I should answer: "Why not?". But data technologies are growing fast and require a lot of new options (in my experience). Async, parallelism builtin are goodies to use with data processes. On Fri, Nov 19, 2021 at 10:04 AM Paul Procacci wrote: > R

Re: why not raku ?

2021-11-19 Thread Paul Procacci
ases and you'll see raku is production ready > enough for lot of things. > > > but why so few open source projects which were developed by perl6? > > wow ... interesting question. my cents on it: > > * raku shines on interpreted langages when people are moving to compiled >

Re: why not raku ?

2021-11-19 Thread Piper H
duction-ready? > > Perl6 is now raku. > > it depends: what do you mean by "production" and "ready"? start with > some few non-critical usecases and you'll see raku is production ready > enough for lot of things. > > > but why so few open source projects which we

why not raku ?

2021-11-19 Thread Marc Chantreux
still not production-ready? Perl6 is now raku. it depends: what do you mean by "production" and "ready"? start with some few non-critical usecases and you'll see raku is production ready enough for lot of things. > but why so few open source projects which were developed b

Re: Why does .new initialize?

2021-07-20 Thread William Michels via perl6-users
Possibly relevant StackOverflow question: "Why does constraining a Perl 6 named parameter to a definite value make it a required value?" https://stackoverflow.com/questions/48166325/why-does-constraining-a-perl-6-named-parameter-to-a-definite-value-make-it-a-req On Mon, Jul 19, 2021 a

Re: Why does .new initialize?

2021-07-19 Thread Vadim Belman
Matthew has provided some concrete examples of default initializations. I'd like to scratch the surface of more general problem: encapsulation. In many cases only a class knows it's real internal structure and can use this information to protect the data from misuse by 3rd party code which may

Re: Why does .new initialize?

2021-07-19 Thread Matthew Stuckwisch
In general, the idea of initialized doesn't mean a lot in Raku, at least not at the language level. At any given time, any variable has a value. By default, if you've typed a variable, it's initially set to the type itself (Any is the default type, so the default default value). The only

Re: Why does .new initialize?

2021-07-19 Thread Peter Scott
Yes.  I'm agnostic on this point, but there was a time when some prominent Perl contributors were dogmatic about it and I didn't know how widespread it was. Peter On 7/19/2021 10:06 AM, Vadim Belman wrote: Let me guess. The school prohibits object self-initialization? It has to be done by

Re: Why does .new initialize?

2021-07-19 Thread Vadim Belman
Let me guess. The school prohibits object self-initialization? It has to be done by external code? Best regards, Vadim Belman > On Jul 19, 2021, at 1:00 PM, Peter Scott wrote: > > On 7/19/2021 1:24 AM, Elizabeth Mattijsen wrote: >> If .new wouldn't initialize a type to its basic

Re: Why does .new initialize?

2021-07-19 Thread Peter Scott
On 7/19/2021 1:24 AM, Elizabeth Mattijsen wrote: If .new wouldn't initialize a type to its basic instantiation, what would be the point of .new then? FWIW, the same goes for: dd Int.new; # 0 dd Num.new; # 0e0 dd Complex.new; # <0+0i> dd Str.new; # "" If

Re: Why does .new initialize?

2021-07-19 Thread Elizabeth Mattijsen
> On 19 Jul 2021, at 05:49, Peter Scott wrote: > > I'm curious as to why Rat.new initializes instead of leaving as undefined: > > > $*RAKU > Raku (6.d) > > my Rat $p > (Rat) > > put $p > Use of uninitialized value $p of type Rat in string context. >

Why does .new initialize?

2021-07-18 Thread Peter Scott
I'm curious as to why Rat.new initializes instead of leaving as undefined: > $*RAKU Raku (6.d) > my Rat $p (Rat) > put $p Use of uninitialized value $p of type Rat in string context. Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.   in block

Re: why so different

2020-06-22 Thread Aureliano Guedes
Thanks again. I'm trying to get proficiency in Raku by converting some Python programs mine in Raku. On Mon, Jun 22, 2020 at 6:41 PM Tobias Boege wrote: > On Mon, 22 Jun 2020, Aureliano Guedes wrote: > > Thank you for the clarification. > > > > There is a method to set Rat precision at the

Re: why so different

2020-06-22 Thread Tobias Boege
On Mon, 22 Jun 2020, Aureliano Guedes wrote: > Thank you for the clarification. > > There is a method to set Rat precision at the scope of the program to apply > to all *.Rat() cases? > I don't know, based on a quick search in the documentation, of any global setting. The hacky solution would

Re: why so different

2020-06-22 Thread Aureliano Guedes
n Raku. Then let's go to my question. > > > > I'm trying to figure out why we got so different results here: > > > > > e.Rat()**(pi.Rat()*i) > > -0.9902-1.3942922582021257e-07i > > > e**(pi*i) > > -1+1.2246467991473532e-16i > > > e.Ra

Re: why so different

2020-06-22 Thread Tobias Boege
On Mon, 22 Jun 2020, Aureliano Guedes wrote: > Hi all, > > First, I'm naive in Raku. Then let's go to my question. > > I'm trying to figure out why we got so different results here: > > > e.Rat()**(pi.Rat()*i) > -0.9902-1.3942922582021257e-07i > > e

why so different

2020-06-22 Thread Aureliano Guedes
Hi all, First, I'm naive in Raku. Then let's go to my question. I'm trying to figure out why we got so different results here: > e.Rat()**(pi.Rat()*i) -0.9902-1.3942922582021257e-07i > e**(pi*i) -1+1.2246467991473532e-16i > e.Rat()**(pi.Rat()*i) == e**(pi*i) False I u

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/28/19 4:26 PM, ToddAndMargo via perl6-users wrote: On 4/20/19 8:58 PM, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/20/19 8:58 PM, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks,

Re: Why so slow

2019-04-28 Thread Joseph Brenner
Brad Gilbert wrote: > For one it has the following line: > > use lib 'lib'; > > That is going to slow everything down if you have anything in the > `lib` directory. > The more things in that directory, the slower it will get. I've been seeing some pretty slow perl6 one-line invocations,

Re: Why so slow

2019-04-28 Thread Joseph Brenner
ToddAndMargo via perl6-users wrote: > David Christensen wrote: >> We discussed this at our San Francisco Perl Mongers meeting today: > > Any Perl 5 guys there? And did they get "grouchy" with you > for using Perl 6? We've been doing an "Informal Perl6 Study Group" over at the Oakland Museum

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/28/19 2:21 AM, Timo Paulssen wrote: the strace command ended up only tracing the shell script "perl6", which very quickly execs moar, at which point strace considers its job done. there was barely any output at all for that reason. fortunately we can just add -f to the strace command so

Re: Why so slow

2019-04-28 Thread Timo Paulssen
the strace command ended up only tracing the shell script "perl6", which very quickly execs moar, at which point strace considers its job done. there was barely any output at all for that reason. fortunately we can just add -f to the strace command so that it follows processes as they are

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/27/19 10:40 PM, David Christensen wrote: We discussed this at our San Francisco Perl Mongers meeting today: Any Perl 5 guys there? And did they get "grouchy" with you for using Perl 6? Did they call Perl 6 "Java" by any chance? Chuckle.

Re: Why so slow

2019-04-28 Thread David Christensen
On 4/27/19 10:40 PM, David Christensen wrote: I suggested that he install the official package: https://rakudo.org/files The Rakudo site is degraded: "Currently, rakudo.org is being served from a back-up server that doesn't have the download files." I had previously downloaded

Re: Why so slow

2019-04-28 Thread David Christensen
On 4/28/19 12:07 AM, Timo Paulssen wrote: I'm writing a program called moarperf, which is a local web app written in Cro that doesn't touch the network outside of loopback. It just has to build its JavaScript blobs once by downloading like a brazillion libraries from npm. That should be

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/28/19 12:01 AM, Timo Paulssen wrote: especially if it iterates your entire home directory Don't think so $ rm -rf ~/.perl6/precomp $ perl6 --stagestats GetUpdates.pl6 Stage start : 0.000 Stage parse : 13.201 Stage syntaxcheck: 0.000 Stage ast: 0.000 Stage

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
Hi Timo, This tell you anything? $ perl6 --stagestats GetUpdates.pl6 Stage start  :   0.000 Stage parse  :  13.150 Stage syntaxcheck:   0.000 Stage ast    :   0.000 Stage optimize   :   0.351 Stage mast   :   1.133 Stage mbc    :   0.019 Stage moar   :   0.000

Re: Why so slow

2019-04-28 Thread Timo Paulssen
I'm writing a program called moarperf, which is a local web app written in Cro that doesn't touch the network outside of loopback. It just has to build its JavaScript blobs once by downloading like a brazillion libraries from npm. Also, comma complete comes with support for profiling, which

Re: Why so slow

2019-04-28 Thread Timo Paulssen
Please give this a try:     env RAKUDO_MODULE_DEBUG=1 perl6 GetUpdates.pl6 and tell me if any of the lines it spits out takes considerable amounts of time before the next one shows up. Then, you can also     strace -e stat perl6 GetUpdates.pl6 to see if it's going through a whole load of

Re: Why so slow

2019-04-28 Thread David Christensen
On 21/04/2019 05:58, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. >> What gives? Many

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
> On 21/04/2019 05:58, ToddAndMargo via perl6-users wrote:>> Hi All, >> >> One liners are fast, but my own programs are very slow to start. >> >> I download >> >> https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 >> >> To check it out and it also takes ten second to start. >>

Re: Why so slow

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/27/19 10:40 PM, David Christensen wrote: What is your operating system? Fedora 29 x64 Xfce 4.13 $ uname -r 5.0.7-200.fc29.x86_64 What is your Perl 6? $ rpm -qa rakudo rakudo-0.2019.03-1.fc29.x86_64 Also tried: https://github.com/nxadm/rakudo-pkg/releases

Re: Why so slow

2019-04-28 Thread Timo Paulssen
You don't happen to have a PERL6LIB or -I pointed at a folder with loads of stuff in it? If that is the case, having a single "use" statement will cause rakudo to iterate through all files and subfolders, which can take a long time if you've got, for example, your home directory in that list

Re: Why so slow

2019-04-27 Thread David Christensen
On 4/20/19 8:58 PM, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks,

Re: Why so slow

2019-04-27 Thread Brad Gilbert
>From >https://brrt-to-the-future.blogspot.com/2018/07/perl-6-on-moarvm-has-had-jit-for-few.html > PS: You might read this and be reasonably surprised that Rakudo Perl 6 is > not, after all this, very fast yet. I have a - not entirely serious - > explanation for that: > 1. All problems in

Re: Why so slow

2019-04-27 Thread ToddAndMargo via perl6-users
On 4/20/19 8:58 PM, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks,

Re: Why so slow

2019-04-24 Thread ToddAndMargo via perl6-users
Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks, -T On 4/24/19 5:13 AM, Brad Gilbert wrote:> For one

Re: Why so slow

2019-04-24 Thread Brad Gilbert
For one it has the following line: use lib 'lib'; That is going to slow everything down if you have anything in the `lib` directory. The more things in that directory, the slower it will get. You should really install the modules with `zef`. (It can download and install the modules itself.)

Why so slow

2019-04-24 Thread ToddAndMargo via perl6-users
Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks, -T

Re: Why so slow?

2019-04-23 Thread ToddAndMargo via perl6-users
On 4/21/19 6:32 PM, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks,

Re: Why so slow?

2019-04-23 Thread ToddAndMargo via perl6-users
On 4/22/19 4:21 AM, ToddAndMargo via perl6-users wrote: On 22/04/2019 12:51, ToddAndMargo via perl6-users wrote: On 22/04/2019 03:32, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download

Re: Why so slow?

2019-04-22 Thread ToddAndMargo via perl6-users
On 22/04/2019 12:51, ToddAndMargo via perl6-users wrote: On 22/04/2019 03:32, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and

Re: Why so slow?

2019-04-22 Thread Timo Paulssen
It's the second line: use v6; use lib 'lib';  # ← this line right here use GTK::Simple; use GTK::Simple::App;   -Timo On 22/04/2019 12:51, ToddAndMargo via perl6-users wrote: >>> On 22/04/2019 03:32, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own

Re: Why so slow?

2019-04-22 Thread ToddAndMargo via perl6-users
On 22/04/2019 03:32, ToddAndMargo via perl6-users wrote: Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks,

Re: Why so slow?

2019-04-22 Thread Timo Paulssen
It's quite possible that when you start that program, you're first waiting for GTK::Simple to be precompiled; the "use lib 'lib'" can interfere with the storage of precompilation results. If you have installed GTK::Simple (for example by going to its folder and running "zef install .") and removed

Why so slow?

2019-04-21 Thread ToddAndMargo via perl6-users
Hi All, One liners are fast, but my own programs are very slow to start. I download https://github.com/perl6/gtk-simple/blob/master/examples/05-bars.pl6 To check it out and it also takes ten second to start. What gives? Many thanks, -T

Re: Why use dd to convert a string to an integer?

2018-08-07 Thread ToddAndMargo
On 08/07/2018 02:24 AM, Simon Proctor wrote: Moarvm is the Perl6 Virtual Machine that is one of the targets Rakudo compiles to (the JVM is another). Basically at the moment when people talk about Perl6 that mostly mean Perl6 compiled with Rakudo running on MoarVM. (As I understand it). the

Re: Why use dd to convert a string to an integer?

2018-08-07 Thread Simon Proctor
t; >> I did was add quotes around $y, as in the above line. > >> > >> $ p6 'my Str $x = "5"; my Int $y = dd +$x; say "$y";' > >> 5 > >> Use of uninitialized value $y of type Int in string context. > >>

Re: Why use dd to convert a string to an integer?

2018-08-07 Thread ToddAndMargo
value $y of type Int in string context. Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful. Why would I want to use "dd"? Many thanks, -T On 08/07/2018 12:19 AM, Simon Proctor wrote: dd is the moarvm specifi

Re: Why use dd to convert a string to an integer?

2018-08-07 Thread Simon Proctor
;; my Int $y = dd +$x; say "$y";' > 5 > Use of uninitialized value $y of type Int in string context. > Methods .^name, .perl, .gist, or .say can be used to stringify > it to something meaningful. > > > Why would I want to use "dd"? > > Many thanks, > -T > -- Simon Proctor Cognoscite aliquid novum cotidie

Why use dd to convert a string to an integer?

2018-08-07 Thread ToddAndMargo
the above line. $ p6 'my Str $x = "5"; my Int $y = dd +$x; say "$y";' 5 Use of uninitialized value $y of type Int in string context. Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful. Why would I want to use "dd"? Many thanks, -T

Re: Why can't I "write"?

2017-09-28 Thread ToddAndMargo
On 09/23/2017 12:35 PM, Brandon Allbery wrote: On Sat, Sep 23, 2017 at 3:31 PM, Brandon Allbery > wrote: On Sat, Sep 23, 2017 at 2:09 AM, ToddAndMargo > wrote:       method

Re: Why can't I "write"?

2017-09-28 Thread ToddAndMargo
On 09/23/2017 12:05 AM, Brent Laabs wrote: OK, a method is something you call on an object, using a the dot operator.  A subroutine is an independent object installed into your current lexical scope. If write was a sub, it would work exactly as you described:    48:   my $Handle = open(

Re: Why can't I "write"?

2017-09-23 Thread Brandon Allbery
On Sat, Sep 23, 2017 at 3:31 PM, Brandon Allbery wrote: > On Sat, Sep 23, 2017 at 2:09 AM, ToddAndMargo > wrote: > >> method write(IO::Handle:D: Blob:D $buf --> True) >> > > The key here is the colon *after* `IO::Handle:D`: that marks the Handle

Re: Why can't I "write"?

2017-09-23 Thread Brandon Allbery
On Sat, Sep 23, 2017 at 2:09 AM, ToddAndMargo wrote: > method write(IO::Handle:D: Blob:D $buf --> True) > The key here is the colon *after* `IO::Handle:D`: that marks the Handle as an invocant, i.e. this is a method to be applied to an object. (The fact that it has

Re: Why can't I "write"?

2017-09-23 Thread Brent Laabs
OK, a method is something you call on an object, using a the dot operator. A subroutine is an independent object installed into your current lexical scope. If write was a sub, it would work exactly as you described: 48: my $Handle = open( $DateFile, :rw ) 53: write( $Handle,

Re: Why can't I "write"?

2017-09-23 Thread ToddAndMargo
On Sat, Sep 23, 2017 at 8:19 AM, ToddAndMargo > wrote: On 09/22/2017 11:09 PM, ToddAndMargo wrote: Hi All, https://docs.perl6.org/routine/write (IO::Handle)

Re: Why can't I "write"?

2017-09-23 Thread Fernando Santagata
Hi, "write" is a method; its signature is method write(IO::Handle:D: Blob:D $buf --> True) so it has to be called as a method, not a sub. Also note the way the first argument is declared, as a IO::Handle:D:, without a comma separating it from the second argument. That's the type of the object

Re: Why can't I "write"?

2017-09-23 Thread ToddAndMargo
On 09/22/2017 11:09 PM, ToddAndMargo wrote: Hi All, https://docs.perl6.org/routine/write (IO::Handle) method write Defined as: method write(IO::Handle:D: Blob:D $buf --> True) Writes $buf to the filehandle. This method can be called even when the handle is

Why can't I "write"?

2017-09-23 Thread ToddAndMargo
Hi All, https://docs.perl6.org/routine/write (IO::Handle) method write Defined as: method write(IO::Handle:D: Blob:D $buf --> True) Writes $buf to the filehandle. This method can be called even when the handle is not in binary mode. This: 48: my $Handle =

Re: Why is my class rejecting new()?

2017-07-20 Thread Richard Hainsworth
$!qty = $way == "B" ?? $qty !! - $qty; $!amount = $amount; $!desc = $desc; } }** which I instantiate with my $e = Etran.new($line); However, it gives an error message: Cannot look up attributes in a Etran type object at the line $!dstamp = $dstamp; Why that, and how do I fix it? Also, I don't really understand the difference between using the twigils "." and using "!", and have yet to see an explanation that I understand.

Re: Why is my class rejecting new()?

2017-07-20 Thread Timo Paulssen
y == "B" ?? $qty !! - $qty; > $!amount = $amount; > $!desc = $desc; > } > > }** > which I instantiate with > my $e = Etran.new($line); > > However, it gives an error message: > Cannot look up attributes in

Why is my class rejecting new()?

2017-07-20 Thread Mark Carter
** which I instantiate with my $e = Etran.new($line); However, it gives an error message: Cannot look up attributes in a Etran type object at the line $!dstamp = $dstamp; Why that, and how do I fix it? Also, I don't really understand the difference between using the twigils &qu

[perl #131097] Why doesn't Perl 6's try handle a non-zero exit in shell()?

2017-04-04 Thread Zoffix Znet via RT
On Tue, 04 Apr 2017 02:52:53 -0700, comdog wrote: > I originally asked about this on Stackoverflow > (http://stackoverflow.com/q/43199427/2766176) > > This `try` catches the exception: > > try die X::AdHoc; > say "Got to the end"; > > The output shows that the program continues: > > Got to the

Re: [perl #131097] Why doesn't Perl 6's try handle a non-zero exit in shell()?

2017-04-04 Thread Elizabeth Mattijsen
Thanks for reporting! Turns out this isn’t actually a bug, but the way shell() works. As Jonathan explained at: https://irclog.perlgeek.de/perl6-dev/2017-04-04#i_14372945 the shell() function returns a Proc object. This only throws the shelling out failed and the Proc object is sunk. So

[perl #131097] Why doesn't Perl 6's try handle a non-zero exit in shell()?

2017-04-04 Thread brian d foy
# New Ticket Created by "brian d foy" # Please include the string: [perl #131097] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=131097 > I originally asked about this on Stackoverflow

Re: DBIish: Why can't I interpolate variable holding database name?

2016-05-01 Thread Moritz Lenz
On 01.05.2016 15:36, James E Keenan wrote: > > Thanks; that worked: > > # > cat dbiish_connect_dynamic_3.pl6 > #!/usr/bin/env perl6 > use DBIish; > > my $db = 'hierarchy'; > my $dbh = DBIish.connect("Pg", :database($db)); Another nice little language feature is that you can reuse the name

Re: DBIish: Why can't I interpolate variable holding database name?

2016-05-01 Thread James E Keenan
ct_dynamic_2.pl6 Too many positionals passed; expected 2 arguments but got 3 in method connect at /home/jkeenan/rakudo-star/share/perl6/site/sources/3EA876C6AC912AF3692CEF8EEF5E9033C03F7507 (DBIish) line 29 in block at dbiish_connect_dynamic_2.pl6 line 5 # Why does variable interpolation not work here? What

Re: DBIish: Why can't I interpolate variable holding database name?

2016-05-01 Thread Brock Wilcox
Iish.connect("Pg", ":database<$db>"); > > say "Database $db: connection ", ($dbh.ping ?? "established" !! "not > established"); > # > > But that gave me a different error: > > # > $ perl6 dbiish_connect_dynamic

Re: DBIish: Why can't I interpolate variable holding database name?

2016-05-01 Thread Mathieu Gagnonn
uot;Pg", ":database<$db>"); > > say "Database $db: connection ", ($dbh.ping ?? "established" !! "not > established"); > ##### > > But that gave me a different error: > > # > $ perl6 dbiish_connect_dynamic_2.pl6 >

DBIish: Why can't I interpolate variable holding database name?

2016-05-01 Thread James E Keenan
But that gave me a different error: # $ perl6 dbiish_connect_dynamic_2.pl6 Too many positionals passed; expected 2 arguments but got 3 in method connect at /home/jkeenan/rakudo-star/share/perl6/site/sources/3EA876C6AC912AF3692CEF8EEF5E9033C03F7507 (DBIish) line 29 in block at dbiis

Re: perl6/book fonts: why Adobe commercial fonts?

2015-07-23 Thread Moritz Lenz
Hi, On 07/23/2015 01:03 AM, Tom Browder wrote: Is there any reason to use Adobe commercial fonts for the book? As I read the instructions to copy fonts from Adobe Reader, I worry that that is prohibited by the license from Adobe. Building the book without the fonts results in an ugly book in

Re: perl6/book fonts: why Adobe commercial fonts?

2015-07-22 Thread Aristotle Pagaltzis
* Tom Browder tom.brow...@gmail.com [2015-07-23 01:05]: (There are plenty of free and handsome fonts to be had.) Some of the best of which, ironically, also from Adobe… -- Aristotle Pagaltzis // http://plasmasturm.org/

perl6/book fonts: why Adobe commercial fonts?

2015-07-22 Thread Tom Browder
Is there any reason to use Adobe commercial fonts for the book? As I read the instructions to copy fonts from Adobe Reader, I worry that that is prohibited by the license from Adobe. Building the book without the fonts results in an ugly book in some parts. (There are plenty of free and

[perl6/specs] 1e5230: clarify why more/done distinction in winner works

2013-11-17 Thread GitHub
: M S17-concurrency.pod Log Message: --- clarify why more/done distinction in winner works more only makes sense on on channels, while done only works on promises, and hence will happily autocoerce a channel to its 'done' promise.

[perl6/specs] 2d423f: .WHY is specced now.

2013-05-22 Thread GitHub
2013) Changed paths: M S12-objects.pod Log Message: --- .WHY is specced now.

Re: Q: Is there a reason why I can't do this?

2010-12-28 Thread Daniel Carrera
On Tue, Dec 28, 2010 at 5:27 AM, yary not@gmail.com wrote: On Mon, Dec 27, 2010 at 8:50 PM, Daniel Carrera dcarr...@gmail.com wrote: So TTIR just means that any two terms must be separated by something, like an operator (2+5). Which basically is common sense and I'm actually

Re: Q: Is there a reason why I can't do this?

2010-12-28 Thread Chas. Owens
On Tue, Dec 28, 2010 at 05:13, Daniel Carrera dcarr...@gmail.com wrote: On Tue, Dec 28, 2010 at 5:27 AM, yary not@gmail.com wrote: On Mon, Dec 27, 2010 at 8:50 PM, Daniel Carrera dcarr...@gmail.com wrote: So TTIR just means that any two terms must be separated by something, like an

  1   2   3   4   5   6   >