Re: need help with "next"

2017-05-23 Thread Norman Gaywood
On 24 May 2017 at 15:20, ToddAndMargo  wrote:
>
>
> This is what I came up with.  I found that `next` did not serve me
> well, so i just used a tag.
>
> Thank you all for the help.  I had a bit of a time wrapping
> my head around `next` there for a while.
>
> -T
>
> 
> #!/usr/bin/env perl6
>
> use strict;
>
> my @Data = 'Mission D',
>'   Sol Wheat',
>'   Ted Moon',
>'';
> # for @Data -> $Line { say "$Line"; }
>
> my $TaskTag = 0;
> for @Data -> $Line {
>if $Line.contains( "TASK type" ) { $TaskTag = 1; }
>
>if $Line.contains( "NAME type" ) {
>   ( my $Name = $Line) ~~ s/.*?\>//;
>   $Name ~~ s/\<.*//;
>   say $Name;
>} else { $TaskTag = 0; }
>
> }
> 
>

I'm a rank beginner p6 programmer so I'm sure my code can be improved.

However, your code does not look like it will do what you want if you have
multiple TASKs

What about something like:
my @Data =
 'Mission D',
   '   Sol Wheat',
   '   Ted Moon',
 '',
 'Mission C',
   '   Jim Kirk',
   '   Mr Spock',
 '',
;

my $in-TASK = "";

for @Data -> $Line {
if $Line.contains( "TASK type" ) {
$Line ~~ m/ 'TASK' .*? '>' $=( .* ) /;
$in-TASK = $;
next;
}
if $Line.contains( "/TASK" ) {
$in-TASK = "";
next;
}
if $in-TASK ne "" && $Line.contains( "NAME type" ) {
$Line ~~ m/ 'NAME' .*? '>' $=( .*? ) '<' /;
say $in-TASK, $;
}
}


-- 
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia

ngayw...@une.edu.au  http://turing.une.edu.au/~ngaywood
Phone: +61 (0)2 6773 2412  Mobile: +61 (0)4 7862 0062

Please avoid sending me Word or Power Point attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


Re: need help with "next"

2017-05-23 Thread ToddAndMargo



On Wednesday, May 24, 2017 01:20 PM, ToddAndMargo wrote:

On 05/23/2017 09:30 PM, ToddAndMargo wrote:

Hi All,

I have a test code in progress and I haven't figured out
how to get 'next' to work the way I want.

 next if $Line.contains( "TASK type" );

works, but

 if $Line.contains( "TASK type" ) {
next;

does not.

What am I missing?

Many thanks,
-T
yes I know I still have some things to fix on it.



#!/usr/bin/env perl6

use strict;

my @Data = 'Mission D',
'   Sol Wheat',
'   Ted Moon',
'';
# for @Data -> $Line { say "$Line"; }

for @Data -> $Line {
# next if $Line.contains( "TASK type" );
if $Line.contains( "TASK type" ) {
   next;
   my $Name = $Line;
   if $Name.contains( "NAME type" ) {
  $Name ~~ s/.*?\>//;
  $Name ~~ s/\<.*//;
  say $Name;
   }
}
}







Follow up.

This is what I came up with.  I found that `next` did not serve me
well, so i just used a tag.

Thank you all for the help.  I had a bit of a time wrapping
my head around `next` there for a while.

-T


#!/usr/bin/env perl6

use strict;

my @Data = 'Mission D',
   '   Sol Wheat',
   '   Ted Moon',
   '';
# for @Data -> $Line { say "$Line"; }

my $TaskTag = 0;
for @Data -> $Line {
   if $Line.contains( "TASK type" ) { $TaskTag = 1; }

   if $Line.contains( "NAME type" ) {
  ( my $Name = $Line) ~~ s/.*?\>//;
  $Name ~~ s/\<.*//;
  say $Name;
   } else { $TaskTag = 0; }
}





On 05/23/2017 10:31 PM, Richard Hainsworth wrote:
> The code below seems unnecessarily complex.
>
> How about:
>
> my @Data = q:to/SAMPLE/;
>
>  Mission D',
>  Sol Wheat,
>  Ted Moon,
>  ;
>
> SAMPLE
>
> for @Data {
>  next unless m/ 'NAME' .*? '>' $=( .*? ) '<' /;
>  say $; # say implicitly stringifies $
> }
>
>
>

Hi Richard.

   The idea is that the names can not be extracted unless
they are embedded inside a task field.  I found the `next` did
not differentiate that.

   If I only wanted to extract the names, regardless of what
field they were in, that would be a lot easier!

-T





--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: need help with "next"

2017-05-23 Thread Richard Hainsworth

The code below seems unnecessarily complex.

How about:

my @Data = q:to/SAMPLE/;

Mission D',
Sol Wheat,
Ted Moon,
;

SAMPLE

for @Data {
next unless m/ 'NAME' .*? '>' $=( .*? ) '<' /;
say $; # say implicitly stringifies $
}



On Wednesday, May 24, 2017 01:20 PM, ToddAndMargo wrote:

On 05/23/2017 09:30 PM, ToddAndMargo wrote:

Hi All,

I have a test code in progress and I haven't figured out
how to get 'next' to work the way I want.

 next if $Line.contains( "TASK type" );

works, but

 if $Line.contains( "TASK type" ) {
next;

does not.

What am I missing?

Many thanks,
-T
yes I know I still have some things to fix on it.



#!/usr/bin/env perl6

use strict;

my @Data = 'Mission D',
'   Sol Wheat',
'   Ted Moon',
'';
# for @Data -> $Line { say "$Line"; }

for @Data -> $Line {
# next if $Line.contains( "TASK type" );
if $Line.contains( "TASK type" ) {
   next;
   my $Name = $Line;
   if $Name.contains( "NAME type" ) {
  $Name ~~ s/.*?\>//;
  $Name ~~ s/\<.*//;
  say $Name;
   }
}
}







Follow up.

This is what I came up with.  I found that `next` did not serve me
well, so i just used a tag.

Thank you all for the help.  I had a bit of a time wrapping
my head around `next` there for a while.

-T


#!/usr/bin/env perl6

use strict;

my @Data = 'Mission D',
   '   Sol Wheat',
   '   Ted Moon',
   '';
# for @Data -> $Line { say "$Line"; }

my $TaskTag = 0;
for @Data -> $Line {
   if $Line.contains( "TASK type" ) { $TaskTag = 1; }

   if $Line.contains( "NAME type" ) {
  ( my $Name = $Line) ~~ s/.*?\>//;
  $Name ~~ s/\<.*//;
  say $Name;
   } else { $TaskTag = 0; }
}




Re: need help with "next"

2017-05-23 Thread ToddAndMargo

On 05/23/2017 09:30 PM, ToddAndMargo wrote:

Hi All,

I have a test code in progress and I haven't figured out
how to get 'next' to work the way I want.

 next if $Line.contains( "TASK type" );

works, but

 if $Line.contains( "TASK type" ) {
next;

does not.

What am I missing?

Many thanks,
-T
yes I know I still have some things to fix on it.



#!/usr/bin/env perl6

use strict;

my @Data = 'Mission D',
'   Sol Wheat',
'   Ted Moon',
'';
# for @Data -> $Line { say "$Line"; }

for @Data -> $Line {
# next if $Line.contains( "TASK type" );
if $Line.contains( "TASK type" ) {
   next;
   my $Name = $Line;
   if $Name.contains( "NAME type" ) {
  $Name ~~ s/.*?\>//;
  $Name ~~ s/\<.*//;
  say $Name;
   }
}
}







Follow up.

This is what I came up with.  I found that `next` did not serve me
well, so i just used a tag.

Thank you all for the help.  I had a bit of a time wrapping
my head around `next` there for a while.

-T


#!/usr/bin/env perl6

use strict;

my @Data = 'Mission D',
   '   Sol Wheat',
   '   Ted Moon',
   '';
# for @Data -> $Line { say "$Line"; }

my $TaskTag = 0;
for @Data -> $Line {
   if $Line.contains( "TASK type" ) { $TaskTag = 1; }

   if $Line.contains( "NAME type" ) {
  ( my $Name = $Line) ~~ s/.*?\>//;
  $Name ~~ s/\<.*//;
  say $Name;
   } else { $TaskTag = 0; }
}


--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: need help with "next"

2017-05-23 Thread ToddAndMargo


Any data fulfilling the 'if' condition, and thus entering this block 
will be 'next'ed. Nothing will pass the 'next'.
But no data not fulfilling the condition will 'see' the code below, 
which is not what you intend.

Perhaps you omitted an 'else' clause after the 'next' statement?


Okay I get it now.  That is why
next if $Line.contains( blah )
worked.

Thank you.


Re: need help with "next"

2017-05-23 Thread Richard Hainsworth

On Wednesday, May 24, 2017 12:46 PM, ToddAndMargo wrote:


On Tue, May 23, 2017 at 11:30 PM, ToddAndMargo 
 wrote:

Hi All,

I have a test code in progress and I haven't figured out
how to get 'next' to work the way I want.

 next if $Line.contains( "TASK type" );

works, but

 if $Line.contains( "TASK type" ) {
next;

does not.

What am I missing?

Many thanks,
-T
yes I know I still have some things to fix on it.



#!/usr/bin/env perl6

use strict;

my @Data = 'Mission D',
'   Sol Wheat',
'   Ted Moon',
'';
# for @Data -> $Line { say "$Line"; }

for @Data -> $Line {
# next if $Line.contains( "TASK type" );
if $Line.contains( "TASK type" ) {
   next;
Any data fulfilling the 'if' condition, and thus entering this block 
will be 'next'ed. Nothing will pass the 'next'.
But no data not fulfilling the condition will 'see' the code below, 
which is not what you intend.

Perhaps you omitted an 'else' clause after the 'next' statement?

   my $Name = $Line;
   if $Name.contains( "NAME type" ) {
  $Name ~~ s/.*?\>//;
  $Name ~~ s/\<.*//;
  say $Name;
   }
}
}






On 05/23/2017 09:39 PM, Brad Gilbert wrote:
> You do realize that `next` immediately stops the current iteration and
> goes onto the *next* one right?
> That is, there is no point putting any code after it because it will
> never be run.
>

That is what I want.  If the current $line has "Task type" in
it, I want to jump to the next line in the array.  What am
I missing?


Re: need help with "next"

2017-05-23 Thread ToddAndMargo



On Tue, May 23, 2017 at 11:30 PM, ToddAndMargo  wrote:

Hi All,

I have a test code in progress and I haven't figured out
how to get 'next' to work the way I want.

 next if $Line.contains( "TASK type" );

works, but

 if $Line.contains( "TASK type" ) {
next;

does not.

What am I missing?

Many thanks,
-T
yes I know I still have some things to fix on it.



#!/usr/bin/env perl6

use strict;

my @Data = 'Mission D',
'   Sol Wheat',
'   Ted Moon',
'';
# for @Data -> $Line { say "$Line"; }

for @Data -> $Line {
# next if $Line.contains( "TASK type" );
if $Line.contains( "TASK type" ) {
   next;
   my $Name = $Line;
   if $Name.contains( "NAME type" ) {
  $Name ~~ s/.*?\>//;
  $Name ~~ s/\<.*//;
  say $Name;
   }
}
}




On 05/23/2017 09:39 PM, Brad Gilbert wrote:
> You do realize that `next` immediately stops the current iteration and
> goes onto the *next* one right?
> That is, there is no point putting any code after it because it will
> never be run.
>

That is what I want.  If the current $line has "Task type" in
it, I want to jump to the next line in the array.  What am
I missing?


Re: need help with "next"

2017-05-23 Thread Brad Gilbert
You do realize that `next` immediately stops the current iteration and
goes onto the *next* one right?
That is, there is no point putting any code after it because it will
never be run.

On Tue, May 23, 2017 at 11:30 PM, ToddAndMargo  wrote:
> Hi All,
>
> I have a test code in progress and I haven't figured out
> how to get 'next' to work the way I want.
>
> next if $Line.contains( "TASK type" );
>
> works, but
>
> if $Line.contains( "TASK type" ) {
>next;
>
> does not.
>
> What am I missing?
>
> Many thanks,
> -T
> yes I know I still have some things to fix on it.
>
>
> 
> #!/usr/bin/env perl6
>
> use strict;
>
> my @Data = 'Mission D',
>'   Sol Wheat',
>'   Ted Moon',
>'';
> # for @Data -> $Line { say "$Line"; }
>
> for @Data -> $Line {
># next if $Line.contains( "TASK type" );
>if $Line.contains( "TASK type" ) {
>   next;
>   my $Name = $Line;
>   if $Name.contains( "NAME type" ) {
>  $Name ~~ s/.*?\>//;
>  $Name ~~ s/\<.*//;
>  say $Name;
>   }
>}
> }
>
> 
>
>
> --
> ~~
> Computers are like air conditioners.
> They malfunction when you open windows
> ~~


need help with "next"

2017-05-23 Thread ToddAndMargo

Hi All,

I have a test code in progress and I haven't figured out
how to get 'next' to work the way I want.

next if $Line.contains( "TASK type" );

works, but

if $Line.contains( "TASK type" ) {
   next;

does not.

What am I missing?

Many thanks,
-T
yes I know I still have some things to fix on it.



#!/usr/bin/env perl6

use strict;

my @Data = 'Mission D',
   '   Sol Wheat',
   '   Ted Moon',
   '';
# for @Data -> $Line { say "$Line"; }

for @Data -> $Line {
   # next if $Line.contains( "TASK type" );
   if $Line.contains( "TASK type" ) {
  next;
  my $Name = $Line;
  if $Name.contains( "NAME type" ) {
 $Name ~~ s/.*?\>//;
 $Name ~~ s/\<.*//;
 say $Name;
  }
   }
}




--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: Task::Star and Panda

2017-05-23 Thread ToddAndMargo

On 05/23/2017 07:44 PM, Richard Hainsworth wrote:

The issue is not poor quality software!

The problem is community management.


You have a point.  I think the lack of interest is
because they have decided to use zef instead.

I was really using "Stinks" in a general sense.  Next
time I will use "Broken"


Re: Task::Star and Panda

2017-05-23 Thread Richard Hainsworth

The issue is not poor quality software!

The problem is community management.

Panda was the standard way for installing Perl6 modules. It is embedded 
in nearly all of the "travis.yml" modules in the Ecosystem.


I just fixed flaws in a module of mine, which began to *fail* the Travis 
tests. It turned out that it wasn't my changes that caused the errors, 
but that the Travis system could no longer access panda.


I notice that other Modules are now failing as well, eg., GTK::Simple. I 
don't know because I don't have access to the error logs, but I do know 
that it used panda at one time - because I used GTK::Simple as the 
template for my module.


So the removal of panda and replacement by zef without thought for the 
Ecosystem is a case of bad community management.


Another problem is the absence of Task::Star in the Ecosystem. When was 
it removed? Why was it removed without any significant announcement?


Why is documentation on Rakudo - the lastest update even - still showing 
that Task::Star should be installed, when Task::Star is not available on 
the Ecosystem?


This is not a question about the quality of panda over zef.

Richard aka finanalyst


On Wednesday, May 24, 2017 03:07 AM, ToddAndMargo wrote:

On 05/23/2017 11:30 AM, Elizabeth Mattijsen wrote:

On 23 May 2017, at 20:21, ToddAndMargo  wrote:
On 05/23/2017 10:47 AM, Elizabeth Mattijsen wrote:

On 23 May 2017, at 19:23, ToddAndMargo  wrote:

On 05/23/2017 06:30 AM, Will Coleda wrote:

Removed? It's still available athttps://github.com/tadzik/panda  …


It is on its way out.  The developers over on the chat
line directed me to zef when I asked for help getting
panda working.


Panda stinks.

That's not really true or called for.


Panda is broken and not going to be repaired.  The
developers on the chat line recommend zef instead.
Was polite enough?
Perhaps you should check out the section “The End of an Era” in 
last weeks Perl 6 Weekly: 
https://p6weekly.wordpress.com/2017/05/16/2017-20-crossing-the-alps/
You should realize that open source software is not made by robots 
but by people.  People for which keeping up with changes can take 
more resources than they have at hand.
Also remember that without panda, I don’t think we would have had 
an ecosystem out now as fleshed out as it is now.
So saying that certain software stinks, feels more like projection 
than anything else.  So yes, *I* think it was uncalled for.

Liz


Would substituting "broken" for "stinks" be polite enough?


IMO yes, because that would be factual.


Liz



Hi Liz,

   I was using the meaning of "low or bad quality".  I did
not mean the other meaning of a "foul odor".   I was
trying to get to the point rapidly and to be of help.
I really wasn't meaning to denigrate anyone's work.

   And, of course, Panda is not going to work right if
it is not being maintained, especially with the dizzying
(a good thing) pace of development on Perl 6.

   And, Panda does not smell bad.  Maybe.  Okay, okay,
okay, it doesn't!

:-)

-T



Re: Task::Star and Panda

2017-05-23 Thread ToddAndMargo

On 05/23/2017 11:30 AM, Elizabeth Mattijsen wrote:

On 23 May 2017, at 20:21, ToddAndMargo  wrote:
On 05/23/2017 10:47 AM, Elizabeth Mattijsen wrote:

On 23 May 2017, at 19:23, ToddAndMargo  wrote:

On 05/23/2017 06:30 AM, Will Coleda wrote:

Removed? It's still available athttps://github.com/tadzik/panda  …


It is on its way out.  The developers over on the chat
line directed me to zef when I asked for help getting
panda working.


Panda stinks.

That's not really true or called for.


Panda is broken and not going to be repaired.  The
developers on the chat line recommend zef instead.
Was polite enough?

Perhaps you should check out the section “The End of an Era” in last weeks Perl 
6 Weekly: https://p6weekly.wordpress.com/2017/05/16/2017-20-crossing-the-alps/
You should realize that open source software is not made by robots but by 
people.  People for which keeping up with changes can take more resources than 
they have at hand.
Also remember that without panda, I don’t think we would have had an ecosystem 
out now as fleshed out as it is now.
So saying that certain software stinks, feels more like projection than 
anything else.  So yes, *I* think it was uncalled for.
Liz


Would substituting "broken" for "stinks" be polite enough?


IMO yes, because that would be factual.


Liz



Hi Liz,

   I was using the meaning of "low or bad quality".  I did
not mean the other meaning of a "foul odor".   I was
trying to get to the point rapidly and to be of help.
I really wasn't meaning to denigrate anyone's work.

   And, of course, Panda is not going to work right if
it is not being maintained, especially with the dizzying
(a good thing) pace of development on Perl 6.

   And, Panda does not smell bad.  Maybe.  Okay, okay,
okay, it doesn't!

:-)

-T

--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: Invoking method by name found in variable

2017-05-23 Thread Elizabeth Mattijsen

> On 23 May 2017, at 20:23, Salve J Nilsen  wrote:
> 
> Patrick R. Michaud said:
>> On Tue, May 23, 2017 at 09:01:54PM +0300, Gabor Szabo wrote:
>>> 
>>> given an object $o and the name of a method in $method = "run"
>>> how can I invoke the $o.run() ?
>>> 
>>> Something like $o.call($method)
>> 
>> At one point it was done as  $o."$method"() .
>> 
>>> my $method = 'say';  123."$method"();
>> 123
> 
> Is there a reasons for $o.call("method") not existing?

What if you want to pass parameters as well?


Liz


Re: Task::Star and Panda

2017-05-23 Thread ToddAndMargo

On 05/23/2017 11:28 AM, Timo Paulssen wrote:

On 05/23/2017 08:21 PM, ToddAndMargo wrote:

Would substituting "broken" for "stinks" be polite enough?


That's wrong, though. You can still install modules with panda, it's not
broken, just no longer in development.



Panda kinda, sorta, sometimes sorta kinda works.

I was glad I made the switch to zef.


Re: Invoking method by name found in variable

2017-05-23 Thread Salve J Nilsen

Patrick R. Michaud said:

On Tue, May 23, 2017 at 09:01:54PM +0300, Gabor Szabo wrote:


given an object $o and the name of a method in $method = "run"
how can I invoke the $o.run() ?

Something like $o.call($method)


At one point it was done as  $o."$method"() .


my $method = 'say';  123."$method"();

123


Is there a reasons for $o.call("method") not existing?


- Salve

--
#!/usr/bin/env perl
sub AUTOLOAD{$AUTOLOAD=~/.*::(\d+)/;seek(DATA,$1,0);print# Salve Joshua Nilsen
getc DATA}$"="'};&{'";@_=unpack("C*",unpack("u*",':50,$'.#
'3!=0"59,6!`%%P\0!1)46%!F.Q`%01,`'."\n"));eval "&{'@_'}";  __END__ is near! :)


Re: Task::Star and Panda

2017-05-23 Thread Elizabeth Mattijsen
> On 23 May 2017, at 20:21, ToddAndMargo  wrote:
> On 05/23/2017 10:47 AM, Elizabeth Mattijsen wrote:
>>> On 23 May 2017, at 19:23, ToddAndMargo  wrote:
>>> 
>>> On 05/23/2017 06:30 AM, Will Coleda wrote:
 Removed? It's still available athttps://github.com/tadzik/panda  …
>>> 
>>> It is on its way out.  The developers over on the chat
>>> line directed me to zef when I asked for help getting
>>> panda working.
>>> 
> Panda stinks.
 That's not really true or called for.
>>> 
>>> Panda is broken and not going to be repaired.  The
>>> developers on the chat line recommend zef instead.
>>> Was polite enough?
>> Perhaps you should check out the section “The End of an Era” in last weeks 
>> Perl 6 Weekly: 
>> https://p6weekly.wordpress.com/2017/05/16/2017-20-crossing-the-alps/
>> You should realize that open source software is not made by robots but by 
>> people.  People for which keeping up with changes can take more resources 
>> than they have at hand.
>> Also remember that without panda, I don’t think we would have had an 
>> ecosystem out now as fleshed out as it is now.
>> So saying that certain software stinks, feels more like projection than 
>> anything else.  So yes, *I* think it was uncalled for.
>> Liz
> 
> Would substituting "broken" for "stinks" be polite enough?

IMO yes, because that would be factual.


Liz

Re: Task::Star and Panda

2017-05-23 Thread Timo Paulssen
On 05/23/2017 08:21 PM, ToddAndMargo wrote:
> Would substituting "broken" for "stinks" be polite enough?

That's wrong, though. You can still install modules with panda, it's not
broken, just no longer in development.


Re: Invoking method by name found in variable

2017-05-23 Thread Timo Paulssen
> Funny, first I tried $o.$method()  but that did not work. That is syntax for 
> when you have a method object or other kind of
routine stored in your $method variable



Re: Invoking method by name found in variable

2017-05-23 Thread Gabor Szabo
On Tue, May 23, 2017 at 9:09 PM, Elizabeth Mattijsen  wrote:
>
>> On 23 May 2017, at 20:01, Gabor Szabo  wrote:
>> given an object $o and the name of a method in $method = "run"
>> how can I invoke the $o.run() ?
>>
>> Something like $o.call($method)
>
> $o.”$method"()
>
> $ 6 'my $method = "Str"; dd 42."$method"()'
> “42"
>
> Liz


Funny, first I tried $o.$method()  but that did not work.


Thanks to both of you!
Gabor


Re: Task::Star and Panda

2017-05-23 Thread ToddAndMargo

On 05/23/2017 10:47 AM, Elizabeth Mattijsen wrote:

On 23 May 2017, at 19:23, ToddAndMargo  wrote:

On 05/23/2017 06:30 AM, Will Coleda wrote:

Removed? It's still available athttps://github.com/tadzik/panda  …


It is on its way out.  The developers over on the chat
line directed me to zef when I asked for help getting
panda working.


Panda stinks.

That's not really true or called for.


Panda is broken and not going to be repaired.  The
developers on the chat line recommend zef instead.
Was polite enough?


Perhaps you should check out the section “The End of an Era” in last weeks Perl 
6 Weekly: https://p6weekly.wordpress.com/2017/05/16/2017-20-crossing-the-alps/

You should realize that open source software is not made by robots but by 
people.  People for which keeping up with changes can take more resources than 
they have at hand.

Also remember that without panda, I don’t think we would have had an ecosystem 
out now as fleshed out as it is now.

So saying that certain software stinks, feels more like projection than 
anything else.  So yes, *I* think it was uncalled for.


Liz



Would substituting "broken" for "stinks" be polite enough?


Re: Invoking method by name found in variable

2017-05-23 Thread Patrick R. Michaud
On Tue, May 23, 2017 at 09:01:54PM +0300, Gabor Szabo wrote:
> given an object $o and the name of a method in $method = "run"
> how can I invoke the $o.run() ?
> 
> Something like $o.call($method)

At one point it was done as  $o."$method"() .

> my $method = 'say';  123."$method"();
123

Pm


Re: Invoking method by name found in variable

2017-05-23 Thread Elizabeth Mattijsen

> On 23 May 2017, at 20:01, Gabor Szabo  wrote:
> given an object $o and the name of a method in $method = "run"
> how can I invoke the $o.run() ?
> 
> Something like $o.call($method)

$o.”$method"()

$ 6 'my $method = "Str"; dd 42."$method"()'
“42"

Liz

Invoking method by name found in variable

2017-05-23 Thread Gabor Szabo
Hi,

given an object $o and the name of a method in $method = "run"
how can I invoke the $o.run() ?

Something like $o.call($method)

Gabor


Re: Task::Star and Panda

2017-05-23 Thread Elizabeth Mattijsen
> On 23 May 2017, at 19:23, ToddAndMargo  wrote:
> 
> On 05/23/2017 06:30 AM, Will Coleda wrote:
>> Removed? It's still available athttps://github.com/tadzik/panda  …
> 
> It is on its way out.  The developers over on the chat
> line directed me to zef when I asked for help getting
> panda working.
> 
>>> Panda stinks.
>> That's not really true or called for.
> 
> Panda is broken and not going to be repaired.  The
> developers on the chat line recommend zef instead.
> Was polite enough?

Perhaps you should check out the section “The End of an Era” in last weeks Perl 
6 Weekly: https://p6weekly.wordpress.com/2017/05/16/2017-20-crossing-the-alps/

You should realize that open source software is not made by robots but by 
people.  People for which keeping up with changes can take more resources than 
they have at hand.

Also remember that without panda, I don’t think we would have had an ecosystem 
out now as fleshed out as it is now.

So saying that certain software stinks, feels more like projection than 
anything else.  So yes, *I* think it was uncalled for.


Liz

Re: Task::Star and Panda

2017-05-23 Thread ToddAndMargo

On 05/23/2017 06:30 AM, Will Coleda wrote:

Removed? It's still available athttps://github.com/tadzik/panda  …


It is on its way out.  The developers over on the chat
line directed me to zef when I asked for help getting
panda working.


Panda stinks.

That's not really true or called for.


Panda is broken and not going to be repaired.  The
developers on the chat line recommend zef instead.
Was polite enough?


Re: Task::Star and Panda

2017-05-23 Thread Will Coleda
On Tue, May 23, 2017 at 3:24 AM, ToddAndMargo  wrote:
> On 05/23/2017 12:05 AM, Richard Hainsworth wrote:
>>
>> I was upgrading perl6 and following the standard instructions, only to
>> find Task::Star is no longer in the Ecosystem.
>>
>> Surely if this is not an error, the change should be notified.
>>
>> Also, I upgraded a module of my own, but the Travis testing failed. It
>> seems that panda is not working either.
>>
>> Panda might be deprecated, but removing it seems a bit sudden. I checked
>> and there seem to be quite a few modules that reference panda in their
>> travis.yml files.

Removed? It's still available at https://github.com/tadzik/panda …

>> RIchard
>
>
>
> Hi Richard,
>
> Panda stinks.

That's not really true or called for.

>  It is being replaced with `zef`.
> Here are my notes on zef (it presumes Fedora Core
> 25 Linux, but you can get the procedure from it for
> Windows):
>
> HTH,
> -T
>
> Installing modules: zef
>
> Note: modules can be downloaded from
>  https://modules.perl6.org/
>   with
>  git clone address_from_above
>
>
> Install zef:
> $ git clone https://github.com/ugexe/zef.git
> $ mv zef zef.git
> $ cd zef.git
> $ perl6 -Ilib bin/zef install .
> $ cd ..
>
> or if using https://github.com/nxadm/rakudo-pkg/releases
> $ install_zef_as_user.sh: install it in ~/.perl6
> # install_zef_as_root.sh: install it in /opt/rakudo as root (use sudo)
> It will give you a path merge one liner
>
> This should install to /usr/lib64/perl6/site/bin/zef
> Make a link to it with
> # ln -s /usr/lib64/perl6/site/bin/zef /usr/bin/zef
>
> Then update your path:
> # vi /etc/profile
>   under the last pathmunge, add (depending on where perl6 really is)
># perl 6's panda path
># pathmunge /usr/share/perl6/site/bin after
>pathmunge /opt/rakudo/bin after
>
> And make a link from the actual location to the expected location
> # ln -s /opt/rakudo/bin/perl6  /usr/bin/perl6
>
>
>
> USAGE
>
> Note: run as a user
>
> zef --help
>
> # install the CSV::Parser distribution   (it will also install
> dependancies)
> zef install CSV::Parser
> zef install Net::SMTP
> zef install NQP::Eval
> zef install Terminal::ANSIColor
>
>
> # search for distribution names matching `CSV`
> zef search CSV
>
> # detailed information for a matching distribution
> zef info CSV::Parser
>
> # list all available distributions
> zef list
>
> # list reverse dependencies of an identity
> zef rdepends HTTP::UserAgent
>
> # test project in current directory
> zef test .
>
> # fetch a specific module only
> zef fetch CSV::Parser
>
> # fetch a module, then shell into its local path
> zef look CSV::Parser
>
> # smoke test modules from all repositories
> zef smoke
>
> # run Build.pm if one exists in given path
> zef build .
>
> # update Repository package lists
> zef update
>
> # upgrade all distributions (BETA)
> zef upgrade
>
> # upgrade specific distribution (BETA)
> zef upgrade CSV::Parser
>
> # lookup module info by name/path/sha1
> zef --sha1 locate 9FA0AC28824EE9E5A9C0F99951CA870148AE378E
>
>
>
>
>
>
>
> --
> ~~
> Computers are like air conditioners.
> They malfunction when you open windows
> ~~



-- 
Will "Coke" Coleda


Re: Task::Star and Panda

2017-05-23 Thread ToddAndMargo

On 05/23/2017 12:05 AM, Richard Hainsworth wrote:
I was upgrading perl6 and following the standard instructions, only to 
find Task::Star is no longer in the Ecosystem.


Surely if this is not an error, the change should be notified.

Also, I upgraded a module of my own, but the Travis testing failed. It 
seems that panda is not working either.


Panda might be deprecated, but removing it seems a bit sudden. I checked 
and there seem to be quite a few modules that reference panda in their 
travis.yml files.


RIchard



Hi Richard,

Panda stinks.  It is being replaced with `zef`.
Here are my notes on zef (it presumes Fedora Core
25 Linux, but you can get the procedure from it for
Windows):

HTH,
-T

Installing modules: zef

Note: modules can be downloaded from
 https://modules.perl6.org/
  with
 git clone address_from_above


Install zef:
$ git clone https://github.com/ugexe/zef.git
$ mv zef zef.git
$ cd zef.git
$ perl6 -Ilib bin/zef install .
$ cd ..

or if using https://github.com/nxadm/rakudo-pkg/releases
$ install_zef_as_user.sh: install it in ~/.perl6
# install_zef_as_root.sh: install it in /opt/rakudo as root (use sudo)
It will give you a path merge one liner

This should install to /usr/lib64/perl6/site/bin/zef
Make a link to it with
# ln -s /usr/lib64/perl6/site/bin/zef /usr/bin/zef

Then update your path:
# vi /etc/profile
  under the last pathmunge, add (depending on where perl6 really is)
   # perl 6's panda path
   # pathmunge /usr/share/perl6/site/bin after
   pathmunge /opt/rakudo/bin after

And make a link from the actual location to the expected location
# ln -s /opt/rakudo/bin/perl6  /usr/bin/perl6



USAGE

Note: run as a user

zef --help

# install the CSV::Parser distribution   (it will also install 
dependancies)

zef install CSV::Parser
zef install Net::SMTP
zef install NQP::Eval
zef install Terminal::ANSIColor


# search for distribution names matching `CSV`
zef search CSV

# detailed information for a matching distribution
zef info CSV::Parser

# list all available distributions
zef list

# list reverse dependencies of an identity
zef rdepends HTTP::UserAgent

# test project in current directory
zef test .

# fetch a specific module only
zef fetch CSV::Parser

# fetch a module, then shell into its local path
zef look CSV::Parser

# smoke test modules from all repositories
zef smoke

# run Build.pm if one exists in given path
zef build .

# update Repository package lists
zef update

# upgrade all distributions (BETA)
zef upgrade

# upgrade specific distribution (BETA)
zef upgrade CSV::Parser

# lookup module info by name/path/sha1
zef --sha1 locate 9FA0AC28824EE9E5A9C0F99951CA870148AE378E







--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Task::Star and Panda

2017-05-23 Thread Richard Hainsworth
I was upgrading perl6 and following the standard instructions, only to 
find Task::Star is no longer in the Ecosystem.


Surely if this is not an error, the change should be notified.

Also, I upgraded a module of my own, but the Travis testing failed. It 
seems that panda is not working either.


Panda might be deprecated, but removing it seems a bit sudden. I checked 
and there seem to be quite a few modules that reference panda in their 
travis.yml files.


RIchard