Re: optimizer?

2024-01-07 Thread Parrot Raiser
What's the reason behind the request?

On Sun, Jan 7, 2024 at 7:24 AM Elizabeth Mattijsen  wrote:

> $ raku --help
>
> ...
> --optimize=level use the given level of optimization (0..3)
> ...
>
> > On 7 Jan 2024, at 07:09, ToddAndMargo via perl6-users <
> perl6-users@perl.org> wrote:
> >
> > Hi All,
> >
> > Is there a switch on the command line to disable the code optimizer?
> >
> > Many thanks,
> > -T
>
>


A suitable task for Raku?

2023-11-28 Thread Parrot Raiser
In  https://youtu.be/L2jnRk2GYwg?si=ffds1MWsyZaB09HR Cassie talks about
creating a language for prompting AI bots. Isn't creating specialised DSs a
Raku strong point?


Rust community in distress

2023-06-08 Thread Parrot Raiser
See https://youtu.be/QEnuzwCWpgQ

This is not meant to be an example of schadenfreude.  Rust is an
interesting language, whose ecological niche has little in common with
Perl's or Raku's. Its principal rival is Go, which is definitely more
corporate.   Alphabet already controls far too much.  (Yes, that sentiment
may not be compatible with a gmail account.)
It is unfortunate when any worthwhile Open Source project suffers from
community or personality conflicts. It's worth noting them, to help us
avoid similar situations.


A conspicuous omission

2023-04-08 Thread Parrot Raiser
If you read  this StackOverflow article:
https://stackoverflow.blog/2023/03/29/from-web2-to-web3-how-developers-can-upskill-and-
build-with-blockchain/

and look at the languages mentioned with APIs, you may notice some
missing. That could render them irrelevant to the future.

What can we do about it?  A general solution to enable suppliers of
other software to provide API connection would be ideal, but we have
to start somewhere.


Re: folder size

2022-10-24 Thread Parrot Raiser
This https://raku.land/zef:lizmat/path-utils might be what you're
seeking. (So new the electrons have barely settled into their new
orbits.)


Re: Problem defining factorial operator in .rakumod file

2022-10-14 Thread Parrot Raiser
The cause of the problem may well need to be fixed for other reasons,
but re-purposing an almost universal operator like "!" ("not") sounds
like a thoroughly bad idea, the route to non-standard code.

If you must have a factorial operator, what's wrong with defining "Fact"?

On 10/14/22, Elizabeth Mattijsen  wrote:
> I cannot reproduce:
>
> % cat lib/A.rakumod
> sub postfix: ($n) is export {
> when $n == 0 {return 1}
> default {$n * ($n - 1)!}
> }
> % raku -e 'use lib "lib"; use A; say 42!'
> 14050061177528798985431426062445115699363840
> % raku -v
> Welcome to Rakudo™ v2022.07-64-gce1af0fa0.
> Implementing the Raku® Programming Language v6.d.
> Built on MoarVM version 2022.07-16-g3ae8a31c1.
>
>> On 14 Oct 2022, at 05:30, Joseph Polanik  wrote:
>>
>>
>> On 10/13/22 9:19 PM, Ralph Mellor wrote:
>>> On Fri, Oct 14, 2022 at 12:37 AM Joseph Polanik 
>>> wrote:
 I am trying to define '!' as the factorial operator. The following
 works
 in a .raku script file:

sub postfix: ($n) is export {
  when $n == 0 {return 1}
  default {$n * ($n - 1)!}
}

 However when I tried to move this sub to a .rakumod file,
 it produces an error: Negation metaoperator not followed
 by valid infix.
>>> That's because Raku isn't picking up your `sub`.
>>>
>>> I don't know why. It works for me. (v2022.02)
>>>
>>> Are you sure you're `use`ing it correctly and the `sub`
>>> has the `is export`?
>>
>> Yes, the sub that defines the factorial operator is marked with 'is
>> export' and the script that invokes my module (SequenceHelper) has a 'use'
>> statement.
>>
>> The script is able to invoke other methods marked 'is export'; for
>> example, the simple ver() and a method that generates an integer
>> sequence:
>>
>>   sub genSeq_IndexOps($limit, $f) is export {
>> my @a = ();
>> for (0...^$limit) -> $n {
>>   @a.push($f($n));
>> }
>> return @a;
>>   }
>>
>> So the module is being found and used. It seems as if certain methods
>> aren't being found.
>>
>> I am not convinced that the problem I'm having is unrelated to the issue
>> raised concerning the REPL. When I use the REPL, the results are the
>> same.
>>
>> [0] > use SequenceHelper;
>> Nil
>> [1] > say ver();
>> v0.0.1
>> [1] > say 4!;
>> ===SORRY!=== Error while compiling:
>> Negation metaoperator not followed by valid infix
>> [1] > put genSeq_IndexOps(15, -> $x {3**$x + 5**$x + 6**$x});
>> 3 14 70 368 2002 11144 63010 360248 2076802 12050504 70290850 411802328
>> 2421454402 14282991464 84472462690
>>
>> Regards,
>>
>> Joe
>>
>
>


Re: steps of a path

2022-09-07 Thread Parrot Raiser
>
> That said, right now gmail is claiming whipupitude is misspelled...
>
An alternative is "whipitupitude" (the difference being the first "it".

Given the examples I've seen over the years, there's a need for an
opposite to "idiomatic", for programming that arrives at a solution by
a Rube Goldberg/Heath Robinson sort of convoluted and unnecessary
path, or utterly abuses the language in a fashion that contradicts its
underlying purpose or philosophy (writing video games in sed or
invoicing programs in Lisp). "Idiotmatic" suggests itself. :-)*


Re: Ping Larry Wall: excessive compile times

2022-08-30 Thread Parrot Raiser
Surely Jonathan Worthington (or one of the other people who've worked
on the compiler) would be in a better position to answer this sort of
question.

Assuming that you write in a normal "interpreted-language" style,
(i.e. gradually adding features, testing, and moving on to the next
one, do you notice any sudden changes, or is the increase linear? That
might provide clues to any weak spots.

How large are the programs that invoke these long compiles?

On 8/29/22, ToddAndMargo via perl6-users  wrote:
> On 8/29/22 19:58, ToddAndMargo via perl6-users wrote:
>> On 8/29/22 19:26, Brad Gilbert wrote:
>>> The Raku compiler is written in Raku (to an extent) so no it can't be
>>> toned down. I've been out of the loop for a while, but there has been
>>> work to make the compiler use a better design which should be more
>>> optimizable.
>>
>> Awesome.
>>
>
>
> I would love to hear from Larry if there is some
> technical reason behind the slowness and it is
> just not lack of time and/or resources on the
> developers part.
>


A natural opportunity for Raku?

2022-02-12 Thread Parrot Raiser
In this article, "Every Simple Language Will Eventually End Up Turing Complete"
https://solutionspace.blog/2021/12/04/every-simple-language-will-eventually-end-up-turing-complete
the author points out an unfortunate tendency for "simple" languages
to accrete features and morph into misshapen monsters. Could Raku's
grammars provide a way to express the unique features of a DSL while
using the extra features from a carefully considered framework?


Latest Rakudo*

2022-01-30 Thread Parrot Raiser
https://rakudo.org/star shows the latest Rakudo* bundle for Linux as
2021.04 - is that really the latest?


Re: about binary protocol porting

2022-01-04 Thread Parrot Raiser
Just to reinforce Geoff's message, remember Tony Hoare's "Premature
optimisation is the root of all evil"
https://effectiviology.com/premature-optimization/ as quoted by Rob
Pike https://users.ece.utexas.edu/~adnan/pike.html


Re: Should I start learning Perl?

2022-01-01 Thread Parrot Raiser
A great analysis of, and answer to, the question. Worthy of being
enshrined in a blog posting.


Language conversion and comparisons

2021-07-03 Thread Parrot Raiser
https://doordash.engineering/2021/05/04/migrating-from-python-to-kotlin-for-our-backend-services/

Obviously, it's too late to persuade them to consider Raku, but it's
an interesting thought experiment to add that to the comparisons.

I posted this to the Perl 6 group on LinkedIn, in the absence of any
obvious Raku group. (There's a fellow in Tokyo called Raku Raku -
perhaps we should ask if he'd like to be a mascot?)


Re: Comparing Int and Num

2021-04-14 Thread Parrot Raiser
What do these enormous numbers represent?

On 4/13/21, sisyphus  wrote:
> Hi,
>
> C:\>raku -e "say 1.8446744073709552e+19 == 18446744073709551615"
> True
>
> I think I understand why raku deems this to be true.
> The LHS is 0x1p+64, which is identical to the double that the RHS rounds
> to.
> (AFAIK, it's the same with perl5 and C.)
>
> Of course, for all $x in the Int range of  18446744073709551615 - 1023 to
> 18446744073709551615, we find that "1.8446744073709552e+19 == $x" is True,
> because each of those $x Int values round to 0x1p+64.
> I understand all of that (I think).
>
> What I don't understand is the following:
>
> C:\>raku -e "say 1.8446744073709552e+19 == (18446744073709551615 - 1024)"
> True
>
> C:\>raku -e "say 1.8446744073709552e+19 == (18446744073709551615 - 1087)"
> True
>
> For those particular Int values (and all Int values in between) the RHS
> rounds to 0x1.fp+63,
> and the result should therefore be "False" ... but it is reported as
> "True".
>
> It's not until we subtract at least 1088 that the behaviour I'm expecting
> appears:
>
> C:\>raku -e "say 1.8446744073709552e+19 == (18446744073709551615 - 1088)"
> False
>
> Comparing the RHS Int values given in the last 2 one liners, I find they
> are (respectively):
> 0.1000E64
> 0.10111011E64
>
> It's not apparent to me how those 2 integer values can round to different
> doubles.
> Those 2 integer values can also be written as (respectively):
> 18446744073709550528
> 18446744073709550527
>
> On Windows, I have:
> C:\>raku --version
> This is Rakudo version 2020.05.1 built on MoarVM version 2020.05
> implementing Raku 6.d.
>
> On Ubuntu, I have:
> $ raku --version
> Welcome to Rakudo(tm) v2021.03.
> Implementing the Raku(tm) programming language v6.d.
> Built on MoarVM version 2021.03.
>
> It's the same behaviour on both systems.
>
> Is this a bug that I ought to report ?
>
> Cheers,
> Rob
>


Re: Please create a Raku community channel

2021-03-16 Thread Parrot Raiser
I'n not familiar with list managers today, but in old Unix systems it
used to be possible to put a ".forward" file in one's home directory
that would automatically forward mail to another address.

Conceptually, an alias or symbolic link, so that more than one address
ultimately pointed to one account.

If a similar mechanism could alias the "perl6" prefix to "raku", that
would seem a simple solution.

On 3/15/21, William Michels via perl6-users  wrote:
> Hello Richard (and all),
>
> The simplest solution seems to be reviving the historical
> mailing-lists pertaining to the Perl6 effort, in particular, the
> "perl6-announce" mailing list at perl6-annou...@perl.org . Daniel
> Sockwell wrote as much in his recent email. New subscribers can sign
> up at perl6-announce-subscr...@perl.org .
>
> According to https://raku.org/archive/lists/ , "perl6-announce [is a]
> Moderated list for news of new lists, working groups, and so on.
> Summaries from the top-level working groups are also posted here."
> Presumably that includes reports from the Raku Steering Council.
>
> Yes, it can/should be renamed "raku-announce", but in the meantime why
> not use it?
>
> Best Regards, Bill.
>
> W. Michels, Ph.D.
>
>
>
> On Mon, Mar 15, 2021 at 4:19 AM Richard Hainsworth
>  wrote:
>>
>> Thanks to everyone that responded.
>>
>> It seems to me that the establishment of a common communication channel
>> by the RSC (Raku Steering Council) would in itself define the Raku
>> Community. Those who want to be a part of the community would track
>> (follow, read, contribute etc) the channel. I don't think it is
>> something that needs to be over-thought. Every channel has its
>> advantages and disadvantages, and there's going to be someone who does
>> not like the result.
>>
>> But the current situation of multiple channels of communicating is
>> obviously going to create confusion. It would be like having multiple
>> places for defining the same set of constants for a software project, or
>> some other analogy of duplicating code that should be kept in one place
>> and referred to, not written and maintained in multiple places.
>>
>> Also, if like-minded people have a way to share and cooperate, a
>> community will build. Facilitating the growth of a community will have
>> an impact on the acceptance of Raku as a language.
>>
>> Having multiple differing approaches to the same problem can be good -
>> not arguing with that. But if there's no common way to share information
>> about the multiple approaches, how can the different approaches be
>> compared? If they can't be compared, then the advantages of multiple
>> approaches are lost. And no one can be certain that their efforts are
>> being considered.
>>
>> It turns out - from comments of JJ and Vadim - that Altai-man's
>> initiative is a personal one. Had it not been late at night (for me) and
>> had there been an established channel where  plans for community
>> resources are shared, I would have realised that straight-away. Instead,
>> I got annoyed and lost sleep (silly and unreasonable, but I am human).
>>
>> Daniel, I look forward to hearing from you. Altai-man, please send me a
>> link that I can catch up with what you are planning (I'm not so good at
>> tracking multiple github repos).
>>
>> One of the things I would like to do is to set up a way of doing
>> documentation that will allow for multiple languages to be possible,
>> which means that it should be possible to show the same documentation
>> file side-by-side in two languages, with text for each language kept in
>> a separate file, but for equivalent places in the documentation to be
>> synchronised. It would also be good to have revisionning history
>> visible, so that updates in the main text can be tracked so as to update
>> in a target language text.
>>
>> Regards,
>>
>> Richard
>>
>> On 14/03/2021 21:16, Daniel Sockwell wrote:
>> > I agree with the points Vadim and JJ made: There's a good chance that
>> > having a more official
>> > communication channel would _not_ have prevented surprise here, since
>> > the amount of progress
>> > on the a potential docs redesign seems to have taken many people
>> > (including me!) by surprise.
>> > I guess that's what happens when our community has "forgiveness >>
>> > permission" as a core value!
>> >
>> > That said, I also agree with Vadim that we should have a better way to
>> > communicate things like
>> > this,
>> > even if it wouldn't have been relevant in this particular case. In fact,
>> > we theoretically do: our
>> > website lists the perl6-announce list, which is supposed to be "low
>> > traffic (a few emails a
>> > month)".
>> > https://raku.org/community
>> >
>> > Looking at the archive for that list, it has been **very** low traffic
>> > indeed: the last message was
>> >
>> > sent in 2015. So we clearly haven't been using it, and starting now
>> > (when we're about to finally
>> > move on to raku-* mailing lists) probably doesn't make much sense. But,
>> > once 

Re: 'CALL-ME' Math problem?

2021-03-02 Thread Parrot Raiser
> Doing so would, of course, be a very bad idea.  But still, you _could_.

Something of an understatement, I think. :-)*

Seriously, this made me wonder if inscrutable error messages might be
clarifed by a (reverse) trace of the last few steps in parsing. That
would show you what the compiler thought ir was doing.

Would that be a) reasonably practical to implement, and b)
sufficiently useful to justify the effort?


Re: list assignment

2021-01-20 Thread Parrot Raiser
The fundamental problem here seems to be the imprint of Perl's
behaviour on the mental model. Assigning arrays flattens them into a
list of their contents, which then gets used as input to the
assignment. That means that more complicated structures, such as
arrays of arrays need some faking.

Raku approaches arrays as thingies in their own right, so the
subconcious assumptions are no longer valid.  Vocalising the actions
of the code, (even if just internally) will probably overlay the old
model in time, (though the palimpsest may show through in unguarded
momants).

On 1/19/21, Ben Davies  wrote:
> On 2021-01-19 2:18 p.m., Brian Duggan wrote:
>> Hi Folks,
>>
>> I ran into this situation today, which seems counterintuitive:
>>
>>   my @one = 1,2,3;
>>   my @two = 4,5,6;
>>   my @both = @one,@two;
>>   my @first = @both[0];
>>   say @one.raku;
>>   say @first.raku;
>>
>> output:
>>
>>  [1, 2, 3]
>>  [[1, 2, 3],]
>>
>> I was expecting @first and @one to be the same.
>> I discovered that I could instead write either of these --
>>
>>my (@first) = @both[0];
>>my @first := @both[0];
>>
>> or I could change the @both assignment to be
>>
>>  my @both := @one, @two;
>>
>> ..but I wonder if there's an idiomatic approach -- or
>> way of thinking about this -- that makes this flow more
>> intuitive.
>>
>> thanks
>> Brian
>
> Arrays always containerize their values with Scalar ("itemize"). This
> means that when they contain arrays as values, each array will get
> treated like a singular value that happens to be an Array instead of an
> array of values like they normally would elsewhere.
>
> Lists keep their values' containers as-is. These are what the , operator
> returns by default, so one way to leverage containers here is to bind to
> @both like you already discovered:
>
> my @both := @one, @two;
>
> Another is to type @both as a List and assign:
>
> my @both is List = @one, @two;
>
> But List lacks some of the luxuries Array provides over it, such as
> mutability and typed values. What I'd do here is decontainerize @both[0]
> with the <> postfix operator so @both's Array typing can be kept:
>
> my @first = @both[0]<>;
>
>


Re: Is the cosine page wrong?

2020-12-28 Thread Parrot Raiser
P.R. submitted for step #2

On 12/28/20, Richard Hainsworth  wrote:
> This seems to have been fixed already.
>
> The speed this problem was noted and fixed demonstrates (a) the
> importance given to documentation, and (b) the diligence of JJ.
>
> Kudos to JJ and those who helped fix the problem.
>
> Richard
>
> On 28/12/2020 15:35, Elizabeth Mattijsen wrote:
>> https://github.com/Raku/doc/issues/3753
>>
>>> On 28 Dec 2020, at 16:23, Parrot Raiser <1parr...@gmail.com> wrote:
>>>
>>> I just went to the page at docs.raku.org on multi-line comments, to
>>> suggest a couple of clarifying edits. The pencil icon invoked a 404
>>> from GitHub.
>>>
>>> When one goes to make a fix, and the fixer is broken, it's a bit
>>> recursive. Can anyone cure problem #1, so I can get to step #2? :-)*
>>>
>>> On 12/28/20, Elizabeth Mattijsen  wrote:
>>>> ❤️
>>>>
>>>>> On 28 Dec 2020, at 13:54, Richard Hainsworth 
>>>>> wrote:
>>>>>
>>>>> Todd,
>>>>>
>>>>> Some of what you have said in this email list over the years has been
>>>>> very
>>>>> valuable. You ask questions that get some very illuminating answers. I
>>>>> wrote a Module just for you (although I' still trying to get it to work
>>>>> on
>>>>> Windows) and it inspired me to look much more deeply at GTK::Simple,
>>>>> which
>>>>> I have just become the maintainer for.
>>>>>
>>>>> So please take what I say now as a plea for you to adapt a little, not
>>>>> to
>>>>> get pissed off with us even though you do seem to have pissed some of
>>>>> us
>>>>> off.
>>>>>
>>>>> You have very definite ideas about what the documentation should and
>>>>> shouldn't be. You have stated them over and over again. The Raku
>>>>> community
>>>>> at large - based on replies from multiple individuals over the years -
>>>>> disagrees with you.
>>>>>
>>>>> The Raku community has come to the concensus that there is a
>>>>> distinction
>>>>> between Tutorials and Reference, and that the Documentation site
>>>>> should
>>>>> contain both. Tutorials define how to use some aspect of Raku, with
>>>>> example text and explanation. Reference tries to cover as much of the
>>>>> language as possible, covering all the methods/subs/names/types etc as
>>>>> possible. Reference is written for a person who already knows how to
>>>>> program and who uses Raku. The assumption is that if a person reading
>>>>> a
>>>>> reference does not understand some term, then s/he will search in the
>>>>> documentation on that term to understand it.
>>>>>
>>>>> No set of documentation standards will please everyone - that's life.
>>>>> Even
>>>>> so, there ARE STILL areas of the Raku documentation that are lacking
>>>>> (just
>>>>> look at the issues on the Documentation repository, any of them raised
>>>>> by
>>>>> our indefatigable JJ).
>>>>>
>>>>> However, the balances between prolixity and brevity, examples and
>>>>> assumption of knowledge, exhibited in the Raku Documentation do by and
>>>>> large reflect a community consensus.
>>>>>
>>>>> It is polite in a community of rational human beings to accept what
>>>>> seems
>>>>> to be the general consensus, even if you do not agree with it. By
>>>>> continuing to demand your views about documentation should be accepted
>>>>> without any support from anyone else, is quite irritating. So please
>>>>> try
>>>>> to find a different way to express ways to improve the documentation
>>>>> that
>>>>> will not piss people off.
>>>>>
>>>>> You have suggested in this email list a variety of 'keepers', which
>>>>> seem
>>>>> to be the way you document your use of Raku. However, these 'keeper'
>>>>> texts
>>>>> are full of spelling mistakes, indicating you do not use a
>>>>> spell-checker,
>>>>> and also are ambiguous or technically wrong. Personally, I have not
>>>>> found
>>>>> your keepers to have 

Re: Is the cosine page wrong?

2020-12-28 Thread Parrot Raiser
I just went to the page at docs.raku.org on multi-line comments, to
suggest a couple of clarifying edits. The pencil icon invoked a 404
from GitHub.

When one goes to make a fix, and the fixer is broken, it's a bit
recursive. Can anyone cure problem #1, so I can get to step #2? :-)*

On 12/28/20, Elizabeth Mattijsen  wrote:
> ❤️
>
>> On 28 Dec 2020, at 13:54, Richard Hainsworth 
>> wrote:
>>
>> Todd,
>>
>> Some of what you have said in this email list over the years has been very
>> valuable. You ask questions that get some very illuminating answers. I
>> wrote a Module just for you (although I' still trying to get it to work on
>> Windows) and it inspired me to look much more deeply at GTK::Simple, which
>> I have just become the maintainer for.
>>
>> So please take what I say now as a plea for you to adapt a little, not to
>> get pissed off with us even though you do seem to have pissed some of us
>> off.
>>
>> You have very definite ideas about what the documentation should and
>> shouldn't be. You have stated them over and over again. The Raku community
>> at large - based on replies from multiple individuals over the years -
>> disagrees with you.
>>
>> The Raku community has come to the concensus that there is a distinction
>> between Tutorials and Reference, and that the Documentation site should
>> contain both. Tutorials define how to use some aspect of Raku, with
>> example text and explanation. Reference tries to cover as much of the
>> language as possible, covering all the methods/subs/names/types etc as
>> possible. Reference is written for a person who already knows how to
>> program and who uses Raku. The assumption is that if a person reading a
>> reference does not understand some term, then s/he will search in the
>> documentation on that term to understand it.
>>
>> No set of documentation standards will please everyone - that's life. Even
>> so, there ARE STILL areas of the Raku documentation that are lacking (just
>> look at the issues on the Documentation repository, any of them raised by
>> our indefatigable JJ).
>>
>> However, the balances between prolixity and brevity, examples and
>> assumption of knowledge, exhibited in the Raku Documentation do by and
>> large reflect a community consensus.
>>
>> It is polite in a community of rational human beings to accept what seems
>> to be the general consensus, even if you do not agree with it. By
>> continuing to demand your views about documentation should be accepted
>> without any support from anyone else, is quite irritating. So please try
>> to find a different way to express ways to improve the documentation that
>> will not piss people off.
>>
>> You have suggested in this email list a variety of 'keepers', which seem
>> to be the way you document your use of Raku. However, these 'keeper' texts
>> are full of spelling mistakes, indicating you do not use a spell-checker,
>> and also are ambiguous or technically wrong. Personally, I have not found
>> your keepers to have been any use at all. But they may be useful to
>> someone. Even worse, it is not possible for me to find a collection of
>> your keepers because they are in posts to this email list, and I am not
>> going to search through thousands of emails for your keepers on something
>> whose keywords I would need to guess at. So the form you have made the
>> keepers available is not easily accessible.
>>
>> In addition, the way the Raku community has evolved to work is to make
>> changes to Documentation, whether Tutorials or Reference, by actually
>> suggesting changes. If you look on the upper right of any primary document
>> (the docs.raku.org site displays pages that are both automatically
>> generated from primary documents, and the primary documents themselves -
>> basically the documents referenced from the home page), you will see a
>> Pencil icon. Click on that, and you will be taken to the github site and
>> you can directly edit the document. The change is then submitted as a Pull
>> Request, and it will be reviewed. If the change is seen to be reasonable,
>> it is included.
>>
>> In this way, every single member of the Raku Community has the ability to
>> make or suggest a contribution.
>>
>> However, a word of caution about human nature. If you go and try to
>> completely change all the documentation to the way you want it, trashing
>> everything that has already been contributed, it is extremely unlikely
>> that your amendments will ever be accepted. Further, you run the risk that
>> contributions with your name will never be considered by the Core
>> Developers because they have rejected PRs you made before.
>>
>> Contribute in a way that enhances the Documentation, and your work will be
>> praised.
>>
>> I hope whatever end of year, mid-winter or religious festival you
>> celebrated was festive, even in our pandemic afflicted world, and I wish
>> you a safe and productive CE 2021.
>>
>> Regards,
>>
>> Richard
>>
>> On 28/12/2020 11:55, ToddAndMargo via 

Re: I need help understanding ".contains" method construction

2020-12-28 Thread Parrot Raiser
"Definition of invoke

transitive verb
   1a : to petition for help or support
   b  : to appeal to or cite as authority
   2  : to call forth by incantation : conjure
   3  : to make an earnest request for : solicit
   4  : to put into effect or operation : implement
   5  : bring about, cause"

2,3,4 and possibly even #5 relate to methods.

Simply referring to a method by name, like .rand invokes it directly.
Giving it a value (24.cos) is closer to #3 ("please give me this
value"), and it doesn't matter whether that's a literal or generated
from a variable of some sort.

" invocantn. One who calls upon or invokes."

It could be argued that the calling program is the invocant, but if a
process snoozes until something arrives in its in-box, then does an
action in response, it's a reasonable extension to call the
"something" an invocant. Think of dropping a coin into a soft-drink
machine; the coin invokes the can, even if the former owner of the
coin started the process.


On 12/28/20, ToddAndMargo via perl6-users  wrote:
> On 12/26/20 2:50 PM, Ralph Mellor wrote:
>>> Is this .self with a better name?
>> No.
>>
>> I know you've been progressing in your understanding of
>> OO in general, and Raku's in particular, since you wrote
>> this email. So I won't explain it for now, but rather just try
>> to confirm you now know what that bit of code is doing.
>>
>> So, would you say you now understand that `.value` is a
>> method call on an "invocant" that is either explicitly written
>> to the left of the `.` or is implicitly whatever the current topic
>> is where the `.value` appears?
>
> No idea since you hinted to a newbie like myself.
>
> I do know that .value comes from the class definition
>
> https://github.com/rakudo/rakudo/blob/5df809e29cd2e7ae496a33013b27d2f7b52c7f7d/src/Perl6/bootstrap.c/BOOTSTRAP.nqp#L3427
>
> 3427: Str.HOW.add_attribute(Str, BOOTSTRAPATTR.new(:name<$!value>,
> :type(str), :box_target(1), :package(Str)));
>
> And I would not say it was a method call.  I would say
> it is a "class" from
>
> https://github.com/rakudo/rakudo/blob/5df809e29cd2e7ae496a33013b27d2f7b52c7f7d/src/Perl6/bootstrap.c/BOOTSTRAP.nqp#L19
>
> 19: my class BOOTSTRAPATTR {
>
>
> So I still find the word "invocant" a bit bizarre.
>
>  https://www.merriam-webster.com/dictionary/invocant
>  Definition of invocant
> : one that invokes
>
>  https://www.merriam-webster.com/dictionary/invokes
>  Definition of invoke
>
>  transitive verb
> 1a : to petition for help or support
> b  : to appeal to or cite as authority
> 2  : to call forth by incantation : conjure
> 3  : to make an earnest request for : solicit
> 4  : to put into effect or operation : implement
> 5  : bring about, cause
>
> So from "context", what I pick up is that
>
>1. it is an awful term to have used
>
>2. that
>  24.cos
>   either the 24 appeals/requests to cos to do something
>   making the 24 the invocant,
>or
>   .cos is the invocant and takes the 24 and appeals to
>   the code inside the method to "bring about" something.
>   The 24 may or may not be needed for the appeal, as
>   in ".rand"
>
> So it is better to just tell me and not hint around.
> I do appreciate your efforts a lot though.  Who
> "executes what" who be a better tactic.
>
> -T
>
>
>
>


Re: How do I address individual elements inside an object

2020-12-18 Thread Parrot Raiser
Although it's a standard term, "class" has a misleading connotation of "set".
Using the "fruit" example, the class Fruit should indicate a set of
relevant properties for a fruit, such as name, colour, taste, size,
possibly cost/kilo. Individual variables can be defined as Fruit-type
objects. Then $apple might be declared  with Fruit.new as "apple",
"red", "sweet", 100g, 3.00. The class has methods to do things with
the values, such as return the colour. say $apple.colour would then
output "red", while $banana (another Fruit) in $banana.colour would
output "green". ($banana.ripen would be a method defined in the class
to change "green" to "yellow" and "yellow" to "brown".

On 12/18/20, Laurent Rosenfeld via perl6-users  wrote:
> Hi Todd,
>
> 1. Yes, a class is a blueprint for manufacturing objects, you can construct
> as many object as you want.
>
> 2. As an example, you can try:
>
> say " Fruitstand in $FruitStand.location has  $FruitStand.apples apples.";
>
> 2. As you declared your class the object attributes will not be mutable.
> But if you had declared the apple attribute like so in the class:
>
> has UInt $.apples is rw;
>
> then you could write:
>
> $FruitStand.apples += 42;
>
> Cheers,
> Laurent.
>
> Le ven. 18 déc. 2020 à 08:12, ToddAndMargo via perl6-users <
> perl6-users@perl.org> a écrit :
>
>> Hi All,
>>
>> class Fruit {
>> has Str $.location;
>> has UInt $.apples;
>> has UInt $.oranges;
>> has UInt $.bananas;
>> }
>>
>> my $FruitStand = Fruit.new( location => "Cucamonga",
>> apples   => 400,
>> oranges  => 200,
>> bananas  => 50  );
>>
>> 1)  am I correct that I can make as many objects as I
>>  want out of a particular class?
>>
>> 2 ) what is the syntax to read an element inside an
>>  object?
>>
>> 3)  what is the syntax to write to an element inside an
>>  object?
>>
>> I am confused, again.
>>
>> -T
>>
>


Re: classes and objects questions

2020-12-15 Thread Parrot Raiser
Raku allows for several different programming paradigms; procedural,
functional, (as in languages like LISP), and object-oriented. It is
possible to write purely procedural Raku, while ignoring O-O features
completely, though it does take some dodging.

Object-oriented.programming first surfaced in the mid 1960s in
research projects, but was more generally visible by 1980. Like all
new programming concepts, it was going to cure cancer, bring about
world peace, and produce bug-free software. (And didn't, of course.)
It naturally had its specialised jargon, designed to ensure tribal
solidarity and repel infidels. It gradually spread with languages like
C++, (1979-83),  but remained a niche concept until Sun introduced
Java in 1995.

https://www.indeed.com/career-advice/career-development/what-is-object-oriented-programming

With the success of Java, later Javascript, and other new languages,
O-O and its jargon became
sufficiently mainstream that even many programmers working with other
languages learned the terminology. I suspect that many programmers
trained since the mid-90s assume that it's the only way to code, and
that objects and classes are inherent parts of everyone's universes.

If you were discussing the assembly language for bicycles, any
documentation could reasonably assume an understanding of frames,
wheels, pedals, and bell-cranks. Equally, any discussion of
object-oriented features can reasonably assume an understanding of
generic concepts like objects, classes, and inheritance, provided it
points out local weirdnesses. Repeating all the basics would make the
text cumbersome.

Perhaps the best approach would be a hyperlink to a generic
description (of which there are probably thousands already on the Web)
the first time a terms is introduced. The naive could follow it to
enligtenment, while the cognoscenti would not be distracted by it.


Re: The ,= operator

2020-11-29 Thread Parrot Raiser
P.S. My apologies for top-posting in the quoted text, and my apologies
to William for the duplication.

On 11/29/20, Parrot Raiser <1parr...@gmail.com> wrote:
> Having a consistent ("regular", in the linguistic sense), structure
> for something like the op= form is obviously very desirable. It's so
> much easier to teach and learn a rule like "op= has the same effect,
> whatever "op" is; it takes the variable on the LHS, applies the
> operator to its contents and the other value on the RHS, then puts the
> result back on the LHS side. E.g. $x ,= 2 has the same effect as
> $x = $x + 2 than some irregular, complicated set of conditions in
> certain circumstances,  *E.g. the English conjugation of "to be"; "Me
> be confused".
>
> In this case, unless I have misunderstood the examples, the
> complication appears to be in the effect of the operation, regardless
> of its abbreviation by ,=  Perhaps there's a special case that should
> be pointed out as something that needs more grokking than += or ~=,
> and discussed  under ",", which is actually the tricky operation?
>
> On 11/28/20, William Michels via perl6-users  wrote:
>>> > "Perhaps more importantly, what improvement do you propose?"
>>
>> Apologies for top-posting, but what immediately comes to my mind upon
>> encountering the creation of a self-referential (circular/infinite)
>> object is proverbially 'going-down-a-level' and trying again. So I
>> tried 1. 'decontainerizing' the object on the LHS, and then 2. using
>> the ",=" postfix to add an additional element (or many). Nothing
>> worked.
>>
>> Decont:
>> https://docs.raku.org/language/glossary#index-entry-decont
>>
>> Zen slicing as a possible way of 'de-containerizing' :
>> https://docs.raku.org/language/subscripts#index-entry-Zen_slices
>>
>> Even if the ",=" postfix operator were to gain this ability on
>> non-hash objects, then hash-objects would be special-cased in **not**
>> requiring a Zen-sliced decontainerized object on the LHS, so people
>> would have to consider that outcome.
>>
>> Best Regards, Bill.
>>
>>
>>
>> On Sat, Nov 28, 2020 at 8:33 AM Ralph Mellor 
>> wrote:
>>>
>>> > > @r = @r , 'd';
>>> >
>>> > Okay, that makes sense.  So the circular reference I thought I
>>> > was seeing is really there, and it's working as designed.
>>> >
>>> > There isn't anything very useful in this behavior though, is there?
>>>
>>> Yes.
>>>
>>> Here are some relevant results from a search for "self referential" in
>>> the #perl6 and #raku logs.
>>>
>>> 2006
>>> https://colabti.org/irclogger/irclogger_log/perl6?date=2006-01-06#l567
>>> > stevan: dunno about ML (or whatever TaPL uses), but IIRC scheme's
>>> letrec is a form of let which allows things to be self referential
>>>
>>> 2012
>>> https://colabti.org/irclogger/irclogger_log/perl6?date=2012-01-01#l107
>>> my $ff=1;
>>> constant @primes =
>>> 2, 3, 5,
>>> -> $n is copy { repeat { $n += 2 + ($ff=!$ff)*2 } until $n %% none
>>> @primes ... * > sqrt $n; $n; }
>>> ... *;
>>> say @primes[^10]; # OUTPUT«2 3 5 7 11 13 17 19 23 29␤»
>>>
>>> 2012
>>> https://colabti.org/irclogger/irclogger_log/perl6?date=2012-10-05#l582
>>> > TimToady: I'd like to get to the point where we can do hamming numbers
>>> self referentially
>>> constant @hamming = 1, dedup (@hamming X* 2) M (@hamming X* 3) M
>>> (@hamming X* 5);
>>>
>>> 2014
>>> https://colabti.org/irclogger/irclogger_log/perl6?date=2014-11-02#l823
>>> > lizmat: my main reason for not pursuing self referential structures in
>>> > .raku
>>> > lizmat: was that I didn't have a solution for representing them
>>> > lizmat: thoughts on that are very welcome
>>> 
>>> > moritz: lizmat: I fear it must be printed out exactly like that
>>>
>>> 2015
>>> https://colabti.org/irclogger/irclogger_log/perl6?date=2015-08-17#l1558
>>> > vendethiel: TimToady: I read the backlog a bit, but I'm not sure I
>>> > read
>>> > the
>>> answer to this question: do you want "my @a = 1, @a" to be (1, 1, 1
>>> ...) (à la haskell)?
>>> > TimToady: not sure it makes sense with 'my' due to assignment
>>> > semantic,
>>> but would certainly be nice if 'constant' could be self referential

Fwd: The ,= operator

2020-11-29 Thread Parrot Raiser
Having a consistent ("regular", in the linguistic sense), structure
for something like the op= form is obviously very desirable. It's so
much easier to teach and learn a rule like "op= has the same effect,
whatever "op" is; it takes the variable on the LHS, applies the
operator to its contents and the other value on the RHS, then puts the
result back on the LHS side. E.g. $x ,= 2 has the same effect as
$x = $x + 2 than some irregular, complicated set of conditions in
certain circumstances,  *E.g. the English conjugation of "to be"; "Me
be confused".

In this case, unless I have misunderstood the examples, the
complication appears to be in the effect of the operation, regardless
of its abbreviation by ,=  Perhaps there's a special case that should
be pointed out as something that needs more grokking than += or ~=,
and discussed  under ",", which is actually the tricky operation?

On 11/28/20, William Michels via perl6-users  wrote:
>> > "Perhaps more importantly, what improvement do you propose?"
>
> Apologies for top-posting, but what immediately comes to my mind upon
> encountering the creation of a self-referential (circular/infinite)
> object is proverbially 'going-down-a-level' and trying again. So I
> tried 1. 'decontainerizing' the object on the LHS, and then 2. using
> the ",=" postfix to add an additional element (or many). Nothing
> worked.
>
> Decont:
> https://docs.raku.org/language/glossary#index-entry-decont
>
> Zen slicing as a possible way of 'de-containerizing' :
> https://docs.raku.org/language/subscripts#index-entry-Zen_slices
>
> Even if the ",=" postfix operator were to gain this ability on
> non-hash objects, then hash-objects would be special-cased in **not**
> requiring a Zen-sliced decontainerized object on the LHS, so people
> would have to consider that outcome.
>
> Best Regards, Bill.
>
>
>
> On Sat, Nov 28, 2020 at 8:33 AM Ralph Mellor 
> wrote:
>>
>> > > @r = @r , 'd';
>> >
>> > Okay, that makes sense.  So the circular reference I thought I
>> > was seeing is really there, and it's working as designed.
>> >
>> > There isn't anything very useful in this behavior though, is there?
>>
>> Yes.
>>
>> Here are some relevant results from a search for "self referential" in
>> the #perl6 and #raku logs.
>>
>> 2006
>> https://colabti.org/irclogger/irclogger_log/perl6?date=2006-01-06#l567
>> > stevan: dunno about ML (or whatever TaPL uses), but IIRC scheme's
>> letrec is a form of let which allows things to be self referential
>>
>> 2012
>> https://colabti.org/irclogger/irclogger_log/perl6?date=2012-01-01#l107
>> my $ff=1;
>> constant @primes =
>> 2, 3, 5,
>> -> $n is copy { repeat { $n += 2 + ($ff=!$ff)*2 } until $n %% none
>> @primes ... * > sqrt $n; $n; }
>> ... *;
>> say @primes[^10]; # OUTPUT«2 3 5 7 11 13 17 19 23 29␤»
>>
>> 2012
>> https://colabti.org/irclogger/irclogger_log/perl6?date=2012-10-05#l582
>> > TimToady: I'd like to get to the point where we can do hamming numbers
>> self referentially
>> constant @hamming = 1, dedup (@hamming X* 2) M (@hamming X* 3) M
>> (@hamming X* 5);
>>
>> 2014
>> https://colabti.org/irclogger/irclogger_log/perl6?date=2014-11-02#l823
>> > lizmat: my main reason for not pursuing self referential structures in
>> > .raku
>> > lizmat: was that I didn't have a solution for representing them
>> > lizmat: thoughts on that are very welcome
>> 
>> > moritz: lizmat: I fear it must be printed out exactly like that
>>
>> 2015
>> https://colabti.org/irclogger/irclogger_log/perl6?date=2015-08-17#l1558
>> > vendethiel: TimToady: I read the backlog a bit, but I'm not sure I read
>> > the
>> answer to this question: do you want "my @a = 1, @a" to be (1, 1, 1
>> ...) (à la haskell)?
>> > TimToady: not sure it makes sense with 'my' due to assignment semantic,
>> but would certainly be nice if 'constant' could be self referential
>> > TimToady: and we might intuit a lazy if we see the same symbol on the
>> > left and right
>> > TimToady: haskell obviously never needs to have explicit lazy, since
>> > everything already is...
>> .
>> > Also (the immediate point, really) this isn't described very well
>> > in the documentation.
>>
>> I'd say the first focus is best `.raku`. But perhaps it's already
>> optimal.
>> Then again, I imagine "thoughts on that are very welcome" still applies.
>>
>> It's always appropriate to consider improving the doc, especially
>> imo if a draft of an improvement is written by, or in cooperation
>> with, folk who encountered a problem..
>>
>> > Just to be thoroughly clear, since with a hash this works ...
>> > My first guess was that for arrays, this would work:
>> > But here, while @all_at_once is just: [a b c] the array
>> > @in_stages has a peculiar structure containing circular references.
>>
>> Each hash in a list of hashes is automatically flattened:
>>
>> my %hash = { :a, :b }, { :c, :d }
>> say %hash; # {a => True, b => True, c => True, d => True}
>>
>> Whereas each array in a list of arrays is not:
>>
>> my @array = [ :a, :b ], 

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-06 Thread Parrot Raiser
Can you provide some samples of what you are trying to match and
exclude? There might be alternative solutions.


List name and raku installation options

2020-09-27 Thread Parrot Raiser
As I was about to post my other question, it occurred to me that
perhaps we should have a raku-users list, (and corresponding ones for
the other, formerly perl6-flavoured lists?

And now for the actual question. I'm experimenting with installing
Raku on an ARM machine, (specifically a PineBook Pro).
Is there any way I can indicate to the download, especially "make"
that it has 6 cores with which to play.

(It seemed to speed up experiments on a Raspberry Pi with an earlier
format of the download, where it was possible to change the make
command.)


Re: lines :$nl-in question

2020-09-02 Thread Parrot Raiser
Possibly OT, the "-er/-ee" boundary has become corrupted in recent usage.
 I suppose "standees" in a bus might be tolerated, depending on your
view of transit riders as active or passive, but when a jail-break
occurs, the former prisoners should become "escapers", not "escapees".
The  prison authorities are the escapees. Similarly, the attendees at
a conference are the people on stage, being attended-to by the
attendants sitting down below them.



On 9/1/20, Larry Wall  wrote:
> On Sun, Aug 30, 2020 at 03:12:26PM -0700, yary wrote:
> : I have a quibble there. 1st & 2nd sentences disagree slightly by going
> from
> : active to passive voice. "Caller, the one who calls" vs "object on which
> : that method is being called"
> :
> : Suggestion for 2nd sentence "The invocant of a method would be the object
> : calling the method" ... if that is correct!
>
> I don't think it much matters, because Tom and I originally picked
> "invocant" precisely because it was the least-marked affix available with
> respect to active/passive voice, so that you could run your mental model
> either way, depending on whether you think the object itself does the
> method or the calling context does the method on behalf of the object.
> There is no single right answer here. C++ programmers will think of it
> very differently from Smalltalk programmers.
>
> Larry
>


Re: print particular lines question

2020-08-25 Thread Parrot Raiser
That will golf a little (and improve it) to:

$ raku -e '.say for lines()[3,2,5]' lines.txt

but you have to remember that it's zero-based. I used the first sample
file and got
Line 4
Line 3
Line 6

"The three great problems of computer science: compiler complexity and
'off-by-one' errors".


On 8/25/20, Andy Bach  wrote:
>> Assigning  `my @x=$_.lines` puts everything into $x[0]
>
> Trying this on windows
>
> C:\> raku.exe   -e "my @x = 'lines.txt'.IO.lines; say
> @x[1,7,3].join(qq~\n~); "
> Line 1
> Line 7
> Line 3
>
> or
> C:\> raku.exe -e " say 'lines.txt'.IO.lines[1,7,3].join(qq~\n~); "
> Line 1
> Line 7
> Line 3
>
> a
>
> Andy Bach, BS, MSCMECFA
> Systems Mangler
> Internet: andy_b...@wiwb.uscourts.gov
> Voice: (608) 261-5738, Cell: (608) 658-1890
>
> Every man has the right to an opinion but no man
> has a right to be wrong in his facts. Nor, above all,
> to persist in errors as to facts. Bernard Baruch
>
> 
> From: ToddAndMargo via perl6-users 
> Sent: Monday, August 24, 2020 9:35 PM
> To: perl6-users 
> Subject: print particular lines question
>
> Hi All,
>
> I seems I should know how to do this, but
> I am drawing a blank.
>
> $ cat Lines.txt | raku -ne 'say $_;'
> Line 1
> Line 2
> Line 3
> Line 4
> Line 5
> Line 6
> Line 7
> Line 8
> Line 9
> Line 10
> Line 11
>
>
> I want to print liens 1, 3, and 7.
>
> Assigning  `my @x=$_.lines` puts everything into $x[0]
>
>
> Many thanks,
> -T
>


Re: Pod6 examples

2020-07-21 Thread Parrot Raiser
Thanks, Richard and daniel.

On 7/21/20, Richard Hainsworth  wrote:
> How about:
>
> https://github.com/Raku/doc/tree/master/doc/Language/pod.pod6
>
> which is the pod source of https://docs.raku.org/language/pod
>
> Also try the other sources under the
> https://github.com/Raku/doc/tree/master/doc directory.
>
> Richard
>
> On 21/07/2020 15:40, Parrot Raiser wrote:
>> Can anyone point me at examples of pod6 in use? I'm trying to relate
>> the syntax shown in https://docs.raku.org/language/pod to actual
>> results. Concise would be nice, tutorial even better.
>


Pod6 examples

2020-07-21 Thread Parrot Raiser
Can anyone point me at examples of pod6 in use? I'm trying to relate
the syntax shown in https://docs.raku.org/language/pod to actual
results. Concise would be nice, tutorial even better.


Re: delimiters with more than one character? ...

2020-07-16 Thread Parrot Raiser
Perhaps with a grammar?

On 7/16/20, Tom Browder  wrote:
> An opportunity for Raku golfers to show off Raku on the Debian users list.
>
> Best regards,
>
> -Tom
>
> -- Forwarded message -
> From: Albretch Mueller 
> Date: Tue, Jul 14, 2020 at 07:52
> Subject: delimiters with more than one character? ...
> To: Debian Users ML 
>
>
>  I have a string delimited by two characters: "\|"
>
>  _S=" 34 + 45 \| abc \| 1 2 3 \| c\|123abc "
>
>  which then I need to turn into a array looking like:
>
>   _S_AR=(
> " 34 + 45 "
> " abc "
> " 1 2 3 "
> " c"
> "123abc "
> )
>
>   I can't make awk or tr work in the way I need and all examples I
> have found use only one character.
>
>   Is it possible to do such things in bash?
>
>   lbrtchx
>


Re: Rakudo+ versions quoted in the documentation

2020-07-05 Thread Parrot Raiser
Wouldn't the responsibility be on the web pages to keep up-to-date?
That would be more a matter of agreement on the place to watch?


Rakudo+ versions quoted in the documentation

2020-07-04 Thread Parrot Raiser
I just happened to look at the raku.org and raskudo.org download
pages, and noticed that both quote 2020.01 as the most recent
versions.

Patrick Spek's dist.tyil.nl/raku/rakudo-star/ has both 2020.03 and
2020.05 for download following that.

Should the sites be synchronised, preferably with a mechanism to keep
them together in future? (


Re: junctions and parenthesis

2020-06-26 Thread Parrot Raiser
It seems to me that arbitrarily changing the precedence of a function
would produce a horrible maintenance nightmare.
It would mean recognising what had been done, interpreting the first
example found in a different way than any other code, then tracking
down any other place the trick had been used. (Or determining that
none of the other programs in the system used the same technique.)


Re: just curious to know

2020-06-14 Thread Parrot Raiser
There is potentially a place for Raku in education, as a language that
can evolve from simple expressions in the REPL to one-liners, basic
scripts and through to complete CS courses with the various
programming paradigms (procedural, O-O, functional) and into language
design with grammars.

The challenge is to develop the progression and its signposts in a way
that lures the unwary onto the path, (why do I hear that in Damian
Conway's vice?) rather then terrifying them with the whole vast
edifice. I'm stii trying to grasp enough of the concepts to decide the
logical sequence. The trouble is that those who have a complete
understanding of the language have almost certainly forgotten what it
was like to be naive and bewildered.

On 6/14/20, ToddAndMargo via perl6-users  wrote:
> On 2020-06-14 08:04, Radhakrishnan Venkataraman wrote:
>> Hi,
>> I had been a perl 5.0 user in the past.  Ever since perl 6.0 was
>> announced, I waited, like many, indefinitely.  At last perl 6.0 has just
>> started from its starting block and is also in the race.  I am happy
>> about that.
>
> Hi Radhakrishnan,
>
> I am a beginner at Raku and this is from a beginner's
> prospective.  (But when did that ever stop me?)
>
> I come from all kinds of computer aided testing programs,
> most of which I have forgotten, then Pascal, then
> Modula 2.  More recently bash, batch and Perl 5.
>
> I program in what is called "Top Down".
>  https://www.quora.com/What-is-top-down-programming?share=1
>
> Consequently, I use tons and tons of subroutines.  Perl 5
> is an "absolute nightmare" for Top Down.  Perl 5 passes
> variables to subroutines as pointers in an array.  (Note
> that Pointers in Perl 5 are referred to as "references"
> and calling them the generic term "pointer" is picking a
> fight with Perl 5 programmers.)  There are no pointer
> (references) in Raku as they are not necessary AND GOOD
> RIDDANCE!!
>
> When I discovered subroutines in Raku, I though I'd died
> and gone to Top Down heaven.
>  https://en.wikibooks.org/wiki/Perl_6_Programming/Subroutines
>
> The insane subroutine parameters in Perl5 make for a lot
> of Bottom Up programming.  Because of it Perl 5 programs
> tend to become "Write Only" programs in a heck of a hurry
> and are very hard to maintain.
>
> The main program I support downloads raw web pages and
> digs through them looking for new software revision.
> I use regex's "a lot".  Just my personal opinion,
> but regex's in Raku and a ton easier to use and much
> more well thought out than Perl 5.  (Perl 5's
> regex's remind me of sed's regex's.)
>
> Also Raku's text manipulation programs are to die for.
> You will find yourself using a lot fewer regex's
> because of them: "contains", "starts-with", "ends-with"
> come to mind.
>
> Where Perl 5 has it over Perl6 (Raku) is:
>
> 1) the documents in Perl 5, called Perl Docs, are
> wonderfully written and cater to both beginners and
> experts.  Raku's documents are written as a
> refresher for those that already know what they
> are doing and not for the beginner.  You will tear
> your hair out trying use them and maybe say a few
> "bad" words.
>
> 2) Perl 5 compiles in a heck of a hurry.  Large
> Raku programs take up to ten seconds to compile.
> They are working on it.  The work around is
> the put the main body of your program in a module
> and let .precomp (precomile) take care of it.  Raku
> only re-compiles modules if you have made a change
>
> 3) Raku can not make system calls to Windows if
> it has quotes in it.  It is fixed, but waiting to
> be rolled out.  The work around is to write
> to a bat file and then run the bat file.
>
> 4) Raku programs always do a pop up box in
> Windows and can not be run in the background,
> as they can in Linux.  They are also working on
> it.  I do not know the progress, but it has
> a "very soon" feeling.
>
> Where neither shine is the lack of GUI component
> for laying out GUI windows.  Not to fear, Raku
> does have a module that interfaces with GTK's
> (Gnome Tool Kit's) "Glade" GUI interface designer.
> I have not used it yet, but plan on pounding it
> in the future.  Oh, and GTK and Glade is wonderfully
> cross platform.  Yippee!!
>  https://glade.gnome.org/
>  https://modules.raku.org/dist/Gnome::Gtk3::Glade:cpan:MARTIMM
>
> 5) Perl 5 has a much more "mature" module base.
> But not to fear on that front either.  Raku
> is quickly getting there and the rate of
> development is dizzying.
>
> And very important, Raku has an absolutely wonderful
> army of mensches both on this list and on the chat
> line that bend over backwards to help you.  The
> developers have some astounding programming chops.
>
> The Perl 5 newsgroups tend to be "grouchy", although
> they are quite helpful.  Perl Monks talks over
> everyone's heads.  And Perl Monks web interface must
> have  been designed by the devil himself, when he
> was not working on batch programming
>
> To conclude. I absolute LOVE Raku.  It is my
> favorite 

Re: changing name of module

2020-06-07 Thread Parrot Raiser
Create an updated version, perhaps with an "rk" prefix, (preserving
any text alignment, since "p6" and "rk" are the same length), then
change the "pk" version simply to invoke the "rk"?

Existing code should continue to work, albeit nanoseconds slower,
while new code can be culturally consistent.


Re: I reproduced one of the errors!

2020-06-02 Thread Parrot Raiser
I suspect that "methods" were originally distinguished from
"subroutines" because it made the rain-dance about the new cure for
all civilisation's ills and the heartbreak of psoriasis,
Object-Oriented Programming,  look more impressive. After one has seen
a few programming religions launched, the similarities blur the
differences.  Profundity through obscurity always helps the marketing,
because it slows the recognition.

Subroutines are blocks of code that can be used anywhere within a
scope that may be global or local. Methods are a subset of subroutines
that can only be used within a particular scope on particular kinds of
things.


Re: the state of the build and install instructions

2020-05-14 Thread Parrot Raiser
Working with p.spek p.s...@tyil.nl on a revised Rakudo Star we
encountered a problem with the Configure step; it might be worthwhile
contacting him to coordinate any changes.

On 5/14/20, Will Coleda  wrote:
> I think it's out of date, yes.
>
> Need a "make install" to install the binaries (by default to
> ./install). Previous versions of the build left a copy in ./perl6 but
> that hasn't been the case for a while. Thanks for the ping, we'll open
> a ticket to get INSTALL.txt updated.
>
> On Thu, May 14, 2020 at 4:20 PM Elizabeth Mattijsen  wrote:
>>
>> Personally, I always do:
>>
>> perl Configure.pl --gen-moar --gen-nqp --make-install
>>
>> > On 14 May 2020, at 22:08, Joseph Brenner  wrote:
>> >
>> > I'm having trouble doing a build of raku from github.  Could it
>> > be the INSTALL.txt file is out-of-date?
>> >
>> > I was trying to build a "bleeding edge" Raku using the
>> > instructions here:
>> >
>> >  https://github.com/rakudo/rakudo/blob/master/INSTALL.txt
>> >
>> > So I thought I'd just need to do this:
>> >
>> >  cd /home/doom/End/Sys/Perl6/dev
>> >  git clone git://github.com/rakudo/rakudo.git
>> >  cd rakudo
>> >  git pull
>> >  perl Configure.pl --gen-moar --gen-nqp --backends=moar
>> >  make
>> >
>> >  pwd
>> >  /home/doom/End/Sys/Perl6/dev/rakudo
>> >
>> >  ./perl6 --version
>> >
>> > But actually, there is no ./perl6 here.  And I don't see a
>> > "Generating" message for it:
>> >
>> >  [...]
>> >  +++ Generating   rakudo-gdb-m
>> >  +++ Generating   rakudo-lldb-m
>> >  +++ Generating   rakudo-valgrind-m
>> >  +++ Generating   perl6-gdb-m
>> >  +++ Generating   perl6-lldb-m
>> >  +++ Generating   perl6-valgrind-m
>> >
>> > Trying something that looks close, I just get this an error:
>> >
>> >  ./perl6-gdb-m --version
>> >
>> >  Unhandled exception: While looking for
>> > '/home/doom/End/Sys/Perl6/dev/rakudo/perl6.moarvm': no such file or
>> > directory
>> >
>> > That file doesn't exist... so despite the --gen-moar option, it
>> > wasn't created?
>> >
>> >  sudo updatedb
>> >  locate perl6.moarvm
>> >
>> >  /home/doom/End/Sys/Perl6/rakudo-star-2019.03/rakudo/perl6.moarvm
>> >  /home/doom/End/Sys/Perl6/rakudo-star-2020.01/rakudo/perl6.moarvm
>> >  /root/rakudo/share/perl6/runtime/perl6.moarvm
>> >
>> > The INSTALL.txt describes a --with-moar option, so I thought I
>> > might try building with an existing moarvm:
>> >
>> >  cd /home/doom/End/Sys/Perl6/dev/rakudo
>> >  perl Configure.pl
>> > --with-moar=/home/doom/End/Sys/Perl6/rakudo-star-2020.01/rakudo/perl6.moarvm
>> > --gen-nqp --backends=moar
>> >  make
>> >
>> > But that just errors out:
>> >
>> >  Unknown option: with-moar
>


Re: Rakudo Star v2020.01

2020-03-04 Thread Parrot Raiser
> I have no plans currently to go through the existing infrastructure and
> rename things. I'm not intimately familiar with the code in Rakudo
> Star, and prefer to not touch what isn't broken.

That sounds like a sensible decision. After thinking about the job, I
realise that it's going to take careful untangling, locating every
reference to files before renaming them.

On 3/3/20, Patrick Spek  wrote:
> On Tue, 3 Mar 2020 16:41:47 -0500
> Parrot Raiser <1parr...@gmail.com> wrote:
>
>> I've managed to download 2020.01, and run it with an explicit path,
>> but the directory structure that my script used to follow, is broken
>> in some way.  (I'll investigate further, to see if I can spot the
>> change, but a required directory tree might help me find it, if you
>> could provide one.)
>>
>> A fair number of references to "perl6" remain in the directories. How
>> many references have to be untangled before it is consistently
>> "rakudo"?
>
> I have no plans currently to go through the existing infrastructure and
> rename things. I'm not intimately familiar with the code in Rakudo
> Star, and prefer to not touch what isn't broken. If references are
> found and can be easily fixed, I'll gladly look into it, though. Of
> course, patches to help out are much appreciated as well!
>
> Also, please note that the language is called Raku, the compiler is
> Rakudo.
>
> --
> With kind regards,
>
> Patrick Spek
>
>
> www:  https://www.tyil.nl/
> mail: p.s...@tyil.nl
> pgp:  1660 F6A2 DFA7 5347 322A  4DC0 7A6A C285 E2D9 8827
>
> social: https://soc.fglt.nl/tyil
> git:https://gitlab.com/tyil/
>


Re: Rakudo Star v2020.01

2020-03-03 Thread Parrot Raiser
I've managed to download 2020.01, and run it with an explicit path,
but the directory structure that my script used to follow, is broken
in some way.  (I'll investigate further, to see if I can spot the
change, but a required directory tree might help me find it, if you
could provide one.)

A fair number of references to "perl6" remain in the directories. How
many references have to be untangled before it is consistently
"rakudo"?

On 2/19/20, JJ Merelo  wrote:
> Great work, and thanks, Patrick.
>
> El mié., 19 feb. 2020 a las 20:46, Patrick Spek via perl6-users (<
> perl6-users@perl.org>) escribió:
>
>> Hi everyone!
>>
>> Just now I've sent an announcement to perl6-compil...@perl.org, to
>> notify people that I've made a first non-rc release of Rakudo Star. For
>> those of you that use Rakudo Star, this may be a good time to try out
>> the latest version! The files are available from https://dist.tyil.nl:
>>
>> - https://dist.tyil.nl/raku/rakudo-star/rakudo-star-2020.01.tar.gz
>> - https://dist.tyil.nl/raku/rakudo-star/rakudo-star-2020.01.tar.gz.asc
>> -
>> https://dist.tyil.nl/raku/rakudo-star/rakudo-star-2020.01.tar.gz.checksums.txt
>>
>> I've not had many people to test things, but the rakudo spectest
>> succeeds on all my machines, and I've been using it on my own machines
>> for a couple weeks now, so I have no reason not to believe this release
>> will work.
>>
>> Do note, however, that I only use, and therefore test, on GNU+Linux.
>> This release does *not* contain a .msi (for Windows users) or a .dmg
>> (for Mac users). If anyone would like to help out by building those
>> files, please do not hesitate to reach out!
>>
>> If you have any questions on how to install this (on GNU+Linux or
>> otherwise), please reply to the mailing list and I (or other people,
>> especially for Windows and Mac users) will do my (or our) best to help
>> you out.
>>
>> Any feedback on how to best communicate these releases is also very
>> much appreciated.
>>
>> Lastly, I do not have access to the sources of https://rakudo.org/ (as
>> far as I'm aware), and can therefore not update that website to mirror
>> the release files, nor update its documentation. If anyone knows who to
>> contact for this, please let me know.
>>
>> --
>> With kind regards,
>>
>> Patrick Spek
>>
>>
>> www:  https://www.tyil.nl/
>> mail: p.s...@tyil.nl
>> pgp:  1660 F6A2 DFA7 5347 322A  4DC0 7A6A C285 E2D9 8827
>>
>> social: https://soc.fglt.nl/tyil
>> git:https://gitlab.com/tyil/
>>
>
>
> --
> JJ
>


Re: perl6 vs ruby

2020-03-03 Thread Parrot Raiser
>  we use ruby for Biological data analysis. I wish perl6 should have got that 
> capability.

Would you like to give us a sample problem,, to see if someone can
show a potential solution?


Re: perl6 vs ruby

2020-03-01 Thread Parrot Raiser
Since Ruby was designed to fix what Matz considered mis-features of
Perl 5, and the motivation for Rakudo was much the same, it's hardly
surprising they're similar.

One feature of any Open Source product to consider when investing any
effort in it is the supporting community. Though Ruby was considered
the cure for all the world's ills a couple of years ago, the community
seems to have undergone some sort of fracture. It's hard to know how
deep that is without being personally involved, but it sounded quite
serious.

If the reference to "BIO" was about bioinformatics, the ability to use
Perl 5 code and modules should reduce the amount of necessary
re-working, though there are probably opportunities to rework the Perl
5 for more power and coherence in Rakudo.


Re: Is LibraryMake still current?

2019-12-23 Thread Parrot Raiser
With the name change to Raku, has anyone considered a naming suffix
policy for modules?  I don't have a problem with .pm6, and I don't
want to cause an outbreak of bikeshedding, but some might consider it
inconsistent.

As an aside, I deplore the practice of identifying the language of a
directly executable program in the top level. It means that any change
to the language used means lying to the world, (which destroys the
point) or hunting down and changing every script or other caller to
reflect the new situation.


Re: Raku, docs, help [was: Re: vulgar?]

2019-12-09 Thread Parrot Raiser
That looks like a great recommendation.

On 12/9/19, Mike Stok  wrote:
>
>> On Dec 9, 2019, at 10:24 AM, Curt Tilmes  wrote:
>>
>> On Mon, Dec 9, 2019 at 10:07 AM ToddAndMargo via perl6-users
>> mailto:perl6-users@perl.org>> wrote:
>> On 2019-12-09 02:00, JJ Merelo wrote:
>> > Other than that, it's clear from the context that it returns a Boolean
>> You still need to change the target audience of the docs
>> from the Developers to the Rakoons.
>>
>> The reference documentation (especially deep inside) is NOT intended for
>> brand new people to the language.
>>
>> They need to start with the introduction, the tutorials, the books, even
>> classes (many are available for free on youtube).
>>
>> The reference documentation is for someone already somewhat familiar with
>> the language, but can't remember the exact calling sequence, or order of
>> arguments, or exactly what gets returned, etc.  The MOST important piece
>> of documentation needed is the precise signature that concisely presents
>> that information.  That is much more important the accompanying verbiage.
>>
>> If one hasn't yet learned what "()" ":D" or "-->" mean, I would kindly
>> suggest that they should review the introductory documentation or some
>> tutorials prior to delving into the detailed technical reference
>> documentation.
>>
>> Curt
>>
>
>
> I have found that https://www.divio.com/blog/documentation/
>  helped me understand more about
> why I have had problems writing documentation.
>
> Mike
>
> --
>
> Mike Stok 
> http://www.stok.ca/~mike/
>
> The "`Stok' disclaimers" apply.
>
>
>
>
>
>
>


Re: Perl6 vs Julia

2019-12-09 Thread Parrot Raiser
I agree with you. Improving an existing one is different, even if
fixing the original does give turn out to produce what is effectively
a new one.

Addressing a completely new class of problem would also be different,
but that would be moving up the stack.


Re: Perl6 vs Julia

2019-12-08 Thread Parrot Raiser
Who initiated the project, and why?
What deficiencies in existing languages are they trying to address?

The belief that Yet Another Programming Language is the answer to the
world's problems is a persistent, but (IMNSHO) a naive one.

On 12/8/19, Andrew Shitov  wrote:
> Let’s not hide the fact that Julia development raised 4.6 million dollars
> and the language is production-ready.
>
> On Sun, 8 Dec 2019 at 12:46, JJ Merelo  wrote:
>
>> It might have been, but syntax is more Python-like to the point that in
>> some cases it's exactly the same. It's got a very extensive macro
>> systems,
>> which enables it to work concurrently, for instance. It's more
>> scientific-computing oriented, which means that there are all sort of
>> mathematical modules for it, and not so many for web, databases, or
>> things
>> like that.
>>
>> El dom., 8 dic. 2019 a las 4:38, Tom Blackwood ()
>> escribió:
>>
>>> Hello
>>>
>>> How do you think of Julia language?
>>>
>>> https://en.wikipedia.org/wiki/Julia_(programming_language)
>>>
>>> It says it is also influenced by perl language.
>>>
>>> Regards
>>>
>>
>>
>> --
>> JJ
>>
> --
> Andrew Shitov
> __
> a...@shitov.ru | http://shitov.ru
>


Re: comment on the new name change

2019-12-06 Thread Parrot Raiser
Should users of Raku be termed "Rakuuns"? :-)*


Re: vulgar?

2019-12-06 Thread Parrot Raiser
It has been said that any sound the human voice can utter is rude in
some language.

It is also rather obvious that people who acquire second and
subsequent languages informally tend to learn a very high proportion
of "taboo" expressions. (Possibly because in many cases their
principal source is military, and Mother's not around to say "No dear,
we don't say that".)

Even the most rigourous definitions are made more comprehensible by
clear, correct, examples, but any attempt to make technical writing
anything but utterly moribund encounters a barrage of managerial and
editorial flak, (at least in my experience). I think it's a residue of
academics' attempts to achieve profundity through obscurity.  If it's
clear, it can't be important, (and won't attract grants.)

Project teams tend to acquire a specialised jargon from shared
experiences, which speeds internal communication, but (sometimes
deliberately) excludes non-members. Given that, and an unusually deep
acquaintance with the topic, the people who know most about a piece of
software are probably the least suitable to document it for general
users. They've forgotten what other people don't know. (Their "unknown
unknowns".)


Re: getting comb to return match objects

2019-11-17 Thread Parrot Raiser
What do the official tests for this show?

On 11/16/19, Joseph Brenner  wrote:
> William Michelswrote:
>
>> I went over this with Joe as well, and I was
>> equally confused.
>
> Part of our trouble was we were playing around with the
> routine form of comb (rather than the Str method), which
> had a bug in it with the :match option (which lizmat just fixed).
> Even when we tried the Right Thing it was still going wrong.
>
> But then, like I was saying at the time, I really needed to
> re-read the material on subroutine signatures-- I wasn't
> even sure if the ":match" flag was supposed to be positional
> or not-- a point Yary picked up on.
>
>> So if I understand what you're
>> saying correctly, if we see something like "Bool
>> :$match" that says we should drop the dollar-sign
>> ($) and enter ":match" to set "Bool" = True, and
>> thus return the list of match objects?
>
> Something like that.  The ":$match" declares a variable named
> $match for use inside the routine-- it also makes it a little
> simpler to work with an input variable also named $match.
>
> Take this as an example:
>
> sub doom_flag (Bool :$flag) {
> if $flag {  # declared by the sub signature, no "my $flag"
> say "The flag is UP"
> } else {
> say "The flag is down."
> }
> }
>
> doom_flag();  # The flag is down.
>
> # All of the following invocations say:
> #   The flag is UP
>
> doom_flag( flag => True );
> doom_flag( :flag );
>
> my $flag = True;
> doom_flag( flag => $flag );
> doom_flag( :$flag );
>
> That last one is a funny short-cut for entering a Pair that's built-in
> to Raku: it's pretty common when you're working with named arguments to
> end up with code that looks redundant, like this:
>
>make_connection(
> ip =>  $ip,
> user =>  $user,
> pw   =>  $pw
> );
>
> But you could just use "colon-pair"s and do it like this:
>
>make_connection( :$ip, :$user, :$pw );
>
> Does this make more sense?  There's a few different idiomatic short-cuts
> here that I think are supposed to seem similar and suggest each other...
>
>
> On 11/16/19, William Michels  wrote:
>> Hi Yary,
>>
>> I went over this with Joe as well, and I was equally confused. So if I
>> understand what you're saying correctly, if we see something like
>> "Bool :$match" that says we should drop the dollar-sign ($) and enter
>> ":match" to set "Bool" = True, and thus return the list of match
>> objects?
>>
>> On another note (or possibly the same note), I tried code similar to
>> Joe's with fair success. I was able to get the REPL to understand a
>> "True" or "False" parameter, but never in conjunction with a "$limit"
>> parameter. Is this the correct behaviour, and why?
>>
>>> #REPL
>> Nil
>>> say comb(/\w/, "a;b;c",  False).perl;
>> ().Seq
>>> say comb(/\w/, "a;b;c",  True).perl;
>> ("a",).Seq
>>> say comb(/\w+/, "a;b;c",  True).perl;
>> ("a",).Seq
>>> say comb(/\w+/, "a;b;c",  2).perl;
>> ("a", "b").Seq
>>> say comb(/\w+/, "a;b;c",  3).perl;
>> ("a", "b", "c").Seq
>>> say comb(/\w+/, "a;b;c",  4).perl;
>> ("a", "b", "c").Seq
>>> say comb(/\w+/, "a;b;c",  True).perl;
>> ("a",).Seq
>>> say comb(/\w+/, "a;b;c",  2, True).perl;
>> Too many positionals passed; expected 2 or 3 arguments but got 4
>>   in block  at  line 1
>>
>>> say comb(/\w+/, "a;b;c",  2, :True).perl;
>> Unexpected named argument 'True' passed
>>   in block  at  line 1
>>
>>> $*VM
>> moar (2019.07.1)
>>
>> Any help appreciated, Bill.
>>
>>
>>
>>
>> On Mon, Nov 11, 2019 at 9:46 AM yary  wrote:
>>>
>>> The syntax is in the declaration you pasted in your email
>>>
>>> > multi subcomb(Regex:D $matcher, Str:D $input, $limit = Inf, Bool
>>> > :$match)
>>>
>>> The colon in "Bool :$match" makes it a named argument. Not sure where
>>> definitive docs are, decent starting point is
>>> https://docs.perl6.org/type/Signature#Positional_vs._named_arguments
>>>
>>>
>>> -y
>>>
>>>
>>> On Sun, Nov 10, 2019 at 11:18 PM Joseph Brenner 
>>> wrote:

 Thanks, that form does what I want--

 I don't see how I could've understood that from the docs, though.
 For example, I don't see any place where the :match adverb is
 mentioned for either the method or routine form of comb.



 On 11/10/19, Elizabeth Mattijsen  wrote:
 > dd "foobar".comb(/./, :g, :match);
 > (「f」 「o」 「o」 「b」 「a」 「r」)
 >
 >> On 10 Nov 2019, at 23:46, Joseph Brenner  wrote:
 >>
 >> Can someone give me an example of how to use the comb routine to
 >> return a list of match objects?
 >>
 >> The documentation here:
 >>
 >> https://docs.perl6.org/type/Str#routine_comb
 >>
 >> Mentions a boolean option to get match objects:
 >>
 >>> If $matcher is a Regex, each Match object is
 >>> converted to a Str, unless $match is set.
 >>
 >> I gather that I must be reading this signature
 >> 

Who's who of the ecosystem?

2019-11-06 Thread Parrot Raiser
Raku is the product of collaboration by many people. Some of these are
well known, but there are many parts of the ecosystem whose mavens are
anonymous or obscure. When a problem arises, it would be nice to be
able to direct them to someone knowledgeable, rather than essentially
yelling them in public and hoping someone responds to the noise.

Do we have any kind of resource, (web page or whatever), indicating
who might be authoritative on a particular issue? Some names are
fairly well-known, (and may wish they weren't), but topics like the
internals of zef are hard to link to a person or group.


Re: Rakudo Star 2019.07.1

2019-11-06 Thread Parrot Raiser
When I report a problem, I try to supply as complete a picture as
possible, without imposing my filter on the data. So many times I've
had a vital clue omitted by someone who "didn't think that X was
important".

With so many parties involved, it's not surprising that errors reveal
issues entirely outside your ken; those capable of fixing them may see
the report and fix them.

> I'm not sure what you mean with "-n vs .n for sub-version ids". I

The Rakudo* convention for normal releases was .MM, for
experimental or supplemental releases was .MM-N, so my download
script inserted "-" as the separator if given a third parameter, while
you're using .MM.N I just changed the script, but again reported
it in case someone else also uses a script.


Re: Rakudo Star 2019.07.1

2019-11-05 Thread Parrot Raiser
I'm treating this as a test of the process, reporting the problems
created, so that the process can be fixed. Merely hacking up a
solution might give me a better functioning installation, but it would
leave the problem for everyone else.

The unfriendly filenames are really an additional issue. Ordinarily,
they shouldn't be visible to users, but they complicate reporting and
fixing.

On 11/5/19, William Michels  wrote:
> In a previous installation location, have you tried grepping for:
> "91857A0CE92503F53D56DEBB6F633402878D0FF0"
>
> ...and copying it over to your new 'dist' directory?
> (/home/guru/rakudo/rakudo-star-2019.07.1/install/share/perl6/site/dist/)
>
> The 'dist' directory appears to keep track of modules by version
> number, so I don't believe the string you posted is the "SHA1" hash
> name of the Linenoise module per se. I'm assuming this, because the
> zef command:
>
>> mbook:~ homedir$ zef --sha1 locate
>> 91857A0CE92503F53D56DEBB6F633402878D0FF0
>
> ...fails to locate the long string you posted.
>
> I'm assuming all these file names are generated by zef. The warning
> already tells you which module the filename pertains to (Linenoise),
> so I guess I'm not understanding the problem. You can locate the your
> Linenoise module using the command below, and work from there.
>
>> mbook:~ homedir$ zef locate Linenoise
>
> HTH, Bill.
>
> REFERENCE: https://github.com/ugexe/zef
>
>
>
>
> On Tue, Nov 5, 2019 at 2:15 PM Parrot Raiser <1parr...@gmail.com> wrote:
>>
>> After a few difficulties caused by subtly different paths and version
>> identification (like -n vs .n for sub-version ids) the download and
>> installation appears to have worked, but trying the REPL produced the
>> following error message:
>>
>> "I ran into a problem while trying to set up Linenoise: Failed to open
>> file
>> /home/guru/rakudo/rakudo-star-2019.07.1/install/share/perl6/site/dist/91857A0CE92503F53D56DEBB6F633402878D0FF0:
>> No such file or directory
>> Continuing without tab completions or line editor"
>>
>> I assume that horrendous filename is a SHA hash if some sort. To
>> whoever is involved with that part of the system, is there any chance
>> of generating shorter filenames to make understanding and
>> communication easier?
>>
>> On 11/5/19, William Michels via perl6-users  wrote:
>> > Thank you Patrick!
>> >
>> > On Tue, Nov 5, 2019 at 8:52 AM JJ Merelo  wrote:
>> >
>> >> Thanks a lot, Patrick.
>> >>
>> >> El mar., 5 nov. 2019 a las 14:28, Patrick Spek via perl6-users (<
>> >> perl6-users@perl.org>) escribió:
>> >>
>> >>> Hello everyone,
>> >>>
>> >>> I've seen people ask about 2019.07.1 in multiple avenues, myself
>> >>> included. Since there was little response, I've set out to build it
>> >>> myself. The first results have been made, with a PR on the Rakudo
>> >>> Star
>> >>> repository to fix a number of issues.
>> >>>
>> >>> Additionally, I've uploaded the 2019.07.1 tarball to my servers for
>> >>> people to test[1]. Those looking for a newer version can download
>> >>> this
>> >>> variant, and see if it works for them. If anyone spots any issues,
>> >>> please let me know, either through this mailing list, the GitHub
>> >>> repository[2] or the GitLab repository[3]. I'm trying to track all of
>> >>> these places, and try to resolve all issues people find.
>> >>>
>> >>> I plan to also release a 2019.10 version of Rakudo Star before the
>> >>> end
>> >>> of this year, but whether that's viable depends on the number of
>> >>> severity of the issues people may find.
>> >>>
>> >>> I hope we can continue the Rakudo Star releases on a regular basis in
>> >>> 2020!
>> >>>
>> >>> [1]: https://dist.tyil.nl/raku/rakudo-star/
>> >>> [2]: https://github.com/rakudo/star
>> >>> [3]: https://gitlab.com/tyil/rakudo-star/
>> >>>
>> >>> --
>> >>> With kind regards,
>> >>>
>> >>> Patrick Spek
>> >>>
>> >>>
>> >>> www:  https://www.tyil.nl/
>> >>> mail: p.s...@tyil.nl
>> >>> pgp:  1660 F6A2 DFA7 5347 322A  4DC0 7A6A C285 E2D9 8827
>> >>>
>> >>> social: https://soc.fglt.nl/tyil
>> >>> git:https://gitlab.com/tyil/
>> >>>
>> >>
>> >>
>> >> --
>> >> JJ
>> >>
>> >
>


Re: Rakudo Star 2019.07.1

2019-11-05 Thread Parrot Raiser
After a few difficulties caused by subtly different paths and version
identification (like -n vs .n for sub-version ids) the download and
installation appears to have worked, but trying the REPL produced the
following error message:

"I ran into a problem while trying to set up Linenoise: Failed to open
file 
/home/guru/rakudo/rakudo-star-2019.07.1/install/share/perl6/site/dist/91857A0CE92503F53D56DEBB6F633402878D0FF0:
No such file or directory
Continuing without tab completions or line editor"

I assume that horrendous filename is a SHA hash if some sort. To
whoever is involved with that part of the system, is there any chance
of generating shorter filenames to make understanding and
communication easier?

On 11/5/19, William Michels via perl6-users  wrote:
> Thank you Patrick!
>
> On Tue, Nov 5, 2019 at 8:52 AM JJ Merelo  wrote:
>
>> Thanks a lot, Patrick.
>>
>> El mar., 5 nov. 2019 a las 14:28, Patrick Spek via perl6-users (<
>> perl6-users@perl.org>) escribió:
>>
>>> Hello everyone,
>>>
>>> I've seen people ask about 2019.07.1 in multiple avenues, myself
>>> included. Since there was little response, I've set out to build it
>>> myself. The first results have been made, with a PR on the Rakudo Star
>>> repository to fix a number of issues.
>>>
>>> Additionally, I've uploaded the 2019.07.1 tarball to my servers for
>>> people to test[1]. Those looking for a newer version can download this
>>> variant, and see if it works for them. If anyone spots any issues,
>>> please let me know, either through this mailing list, the GitHub
>>> repository[2] or the GitLab repository[3]. I'm trying to track all of
>>> these places, and try to resolve all issues people find.
>>>
>>> I plan to also release a 2019.10 version of Rakudo Star before the end
>>> of this year, but whether that's viable depends on the number of
>>> severity of the issues people may find.
>>>
>>> I hope we can continue the Rakudo Star releases on a regular basis in
>>> 2020!
>>>
>>> [1]: https://dist.tyil.nl/raku/rakudo-star/
>>> [2]: https://github.com/rakudo/star
>>> [3]: https://gitlab.com/tyil/rakudo-star/
>>>
>>> --
>>> With kind regards,
>>>
>>> Patrick Spek
>>>
>>>
>>> www:  https://www.tyil.nl/
>>> mail: p.s...@tyil.nl
>>> pgp:  1660 F6A2 DFA7 5347 322A  4DC0 7A6A C285 E2D9 8827
>>>
>>> social: https://soc.fglt.nl/tyil
>>> git:https://gitlab.com/tyil/
>>>
>>
>>
>> --
>> JJ
>>
>


Re: processing a file in chunks

2019-10-22 Thread Parrot Raiser
CatHandle? Is that an alias for "tail"?  :-)*

On 10/22/19, Marcel Timmerman  wrote:
> On 10/22/19 1:05 PM, Marcel Timmerman wrote:
>> On 10/20/19 11:38 PM, Joseph Brenner wrote:
>>> I was just thinking about the case of processing a large file in
>>> chunks of an arbitrary size (where "lines" or "words" don't really
>>> work).   I can think of a few approaches that would seem kind-of
>>> rakuish, but don't seem to be built-in anywhere... something like a
>>> variant of "slurp" with an argument to specify how much you want to
>>> slurp at a time, that'll move on to the next chunk the next time it's
>>> invoked...
>>>
>>> Is there anything like that kicking around that I've missed?
>> as a side note, there is also a .IO.CHandle.readchars($size), with
>> $size a default of 64 kb.
>>
>> Regards,
>> Marcel
>
> I meant  .IO.CatHandle.readchars($size)
> sorry
> M
>


p6doc issue - #2387

2019-08-24 Thread Parrot Raiser
https://github.com/perl6/doc/issues/2387

Coke closed the issue , but for me, "p6doc build" is still broken. It
looks as though whatever was "fixed in HEAD" hasn't made it into
Rakudo*. Could we have details (or at least an issue number) to help
implement the fix, please?


Re: learning resources for perl6 beginner

2019-08-24 Thread Parrot Raiser
Some books:

"Think Perl 6"http://shop.oreilly.com/product/0636920065883.do
"Learning Perl 6"http://shop.oreilly.com/product/0636920062776.do
"Perl 6 At a Glance"   https://perl6.online/perl6-at-a-glance/ (which
Andrew did mention)

On 8/24/19, William Michels via perl6-users  wrote:
> Hi Wesley,
>
> Andy's being modest. In addition to the official Perl6 docs at:
> http://docs.perl6.org (as Andy suggests), Check out his many Perl6
> resources (including videos) at:
>
> https://perl6.online/
> https://perl6.online/contents/
> https://perl6.online/category/talks/
>
> I'm using Andy Shitov's "Perl6 One-Liners" slides to teach myself
> Perl6 on the command-line, as a modern replacement for sed/awk:
>
> https://perl6.online/2019/03/08/perl-6-one-liners-slides/
> https://perl6.online/2018/12/20/using-command-line-options-in-perl-6-one-liners/
> https://perl6.online/2018/12/24/overview-of-the-perl-6-one-liner-advent-calendar-2018/
>
> Also check out David Farrell's "Perl6-One-Liners" Github repo:
>
> https://github.com/dnmfarrell/Perl6-One-Liners#tutorial
>
> Finally, take a look Naoum Hankache's "Perl6Intro" site, and
> associated Github repo. As an added bonus, Naoum's site is available
> in thirteen (13) languages:
>
> https://perl6intro.com
> https://github.com/hankache/perl6intro
>
> This just scratches the surface (apologies to anyone I've overlooked),
>
> HTH, Bill.
>
>
>
> On Sat, Aug 24, 2019 at 4:15 AM Andrew Shitov  wrote:
>>
>> https://perl6.online/perl6-at-a-glance/
>>
>> http://docs.perl6.org
>>
>>
>> On Sat, 24 Aug 2019 at 13:13, Wesley Peng  wrote:
>>>
>>> Hello,
>>>
>>> I am a programmer most time writing code with c/perl 5/ruby.
>>>
>>> I know perl6 is coming to the world, have the interest to take a glance
>>> on it.
>>>
>>> For beginner of perl6, can you suggest some resources including online
>>> documentation or books to get start?
>>>
>>> thanks & regards
>>> Wesley
>>
>> --
>> Andrew Shitov
>> __
>> a...@shitov.ru | http://shitov.ru
>


Re: perl6's new name?

2019-08-12 Thread Parrot Raiser
"5" is a version number of Perl. To run it, $/usr/bin/perl "6" is part
of the name of Perl6.
To run it, $/usr/bin/perl6.

With the production version of Perl incremented by 2 every year, it's
still about 35 years before the version gets to an inconvenient 3
digits. (Will there really be enough worth changing that many times,
and how many of us will still be around to care?)

Energy expended in nominal disputes would be better spent producing
killer apps in some fashionable area (AI, ML, even a web framework),
so that people  don't care what the language is called, they just want
to use it. Ruby applications might be a good place to start, since
that community seems to have fractured, and Perl6 has a lot in common
with Ruby.

On 8/12/19, Richard Hainsworth  wrote:
> 
>>
>> The decision on perl 5 vs perl 6 naming is more revolutionary but it
>> IS hurting
>> Perl.  I love Perl but it has an image problem.
> True. Would a name change now have much effect?
>> If Perl didn't have an image problem,
>> Python never would have become so popular.
> Mmmm.  That is a very strong assertion and diminishes Python and its
> developers. It's the sort of statement that can't easily be tested. More
> a belief.
>>   Perl used to be THE scripting
>> language.
> True. And C was THE programming language. Life moves on. And in circles.
> Fashions come and go, and what was fashionable can again be so.
>>   It doesn't matter that it is still around and still continuing to be
>> developed.
>> What matters is people's PERCEPTIONS of Perl (dead, dieing,
>> irrelevant, etc).
>>
>> Too little was done for too long about Perl's image.  It may be too
>> late to bring it
>> back into the forefront as it used to be.
>
> Being excited about a language and using it for cool things - and
> broadcasting to the world that its cool will do more to change
> perceptions that Perl is cool, than a name change to Camilea.
>
> As you said: Perceptions are the most important thing.
>


Re: Downloading documentation

2019-06-21 Thread Parrot Raiser
Hmm, downloaded to pdf, but at 1730 pages, maybe I'd better rethink
the printing. :-)*


Re: Downloading documentation

2019-06-21 Thread Parrot Raiser
On 6/21/19, Brad Gilbert  wrote:
> The specification is the test suite.

That is true, but as a guide to learning the language, it has its limitations.

> I believe you are asking for downloading the documentation as one file.
> On docs.perl6.org there is a link for viewing the entire thing as a
> single file. https://docs.perl6.org/perl6.html
>

Thank you, that's a start, but I was hoping for a pdf; I actually want
to transfer it to dead trees.


Downloading documentation

2019-06-21 Thread Parrot Raiser
Is there a convenient way to download the Perl 6 specification as one
file, rather than having to download each topic separately?


rakudobug failure

2019-05-13 Thread Parrot Raiser
I tried to report a failure to rakudobug, which generated the
following report from the mailer:
-
---
Date: Fri, 10 May 2019 15:59:32 -0700 (PDT)

** Message not delivered **

Your message couldn't be delivered to rakudo...@perl.org because the
remote server is misconfigured. See technical details below for more
information.

The response from the remote server was:
554 5.7.1 : Recipient address rejected: Access denied
---

Is that a temporary glitch, or has the procedure changed?

After we've dealt with that alligator, I can get back to the swamp. :-)*


Re: lp0

2019-03-11 Thread Parrot Raiser
If an ordinary user tries to write to lp0, this is the result:

$ cat > /dev/lp0
bash: /dev/lp0: Permission denied

Using a large club results in this:

$ su root -c "cat > /dev/lp0"
Password:
more stuff

$ ls -l /dev/lp*
-rw-r--r-- 1 root root 11 Mar 11 11:49 /dev/lp0

$ cat  /dev/lp0
more stuff

i.e. /dev/lp0 has been overwritten.

I'd suggest;
1. Get CUPS to a point where "lpr -p some.txt" prints a date-stamped
some.txt (see man CUPS and man lpr).
2. Get your program printing to STDOUT
3. Pipe to lpr

Handling print queues is the OS' job, not the application's.

On 3/10/19, ToddAndMargo via perl6-users  wrote:
>  >> Hi All,
>  >>
>  >> How do I output data to a printer on /dev/lp0 (LPT1)?
>  >>
>  >> Many thanks,
>  >> -T
>  >>
>
> On 3/10/19 11:28 AM, Parrot Raiser wrote:
>> Do you have the printer set up in CUPS? (Common Unix Printing System.)
>>   See "man cups".
>>
>> Applications shouldn't normally be writing to explicit device IDs.
>>
>> On 3/10/19, ToddAndMargo via perl6-users  wrote:
>
> Hi Parrot,
>
> I mean writing directly to /dev/lp0.
>
> This is my example that does not work as I have a kernel problem
> with lp0 at the moment:
>
> p6 '"/dev/lp0".IO.spurt( "abc"~chr(12) );'
>
> But it would also be nice to know how to write to cups as well
> for my notes.
>
> -T
>


Re: lp0

2019-03-10 Thread Parrot Raiser
Do you have the printer set up in CUPS? (Common Unix Printing System.)
 See "man cups".

Applications shouldn't normally be writing to explicit device IDs.

On 3/10/19, ToddAndMargo via perl6-users  wrote:
> Hi All,
>
> How do I output data to a printer on /dev/lp0 (LPT1)?
>
> Many thanks,
> -T
>


Re: Exactly what is type match?

2018-12-21 Thread Parrot Raiser
> If you get a crash using it, I suspect you made another mistake somewhere.

Possibly a compiler version difference? A perl6 -v output might be
worth including.


Re: Performance of parallel computing.

2018-12-07 Thread Parrot Raiser
Is it possible that OS caching is having an effect on the performance?
It's sometimes necessary to run the same code several times before it
settles down to consistent results.

On 12/7/18, Vadim Belman  wrote:
> There is not need for filling in the channel prior to starting workers.
> First of all, 100 repetitions of SHA256 per worker makes takes ~0.7sec on my
> system. I didn't do benchmarking of the generator thread, but considering
> that even your timing gives 0.054sec/per string – I will most definitely
> remain fast enough to provide all workers with data. But even with this in
> mind I re-run the test with only 100 characters long strings being
> generated. Here is what I've got:
>
> Benchmark:
> Timing 1 iterations of workers1, workers10, workers15, workers2, workers3,
> workers5...
>   workers1: 22.473 wallclock secs (22.609 usr 0.231 sys 22.840 cpu) @
> 0.044/s (n=1)
>   (warning: too few iterations for a reliable count)
>  workers10: 6.154 wallclock secs (44.087 usr 11.149 sys 55.236 cpu) @
> 0.162/s (n=1)
>   (warning: too few iterations for a reliable count)
>  workers15: 6.165 wallclock secs (50.206 usr 9.540 sys 59.745 cpu) @ 0.162/s
> (n=1)
>   (warning: too few iterations for a reliable count)
>   workers2: 14.102 wallclock secs (26.524 usr 0.618 sys 27.142 cpu) @
> 0.071/s (n=1)
>   (warning: too few iterations for a reliable count)
>   workers3: 10.553 wallclock secs (27.808 usr 1.404 sys 29.213 cpu) @
> 0.095/s (n=1)
>   (warning: too few iterations for a reliable count)
>   workers5: 7.650 wallclock secs (31.099 usr 3.803 sys 34.902 cpu) @ 0.131/s
> (n=1)
>   (warning: too few iterations for a reliable count)
> O---O--O--O---O--O---O--O--O
> |   | s/iter   | workers3 | workers15 | workers5 | workers10 |
> workers2 | workers1 |
> O===O==O==O===O==O===O==O==O
> | workers3  | 10553022 | --   | -42%  | -28% | -42%  | 34%
>| 113% |
> | workers15 | 6165235  | 71%  | --| 24%  | -0%   | 129%
>| 265% |
> | workers5  | 7650413  | 38%  | -19%  | --   | -20%  | 84%
>| 194% |
> | workers10 | 6154300  | 71%  | 0%| 24%  | --| 129%
>| 265% |
> | workers2  | 14101512 | -25% | -56%  | -46% | -56%  | --
>| 59%  |
> | workers1  | 22473185 | -53% | -73%  | -66% | -73%  | -37%
>| --   |
> 
>
> What's more important is the observation for the CPU consumption by the moar
> process. Depending on the number of workers I was getting numbers from 100%
> load for a single one up to 1000% for the whole bunch of 15. This perfectly
> corresponds with 6 cores/2 threads per core of my CPU.
>
>> On Dec 7, 2018, at 02:06, yary  wrote:
>>
>> That was a bit vague- meant that I suspect the workers are being
>> starved, since you have many consumers, and only a single thread
>> generating the 1k strings. I would prime the channel to be  full - or
>> other restructuring the ensure all threads are kept busy.
>>
>> -y
>>
>> On Thu, Dec 6, 2018 at 10:56 PM yary  wrote:
>>>
>>> Not sure if your test is measuring what you expect- the setup of
>>> generating 50 x 1k strings is taking 2.7sec on my laptop, and that's
>>> reducing the apparent effect of parllelism.
>>>
>>> $ perl6
>>> To exit type 'exit' or '^D'
 my $c = Channel.new;
>>> Channel.new
 { for 1..50 {$c.send((1..1024).map( { (' '..'Z').pick } ).join);}; say
 now - ENTER now; }
>>> 2.7289092
>>>
>>> I'd move the setup outside the "cmpthese" and try again, re-think the
>>> new results.
>>>
>>>
>>>
>>> On 12/6/18, Vadim Belman  wrote:
 Hi everybody!

 I have recently played a bit with somewhat intense computations and
 tried to
 parallelize them among a couple of threaded workers. The results were
 somewhat... eh... discouraging. To sum up my findings I wrote a simple
 demo
 benchmark:

 use Digest::SHA;
 use Bench;

 sub worker ( Str:D $str ) {
 my $digest = $str;

 for 1..100 {
 $digest = sha256 $digest;
 }
 }

 sub run ( Int $workers ) {
 my $c = Channel.new;

 my @w;
 @w.push: start {
 for 1..50 {
 $c.send(
 (1..1024).map( { (' '..'Z').pick } ).join
 );
 }
 LEAVE $c.close;
 }

 for 1..$workers {
 @w.push: start {
 react {
 whenever $c -> $str {
 worker( $str );
 }
 }

Re: More efficient of two coding styles?

2018-11-17 Thread Parrot Raiser
On 11/15/18, Richard Hainsworth  wrote:

> There are two styles in Perl 6 to code this and my question is whether
> one is more efficient (speed/memory) than the other.
>
First, define efficiency.
Which is cheaper, computer time or programmer time?
Is whatever is being considered a constraint of any kind, or is it fast enough?

We can use interpreted scripts to cat files, because the display takes
so much more time than the interpretation, while graphics operations
have to run so fast, so often,, they require C compiled for special
processors.


Error in p6doc build

2018-10-16 Thread Parrot Raiser
Attempting to build the P6doc index produced the following result:
-
$ p6doc build
Too many positionals passed; expected 1 argument but got 2
  in sub build_index at
/home/guru/rakudo/rakudo-star-2018.06/install/share/perl6/site/resources/C8DD97308D226DDE4AA60EA017CB6BB59F9AA625
line 193
  in sub MAIN at
/home/guru/rakudo/rakudo-star-2018.06/install/share/perl6/site/resources/C8DD97308D226DDE4AA60EA017CB6BB59F9AA625
line 163
  in block  at
/home/guru/rakudo/rakudo-star-2018.06/install/share/perl6/site/resources/C8DD97308D226DDE4AA60EA017CB6BB59F9AA625
line 316
  in sub MAIN at
/home/guru/rakudo/rakudo-star-2018.06/install/share/perl6/site/bin/p6doc
line 2
  in block  at
/home/guru/rakudo/rakudo-star-2018.06/install/share/perl6/site/bin/p6doc
line 2

$ uname -a
Linux localhost 4.14.70-desktop-2.mga6 #1 SMP Thu Sep 20 22:05:46 UTC
2018 x86_64 x86_64 x86_64 GNU/Linux

[]$ perl6 -v
This is Rakudo Star version 2018.06 built on MoarVM version 2018.06
implementing Perl 6.c.

(BTW, it appears that perl-all no longer works. I sent this message
there, and saw nothing.)


Re: words[] question

2018-09-26 Thread Parrot Raiser
Would it be correct to say:
 [ ] aka square brackets, always surround the subscript of an array or
list, i.e. here "n: is an integer,  [n] always means the nth item,
while
( ), round brackets or parentheses, separate and group items to
control processing order, and identify subroutine calls, surrounding
the argument list, if any?

On 9/26/18, Brian Duggan  wrote:
> On Tuesday, September 25, Todd Chester wrote:
>> Not to ask too obvious a question, but why does words use a []
>> instead of a () ?
>> ...
>> I am confused as to when to use [] and when to use () with a method.
>
> If a method is called without arguments, the () can be omitted.
>
>"a man a plan a canal -- panama".words()
>"a man a plan a canal -- panama".words# <-- same thing
>
> [] acts on the return value -- it takes an element of a list
>
>"a man a plan a canal -- panama".words()[3]
>"a man a plan a canal -- panama".words[3]  # <-- same thing
>
> Brian
>


Re: Installing Perl6 on shared server

2018-09-26 Thread Parrot Raiser
P.S. By today's standards, that's a pretty chintzy service; are their
limits aimed at IoT thingies?


Re: Installing Perl6 on shared server

2018-09-26 Thread Parrot Raiser
> I'm not sure which of these is limiting the compilation of rakudo.

2 out of 3 ain’t bad?  :-(


Unfortunately, they're && not ||. :-)*

On 9/26/18, Elizabeth Mattijsen  wrote:
>> On 26 Sep 2018, at 06:03, Richard Hainsworth 
>> wrote:
>>
>> Further to this question. Support staff at hosting company just informed
>> me that for the plan I have at present, the following limits are in
>> place:
>>
>> 60 seconds CPU execution time per process
>
> Build time on my MBP is around 75 seconds on my MBP.
>
>
>> 195MB of RAM per process
>
> Building rakudo *at the moment* takes about 1.2G of RAM.  This is about to
> get a whole lot less, but no where near 195MB.
>
>
>> 20 simultaneous processes
>
> That should be ok.
>
>
>> I'm not sure which of these is limiting the compilation of rakudo.
>
> 2 out of 3 ain’t bad?  :-(
>
>
> Liz


Fwd: escape codes

2018-09-16 Thread Parrot Raiser
-- Forwarded message --
From: Parrot Raiser <1parr...@gmail.com>
Date: Sun, 16 Sep 2018 09:41:44 -0400
Subject: Re: escape codes
To: ToddAndMargo 

Those (\t & \n) aren't "escape characters", (though the \ is an
escape, so you might classify t & n a "escaped").

I think the term you're looking for is "whitespace" characters.
Although this https://perldoc.perl.org/perlglossary.html#whitespace is
from the Perl 5 docs, it should still work.


Re: ->

2018-09-14 Thread Parrot Raiser
On 9/14/18, Brandon Allbery  wrote:
> And then you discover <->.
>

Elbows?


Re: ->

2018-09-14 Thread Parrot Raiser
Obviously, discussions about "->" will be easier if it has a name. How
about "lance", or, if you want to be less martial, "poker'?


Re: .new?

2018-09-14 Thread Parrot Raiser
> Do a search for objects.

What do you mean?

Into you favourite search engine, e.g. duckduckgo, type perl6 objects


Re: how do I do this index in p6?

2018-09-12 Thread Parrot Raiser
Neat. The answer's round about right.

On 9/12/18, Fernando Santagata  wrote:
> Patched :-)
> say (e**(i*pi)+1).round(10⁻¹²)
>
> On Wed, Sep 12, 2018 at 4:28 PM Parrot Raiser <1parr...@gmail.com> wrote:
>
>> Just for giggles, say e**(i*pi) + 1 prints 0+1.2246467991473532e-16i
>> which isn't exactly right, but close enough for government work.
>>  (You could call it really right, the error is imaginary. :-)* )
>>
>>
>> On 9/12/18, Parrot Raiser <1parr...@gmail.com> wrote:
>> > Built-in constants:
>> > pi, tau, e, i
>> >
>> > perl6 -e  'say pi ~ "  " ~ tau ~ "   " ~ e ~ "  " ~ i';
>> >
>> > 3.141592653589793  6.283185307179586  2.718281828459045  0+1i
>> > (tau is 2pi, useful if you want to calculate the circumference of your
>> > tuits.
>> > Pi and tau can also be accessed as the Unicode characters.
>> >
>> > User-defined
>> > constant answer = 42;
>> >
>> > Scope is lexical:
>> > constant where = "outer";
>> > say where; {
>> > constant where = "inner";
>> > say where;
>> > }
>> > say where;
>> >
>>
>
>
> --
> Fernando Santagata
>


Re: A comparison between P5 docs and p6 docs

2018-09-11 Thread Parrot Raiser
One of the paradoxes of documentation, and the teaching of many
abstract topics, is that those with the most in-depth knowledge of the
topic,are the least suitable to explain it,  precisely because of that
knowledge. They can't remember what it felt like not to know
something, and they've usually learnt a
jargon to simplify and speed discussions. That has to be filtered
through 2 or 3 layers of ignorance before it's diluted to
comprehensibility. If you don't know what you don't know, it's hard to
plot a route to mastery. (On the other hand, more than one expert has
said something like "the best way to learn a topic is to teach a
course in it".)

In wanders the noob, and s/he is surrounded by weird words, some
utterly new, which may or may not have their usual meanings if they
aren't. It's hard to start exploring Wonderland when you don't even
know how to ask the way to the rabbit hole.

My impression of the Perl 6 documentation is that it was written by
the designers and implementors, for their needs, a by-product of the
development process. Since it's at the intersection of linguistics and
computer science, the terminology tends to be a blend of both,
seasoned with a pinch of local dialect. It's designed to answer
questions like "what category of language is it?", "what programming
paradigms does it favour?", "how is [some feature] designed?". For
someone constructing a taxonomy of computer languages, or looking for
interesting compiler techniques, it's great. That doesn't help the
(English major) beginner who wants to find and fix incorrectly cased
names  in a file, or extract some data.

It's also like the Unix documentation, an example-free zone. That
assumes that the reader is skilled in converting abstract categories
into explanatory examples for themselves, possibly one of the
fundamental skills of programming.  (It's much more natural to learn
an abstract principle for re-use by having it explained through a
concrete example.)

I'm still trying to map a path into the jungle from practical daily
treks, and it takes ruthless pruning of the language's features to
avoid diversions and use of as-yet-unexplained features.  (P5 can be
tricky that way, too, but there's not as much to hide behind the
curtain.) Trainee sales droids are taught not to mention "features",
unless they can explain at least 2 "benefits" to the mark, (sorry,
"prospect").  I'm going to start out with 5 ways to produce valid P6
that does absolutely nothing, and proceed from there. It'll be
interesting to see if that approach works.

(Apologies to Tom Browder for duplication; I had to edit the start of
the message to make sense )


Re: Introducing P6 into a P5 user environment

2018-09-06 Thread Parrot Raiser
As an exercise, I'm porting some small coding utilities written in P5
to P6, and it's interesting how much less code is required, even using
what I suspect will seem embarrassingly naive P6 code in a little
while.

On 9/5/18, Vadim Belman  wrote:
> Let me correct you in one aspect. It's not my company which is using Perl.
> It's me. My department is nothing about programming but VoIP and whatever
> else around it. Use of Perl for supportive tasks is my own choice. Yet,
> mixing of languages is definitely something I'm trying to avoid at least in
> one single project. Though it's yet to be seen how would things turn out to
> be in the future.
>
> So far, I'm a bad example for this kind of transition...
>
>> 5 вер. 2018 р. о 10:50 Ralph Mellor 
>> написав(ла):
>>
>> My last post in response to Vadim's recent post.
>>
>> Vadim is one of those exploring introduction of P6 in a company that makes
>> significant use of P5.
>>
>> > I have a work project on my hands which I wanna implement in Perl6. Yet,
>> > I have an internal framework for such projects written in Perl 5.
>>
>> I wanted to write a bit about what I think the likely short and long term
>> reaction of the community will be to your efforts.
>>
>> I would expect the sort of environment you describe to (continue to) be
>> one of the most important P6 use cases for years to come. While it looks
>> like we can not afford to tie P6 to P5, the flip side is that we also
>> can't forget that this scenario was the primary launching point for P6 and
>> that a natural setting in coming decades will be alongside P5.
>>
>> And this should essentially be a showcase scenario. P6 coding in the
>> context of P5 heritage and code bases is very much a sweet spot in terms
>> of a likely pool of early adopters and also the initial testing ground for
>> P6's ambitious polyglot (mixed language) strategy.
>>
>> 
>>
>> The current P6 community make up reflects the contemporary importance and
>> influence of P5. In a recent survey exposed mostly in P6 focused fora, 75%
>> of respondents said they have "used Perl 5 extensively before finding out
>> Perl 6".
>> (https://docs.google.com/forms/d/e/1FAIpQLSdqrrcxTQWuN1ISAvz3j_XkpCCc2AuQw9uKgAhTivxHBFsweg/viewanalytics
>> )
>>
>> Anecdotally speaking, attitudes among P6 folk toward P5 vary but are
>> generally at least respectful.
>>
>> One example is Zoffix. He's an important driver of P6. He wants P6 free of
>> any drag from P5. But it's noteworthy that he still sometimes uses P5 to
>> get stuff done. (Sometimes mixed with P6, eg
>> https://perl6.party/post/IRC-Client-Perl-6-Multi-Server-IRC-Module#dontwaitup
>> )
>>
>> Liz, another important driver, is ultimately motivated by the desire to
>> sustain and invigorate P6 long enough to do likewise for the overall Perl
>> community in coming decades. The P5 legacy and its future is as central to
>> her vision as P6.
>>
>> In summary, I believe that if you keep a positive, practical and
>> persistent (multi year) focus on bringing P6 into the mix with a P5
>> environment, P6 leaders will or at least should have your back.
>>
>> I'm curious to hear whether this is of interest to you or others.
>>
>> --
>> raiph
>
> Best regards,
> Vadim Belman
>
>


Re: Appropriate last words

2018-09-04 Thread Parrot Raiser
exit note "message";
seems to work well as a substitute. "note" outputs the message, and
exit sends the return code (1) to the OS, marking a failure.


Re: Appropriate last words

2018-09-03 Thread Parrot Raiser
If I understand that correctly, "die" needs to be documented as always
outputting the line number, and that for user-oriented messages, one
of the other techniques should be used.

Otherwise, this question is likely to come up a lot.


Re: Handing over control

2018-09-03 Thread Parrot Raiser
But this:

perl6 -e 'shell("vim sample"); exit'

behaves acceptably.

On 9/3/18, Parrot Raiser <1parr...@gmail.com> wrote:
> Is Windows really that brain-dead? Pity it has to sabotage everyone else.
>
> This invokes vim successfully, but leaves an ugly error message around:
>
> perl6 -e 'exit shell("vim sample")'
> No such method 'Int' for invocant of type 'Proc'
>   in block  at -e line 1
>
>
> On 9/3/18, Brandon Allbery  wrote:
>> It's not basic: Windows doesn't have it at all, it has to be simulated.
>> The
>> intent is that system dependent things like that should be external to
>> the
>> core.
>>
>> On Mon, Sep 3, 2018 at 12:56 PM Parrot Raiser <1parr...@gmail.com> wrote:
>>
>>> Thanks for the reply.  That didn't show up with any search string I
>>> could contrive.
>>> It's disappointing to lose a basic ability like handing over control
>>> to another program.
>>>
>>> On 9/3/18, Elizabeth Mattijsen  wrote:
>>> > https://docs.perl6.org/language/5to6-perlfunc#exec
>>> >
>>> >> On 3 Sep 2018, at 18:41, Parrot Raiser <1parr...@gmail.com> wrote:
>>> >>
>>> >> In Perl 5, a program can hand over control to another with exec:
>>> >> https://perldoc.perl.org/functions/exec.html
>>> >> e.g  perl -e 'exec vim'  opens up vim
>>> >>
>>> >> What's the Perl 6 equivalent?
>>> >
>>>
>>
>>
>> --
>> brandon s allbery kf8nh
>> allber...@gmail.com
>>
>


Re: Handing over control

2018-09-03 Thread Parrot Raiser
Is Windows really that brain-dead? Pity it has to sabotage everyone else.

This invokes vim successfully, but leaves an ugly error message around:

perl6 -e 'exit shell("vim sample")'
No such method 'Int' for invocant of type 'Proc'
  in block  at -e line 1


On 9/3/18, Brandon Allbery  wrote:
> It's not basic: Windows doesn't have it at all, it has to be simulated. The
> intent is that system dependent things like that should be external to the
> core.
>
> On Mon, Sep 3, 2018 at 12:56 PM Parrot Raiser <1parr...@gmail.com> wrote:
>
>> Thanks for the reply.  That didn't show up with any search string I
>> could contrive.
>> It's disappointing to lose a basic ability like handing over control
>> to another program.
>>
>> On 9/3/18, Elizabeth Mattijsen  wrote:
>> > https://docs.perl6.org/language/5to6-perlfunc#exec
>> >
>> >> On 3 Sep 2018, at 18:41, Parrot Raiser <1parr...@gmail.com> wrote:
>> >>
>> >> In Perl 5, a program can hand over control to another with exec:
>> >> https://perldoc.perl.org/functions/exec.html
>> >> e.g  perl -e 'exec vim'  opens up vim
>> >>
>> >> What's the Perl 6 equivalent?
>> >
>>
>
>
> --
> brandon s allbery kf8nh
> allber...@gmail.com
>


Re: Handing over control

2018-09-03 Thread Parrot Raiser
Thanks for the reply.  That didn't show up with any search string I
could contrive.
It's disappointing to lose a basic ability like handing over control
to another program.

On 9/3/18, Elizabeth Mattijsen  wrote:
> https://docs.perl6.org/language/5to6-perlfunc#exec
>
>> On 3 Sep 2018, at 18:41, Parrot Raiser <1parr...@gmail.com> wrote:
>>
>> In Perl 5, a program can hand over control to another with exec:
>> https://perldoc.perl.org/functions/exec.html
>> e.g  perl -e 'exec vim'  opens up vim
>>
>> What's the Perl 6 equivalent?
>


Handing over control

2018-09-03 Thread Parrot Raiser
In Perl 5, a program can hand over control to another with exec:
https://perldoc.perl.org/functions/exec.html
e.g  perl -e 'exec vim'  opens up vim

What's the Perl 6 equivalent?


Appropriate last words

2018-09-03 Thread Parrot Raiser
perl6 -v
This is Rakudo Star version 2018.06 built on MoarVM version 2018.06
implementing Perl 6.c.

In Perl 5:
die "Message";   outputs Message, followed by the program line number.
die "Message\n" outputs Message
without further ado.

Perl 6 "die" produces line numbers regardless of the line ending.

$ perl6 -e 'die "message";'
message
  in block  at -e line 1

$perl6 -e 'die "message\n";'
message

  in block  at -e line 1

What's the Perl 6 equivalent for line number suppression?
https://docs.perl6.org/routine/die is silent on the topic.


Re: Introspection

2018-08-29 Thread Parrot Raiser
Thanks. That's exactly what I wanted.

On 8/29/18, Fernando Santagata  wrote:
> That's documented here:
>
> https://docs.perl6.org/language/variables#&?ROUTINE
>
> On Wed, Aug 29, 2018 at 5:51 PM Parrot Raiser <1parr...@gmail.com> wrote:
>
>> Could someone supply a link to a clear example of a Perl 6 subroutine
>> finding its own name, please?
>> I know there's a method, but haven't managed to produce an effective
>> search string for an example of its use.
>>
>
>
> --
> Fernando Santagata
>


Introspection

2018-08-29 Thread Parrot Raiser
Could someone supply a link to a clear example of a Perl 6 subroutine
finding its own name, please?
I know there's a method, but haven't managed to produce an effective
search string for an example of its use.


Re: OT: catch the bash error?

2018-08-05 Thread Parrot Raiser
That's the problem with using multiple related-but-not-identical
languages. If you aren't completely on the ball, one of the others may
grab you by the ankle and trip you.

On 8/5/18, ToddAndMargo  wrote:
>>> It is "do G=" not "do $G="
>>>
>>>
>
> On 08/04/2018 01:14 AM, Laurent Rosenfeld via perl6-users wrote:
>> I'm really not very good at bash scripting (because I would almost
>> always to such things in Perl), but I guess that the initial $G is an
>> error (there should not be a $ sigil).
>
> That was it.  Perl has got me so trained that I did not even
> realize my mistake for quite some time.
>
> Chuckle
>


Re: need regex help

2018-08-03 Thread Parrot Raiser
If I've interpreted this
https://docs.perl6.org/language/regexes#Enumerated_character_classes_and_ranges
correctly,

^ is "start of string"
+alnum means "in the alphanumeric set"
-alpha   means "not in the purely alphabetic set"
i.e. <+alnum -alpha> means "alphanumeric but not a letter", i.e 0-9_
+ is "one or more of the preceding set"
$ is "end of string"

On 8/3/18, ToddAndMargo  wrote:
> On 08/02/2018 05:18 AM, Timo Paulssen wrote:
>> Is this what you want?
>>
>> perl6 -e 'say "12345" ~~ /^<+alnum -alpha>+$/'
>> 「12345」
>>
>> perl6 -e 'say "123a45" ~~ /^<+alnum -alpha>+$/'
>> Nil
>>
>> HTH
>>    - Timo
>>
>
> What does the following do?
>
>   +alnum   (why does it need the "+"?)
>   -alpha   (I presume "-" means negate?)
>   +$
>
> Many thanks,
> -T
>


Re: odd and even

2018-05-01 Thread Parrot Raiser
The result of a modulus-2 is always going to be 0 or 1, so if you can
put the "even" and "odd" results in a 2 -element array, using it as a
subscript would be a way to achieve the outcome.

On 5/1/18, ToddAndMargo  wrote:
> On 04/30/2018 06:47 AM, Elizabeth Mattijsen wrote:
>
>> Perhaps this is a simpler solution:
>>
>>  for split( "\n", $ClipStr ) -> $evenline, $oddline? {
>>  say “Purple $evenline”;
>>  say “Green $_” with $oddline;
>>  }
>
> Two lines at a time.  Fascinating!   Thank you!
>


Re: Perl 6: Protecting Intellectual Property for Commercial Code

2017-10-23 Thread Parrot Raiser
Frankly, if you're worried about this sort of thing, you have too much
faith in "secret sauces", and not enough in understanding situations
thoroughly. Code is trivial, implementation isn't.

Back in the days of dBase II, I was a contractor for one ministry of
the local government. They asked me to write a little system to do a
particular job   (As much an experiment to see if these new "desktop
computers" were useful tools or just cute toys as for the actual
outcome.) It was clearly applicable to other branches, so I made it
appropriately generalisable from the start.

Some of the other ministries contracted me to adapt the
government-owned code for them.  I had a lot less cleaning up to do
where they said "Please install it for us" than when managers had
hijacked the code and tried to implement it as their own creation.

On 10/23/17, Shlomi Fish  wrote:
> Hi Mark,
>
> On Sun, 22 Oct 2017 22:37:31 +
> Mark Devine  wrote:
>
>> Perl 6 Users,
>>
>> [[ Bouncing off Re: who own my code? ]]
>>
>> This is the first of several possible spin-off questions, but here goes…
>>
>> Perl 6 has its public ecosystem, which will drive growth and adoption.
>> Then
>> there’s the commercial side, which would also drive the language from
>> another
>> important angle.  I believe in a balance of public sharing and private
>> enterprise.
>>
>> I am interested in packaging some of my long-term Perl 6
>> projects/scripts/apps/frameworks into some kind of relocatable object
>> form
>> (binary) that cannot be easily altered or trivially reverse engineered.
>> Put
>> another way, I sometimes would prefer not to sell source code to my
>> customers, but rather some form of compiled package that can’t easily be
>> diddled by a SysAdmin.  If I create code for a particular commercial
>> domain
>> over years, then I want to get compensated for it and not have it be
>> diluted
>> with copy-cats one week after I release it.  Certainly some of the
>> generic
>> libraries that I create in the future can be modularized for the Perl 6
>> ecosystem and I’ll push those eventually, but the really specialized
>> domain-specific code that fills a commercial void & that I will commit
>> years
>> to maintaining, I’d like to offer a commercial license, key-protect, sell
>> subscriptions, etc.
>>
>> Again, I’m very interested in contributing to the ecosystem when possible.
>>  I
>> still need to grow past baby/teenager Perl 6, and I’ll get there soon.
>> But
>> after creating something targeted only for customer
>> purchase/subscription,
>> what tools are available in the Perl 6 toolbox?  I saw something for the
>> Java
>> back-end (to .jar), but not much else.
>>
>> Is there a Perl 6 roadmap that might mention compiling Perl 6
>> modules/scripts
>> into something atomic, binary, & relocatable?  Or preferably the
>> capability
>> to compile only specific Perl 6 modules, requiring an existing Perl 6 on
>> the
>> target host?
>>
>
> Please see
> https://github.com/shlomif/Freenode-programming-channel-FAQ/blob/master/FAQ.mdwn#how-do-i-hideobscureencrypt-my-source-code-to-prevent-end-users-from-learning-how-it-works
> .
>
> Regarding "Intellectual Property", see
> https://www.linux.com/news/why-term-intellectual-property-seductive-mirage
> and
> http://ericsink.com/articles/Intellectual_Property.html .
>
> --
> -
> Shlomi Fish   http://www.shlomifish.org/
> Best Introductory Programming Language - http://shlom.in/intro-lang
>
> I’m worser at superlatives.
> And I don’t ever use no double negatives.
> — James at War, “Bad Grammar”:
> http://www.youtube.com/watch?v=Mj6QqCH7g0Q
>
> Please reply to list if it's a mailing list post - http://shlom.in/reply .
>


Re: who own my code?

2017-10-23 Thread Parrot Raiser
I agree that this is really not the appropriate forum for this. Type a
question like "if I write the same code for several clients, who owns
it?" into a search engine, and you'll get a plethora of links.

In this case, I would say the fairest thing is to write the sharable
portion once on your own time, then charge all the clients the same
for the core and time-and-materials for the tailoring.

On 10/23/17, Jan Ingvoldstad  wrote:
> On Sun, Oct 22, 2017 at 10:32 PM, Brandon Allbery 
> wrote:
>> This is still best discussed elsewhere... isn't there a stackexchange for
>> this kind of stuff?
>
> Ah, Stack Exchange, the quality site where the _first_ answer is the
> most significant.
>
> Anything else is better than asking people to go there for help.
>
> 
> --
> Jan
>


Re: Any way to get hashes to loop in order?

2017-09-30 Thread Parrot Raiser
Prepending the real key value with an order indicator, then sorting
the retrieved list on the key would achieve that, (though the maximum
number size would have to be known in advance.

E.g. 001First_key => data1, 002Second => data2


Re: -f ???

2017-09-29 Thread Parrot Raiser
>> In other words, I think we should change the Perl 6 spec to define .f as 
>> "exists and is a file".
>>
>> --
>>   Mark Montague

Mark and I appear to be having a vigorous agreement about the
principle of Least Surprise.

If -f X is defined as meaning "X exists and is a  file", then
obviously if it doesn't exist the first part of the "and" fails so
there's no reason to check the second. Conformity to the general
behaviour is the most desirable. Anything else would merely annoy
people whose expectations had been violated and generate unwanted FAQs
all over the Web.


Re: -f ???

2017-09-29 Thread Parrot Raiser
Discussing the full implications of these tests could probably keep a
philosophy class busy for an afternnon. It might even rise to an
LPU[1] paper.

-e is fairly easy. It asks if something exists. Ignoring Schrodinger,
either it does (i.e True) or it doesn't. (False)
-f is more ambiguous. It asks if something has a property (fileness)
or not. If it exists, it either does or doesn't.
If it doesn't exist, it certainly can't possess the required property,
but can it be said "not" to possess that property? Anybody know any
convenient Buddhists?

Summarised:   Exists  Has Desired Property Response
  Yes   Yes True
  Yes   No   False
   NoN/A?   ??

Bash appears to err on the pragmatic side, returning "fail" for both
-e and -f on a non-existent
file. After all, we usually only want to proceed if the thing exists
&& is what we want. It would probably be least confusing to default to
the same behaviour, but perhaps returning different kinds of "False"?

[1] Least Publishable Unit

On 9/29/17, Timo Paulssen  wrote:
>> This sounds broken, actually; I understand that a Failure treated as > a
>> Bool prevented it from throwing, so it should have simply returned
>> False. > > Checking it for .defined *does* prevent throwing. Still
> seems like a > bug.
> It doesn't get "treated as a Bool"; any Failure makes it through a
> return typecheck as if it were the right type, that's why you can "fail"
> in a method that has its return type set to be "Int", even though
> Failure doesn't derive from Int. So we don't have to go around giving
> every single method a return type like "Any where { Failure | Int }".
>
> I see .f as "is it a file". "Is /blahblah a file? Oops! I can't check
> that, because /blahblah doesn't exist". It's a different use case from
> "does it exist". You'd likely want to have something more like
>
>     my $file = "/home/linuxutil/erasxeme.txt".IO; say $file.e &&
> $file.f.Bool;
>
> i.e. first check if it exists, then check if it's actually a file.
> Though something could have deleted the file between checking if it
> exists and whether it's a file or not, that's why i'm putting a .Bool
> after the .f check, too.
>
> hope that makes sense
>   - Timo
>


Re: user and group of a file?

2017-09-26 Thread Parrot Raiser
This is the capability provided by Perl 5's "stat". Would a clone with
the same properties and behaviours be the right thing, or are there
"features" to fix?

On 9/26/17, Brandon Allbery  wrote:
> On Tue, Sep 26, 2017 at 2:11 AM, ToddAndMargo 
> wrote:
>
>> Does Perl 6 have one of those fancy subs that will tell me
>> the user and group association of a file?  Or do I just
>> make a system call to "ls"?
>>
>
> At the moment you'll have to use ls. There's an ecosystem want out for a
> POSIX support module with this functionality; the core sticks to portable
> operations, and user and group information is different on Windows
> (notably: the ownership information is SIDs / UUIDs, and it's not so much
> like Unix groups defined by its members as it is an ACL defined by logical
> operations).
>
> --
> brandon s allbery kf8nh   sine nomine
> associates
> allber...@gmail.com
> ballb...@sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>


Re: Need a second pair of eyes

2017-09-25 Thread Parrot Raiser
ToddAndMargo might save some time by asking "Is this a problem someone
else might have solved, and if so, how?" before plunging ahead and
coding. From this and previous postings, it looks as though the answer
might frequently start with "Yes", and would save a lot of redundant
effort.


Re: overwrite?

2017-09-25 Thread Parrot Raiser
Have you considered simply "touch"ing the file? That updates the timestamp.


Re: Suggestions on Learning Perl 6

2017-08-08 Thread Parrot Raiser
> On Aug 7, 2017, at 12:39 PM, Ari King 
>> wrote:
> —snip--
>> I'm particularly interested in learning about Perl 6 package and module
>> development (i.e. code organization),
> —snip—

There are a fair number of talks on YouTube by various P6 luminaries,
including JW.


Re: set (+) set = bag ?

2017-07-30 Thread Parrot Raiser
I'm tempted to ask how to classify "Yes, sir, no, sir, 3 bags full".
Does the constitute a Boolean, numeric, or set operation, or some
combination thereof? :-)*

On 7/21/17, Darren Duncan  wrote:
> On 2017-07-21 1:33 PM, Elizabeth Mattijsen wrote:
>>> On 21 Jul 2017, at 21:30, Darren Duncan  wrote:
>>> Firstly, I believe ∆ (U+2206) is the standard symbol for symmetric
>>> difference, and not circled minus as the above url currently gives.
>>
>> https://en.wikipedia.org/wiki/Symmetric_difference seems to agree, showing
>> it as the first choice.  However, ⊖ appears to be the second choice.
>> FWIW, I think ∆ better matches the Texas variant (^) .
>
> The circled plus is also overloaded for XOR (which itself has at least 2
> more-preferred alternatives) and other things, while ∆ (U+2206) isn't AFAIK
>
> overloaded for anything and in any event ∆ (U+2206) is much more consistent
> with
> all the other standard set/bag operators in format and it is what the
> literature
> prefers to use.
>
> What you say about (^) Texas version isn't a similarity I thought about, but
>
> then that gives my proposal extra support if anything.
>
> The circled plus should be dropped from use for this meaning.
>
>>> Secondly, I see there's an operator for multiplying 2 bags (which I
>>> hadn't heard of before, but okay), but there should also be an operator
>>> for multiplying 1 bag by a natural number, that is a scalar multiply of a
>>> bag.  Unless it is assumed the standard hyper-operator syntax is best for
>>> this.
>>
>> If I get this right, you’d want:
>>
>>   .Bag * 3 give (:3a,:6b).Bag ?
>>
>> I guess that with * being commutative, 3 * .Bag would be the same
>> result.
>
> You are correct in all points above.
>
>> But then, what would .Bag * .Bag be?
>
> I would suggest that this option is either undefined or it has the same
> meaning
> as the bag multiplication operator, eg, (:2a,:2b).Bag.
>
> Another way of looking at this is, say if we're starting with the existing
> bag
> circled-times bag operator, replacing one bag operand with a number N is
> like
> replacing it with what is conceptually an infinite-cardinality bag having
> :Ne
> for "e" in turn being every possible value in the type system; the infinite
> bag
> reduces to one having only matching unique members and replicates those
> matches
> by a cardinality of N.
>
> -- Darren Duncan
>


Re: Perl6 shell, Was: command auto-completion in perl6 shell

2017-05-31 Thread Parrot Raiser
> Do you have something specific in mind?

I don't know enough about the internals to have any particular suggestions.

Keeping functions properly local is just one of those "motherhood and
apple pie" principles that is much easier to follow if it is done
consistently from the start.


  1   2   >