Re: Why does .new initialize?

2021-07-19 Thread Peter Scott
Yes.  I'm agnostic on this point, but there was a time when some 
prominent Perl contributors were dogmatic about it and I didn't know how 
widespread it was.


Peter

On 7/19/2021 10:06 AM, Vadim Belman wrote:


Let me guess. The school prohibits object self-initialization? It has 
to be done by external code?


Best regards,
Vadim Belman

On Jul 19, 2021, at 1:00 PM, Peter Scott <mailto:pe...@psdt.com>> wrote:


On 7/19/2021 1:24 AM, Elizabeth Mattijsen wrote:
If .new wouldn't initialize a type to its basic instantiation, what 
would be the point of .new then?


FWIW, the same goes for:

dd Int.new;  # 0
dd Num.new;  # 0e0
dd Complex.new;  # <0+0i>
dd Str.new;  # ""

If you want to leave it undefined, don't call .new on it?

*confused*


Only that there's a vocal school of thought in O-O that says new() 
should only allocate memory and never put anything in there.  Now I 
know that Raku doesn't subscribe to that I have no problem.


Cheers,
Peter






Re: Why does .new initialize?

2021-07-19 Thread Peter Scott

On 7/19/2021 1:24 AM, Elizabeth Mattijsen wrote:

If .new wouldn't initialize a type to its basic instantiation, what would be 
the point of .new then?

FWIW, the same goes for:

 dd Int.new;  # 0
 dd Num.new;  # 0e0
 dd Complex.new;  # <0+0i>
 dd Str.new;  # ""

If you want to leave it undefined, don't call .new on it?

*confused*


Only that there's a vocal school of thought in O-O that says new() 
should only allocate memory and never put anything in there.  Now I know 
that Raku doesn't subscribe to that I have no problem.


Cheers,
Peter


Why does .new initialize?

2021-07-18 Thread Peter Scott

I'm curious as to why Rat.new initializes instead of leaving as undefined:

> $*RAKU
Raku (6.d)
> my Rat $p
(Rat)
> put $p
Use of uninitialized value $p of type Rat in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to 
something meaningful.

  in block  at  line 1
> my $q = Rat.new
0
> put $q
0

----
Peter Scott


Re: Is the cosine page wrong?

2020-12-28 Thread Peter Scott

On 12/28/20 10:57 PM, ToddAndMargo via perl6-users wrote:

On 12/28/20 4:54 AM, Richard Hainsworth wrote:
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).



Hi Richard,

When deciding to write a technical article, the
VERY FIRST thing you have to do is determine
your TARGET AUDIENCE.

In a single sentence, please state for me what
you believe the TARGET AUDIENCE is for the
documentation.


Richard stated the target audience for reference documentation quite 
clearly: Someone who already knows how to program and uses Raku. 
Multiple people have told you many times over several years that the 
purpose of reference documentation is to provide a complete description 
of the elements of a language expressed in concise formal notation, and 
is not to be confused with tutorials. Your condescending tone indicates 
you haven't listened and are still trying to convince them that they are 
wrong. It isn't going to work.


Re: OAuth2?

2020-03-21 Thread Peter Scott

On 3/21/20 2:20 PM, ToddAndMargo via perl6-users wrote:

On 2020-03-18 18:42, ToddAndMargo via perl6-users wrote:

This is a long shot, but have any of you figured out
how to send eMail through G-Mail with OAuth2?

I have a module that uses cURL, but I can't figure
out how to get it to work with OAuth2.

RFE: please support OAuth2
https://github.com/retupmoca/P6-Net-SMTP/issues/24

Is in the works, but I need to get something going
by June 2020 as s-suite will stop supporting
Less Secure Apps at that time.


Found this:

python & smtplib: Is sending mail via gmail using oauth2 possible?

https://stackoverflow.com/questions/11445523/python-smtplib-is-sending-mail-via-gmail-using-oauth2-possible 



But it is python we doh't have anything equivalent to
    import oauth2 as oauth
    import oauth2.clients.imap as imaplib


I am in almost exactly the same situation. I don't need to send mail, 
but I do need to read Gmail through IMAP and rename folders and move 
messages.  I am under the same deadline and have done extensive research 
without getting anywhere.  The documentation and online Q do not get 
me very far.


Re: irrational nubmer?

2020-02-26 Thread Peter Scott



On 2/26/2020 11:14 AM, ToddAndMargo via perl6-users wrote:

I used gnome calculator to 20 digits:
    665857/470832
    1.41421356237468991063
Sorry.  Not seeing any repeating patterns.

Here is NAS doing it to 1 million digits (they have too
much time on their hands):
https://apod.nasa.gov/htmltest/gifcity/sqrt2.1mil
No repeats.


As well there shouldn't be in an irrational number.  sqrt(2) != 
665857/470832


So why does base-repeating tell me there is a repeating
pattern when there is not?

Ah ha, 99/70 does have a repeat:
1.4142857 142857 142857 1

Maybe 665857/470832 I just do not go out enough digits to
see a repeat. 


Correct.  As a really disgustingly quick and dirty way of proving that 
the expansion has a repeating cycle of 576 digits:


$ perl6 -e 'say 
665857000/470832' 
| perl -lne '/(\d{4,})\1/ and print length $1, ": $1"'
576: 
135623746899106262955788901349101165596221157440445849050192000543718353892683589900431576443402317599483467563801950589594590002378767798280490705814388146939885139497740170591633533829476331260407109117477146837937948142861997485302613246338396710503958949264281102388962517415978523125021238998198932952730485608454820403031229822951711013694906038671967920617120331668195874536989839263261630475413735684915213919189859652699901451048356951099330546776769633329935093621504060896455635980562068848336561661059571142148367145818466034594080266421993407414959051211472457267


Re: Once again - You say one thing and do another Re: Bug to report: cardinal called an integer

2020-01-15 Thread Peter Scott

On 1/15/2020 2:39 PM, ToddAndMargo via perl6-users wrote:

On 2020-01-15 14:18, Elizabeth Mattijsen wrote:

Thank you Richard for this long and thoughtful answer.

I have already given up on Todd, I'm glad to see others haven't 
(yet).  What will follow is probably a response that is either: a. 
everybody is against me, b. the Raku community won't listen, c. the 
various variations on those themes.  I sincerely hope that I'm wrong.


Liz


Hi Liz,

Richard has not liked me for a long time.

[...]

And I even like you too.  You help me with things
and you don't even like me. 


ToddAndMargo, you may be in the wrong line of business.  Programming a 
computer requires understanding the computer the way it is, not the way 
you would like it to be, and to make progress in that understanding you 
need to be able to understand what people are telling you.  The computer 
will not care whether you like it and it certainly neither likes nor 
dislikes you.  Succeeding in this endeavor requires that you replicate 
the computer's rigor within your mind; fuzziness in that understanding 
will result in failure.


Yet when people demonstrate for you the required rigor you repeatedly 
take issue with their assistance or attribute an emotional bias to it.  
Liking or disliking someone has no bearing on their prowess as a 
programmer.  All that counts is that they understand the abstractions, 
and that is what people have been trying to help you with, but your 
comments suggest you see their assistance only through a like/dislike 
filter.  You're making this so difficult for yourself I think that 
programming is not a good choice of career for you.  Certainly you are 
not demonstrating how someone should behave in a community of developers 
to grow their skills while respecting the other members of the community.


--
Peter Scott


Re: A grand idea on the documentation

2019-12-09 Thread Peter Scott

On 12/9/2019 6:06 AM, ToddAndMargo via perl6-users wrote:

What school did you go to?  Students rate good and bad
teachers, good and bad material ALL-THE-TIME.


This is a function they are entitled to exercise because they are paying 
the teachers.  As you yourself said:



When I was in college, I actually got rid of two bad
teachers.  Ya, I am a bit of jerk over teachers that
take my money and don't do their jobs.


If you're trying to get rid of the people who write Raku documentation 
(who, contrary to your labeling, are not teachers but developers, and 
either way, unpaid), you're making fine progress.


Your repeated questioning of Liz's native language as a diversion from 
your dissembling about use of derogatory language as though there were 
no difference between connotative and denotative terms serves only to 
alienate you from people who have expended enormous effort to help you.


If you really don't understand the connotations of referring to someone 
as a dog then at least understand that it is offensive to most people 
and expend the necessary effort to learn how to conduct yourself in a 
community of volunteers.


The reference documentation is for reference.  You want tutorials. 
That's a different animal, and exists for Raku mostly in the form of 
books and e-books which you stated you do not want to study.



The major issue with the documentation is that it targets the
wrong audience.  Those that understand the cryptography,
don't' need the documentation.  They already know what
it is suppose to say.


Developers need reminders, in the most succinct form, to minimize time, 
of data that they should not need to memorize.  The documentation 
satisfies that need in the same way that a phone book satisfies the need 
to look up someone's number.  The phone book is not bloated with 
explanations of each person's favorite food or the history of the phone 
company.


Your 'keeper' documents sound like they should be shared with others who 
may be in the same situation as you.  Please follow the suggestions for 
how to do that so you can see how they are received.



Peter Scott


Re: looking for good project to learn perl6

2019-12-08 Thread Peter Scott
Raku libraries for Keras/Tensorflow, or AWS, or Kubernetes, leveraging the 
novel features of Raku, could be killer apps for Raku. Ambitious, though.

Peter Scott

> On Dec 7, 2019, at 7:24 PM, Tom Blackwood  wrote:
> 
> 
> Hello William,
> 
> We are actually a small team making the primary job for big data/machine 
> learning etc.
> We know nothing about mailing list gateway and NNTP stuff.
> But thanks for your suggestion, I will take a took at the references you 
> provided.
> 
> Regards
> Tom
> 
> 
>> On Sun, Dec 8, 2019 at 3:30 AM William Michels  wrote:
>> Hi Tom,
>> 
>> My vote would be for someone to take on the task of writing
>> "mailing-list" software in Raku/Perl6, and/or writing
>> "mailing-list-archiving" software (e.g. an NNTP server) in Raku/Perl6.
>> First of all, for your group this would be a relatively-high profile
>> project, with the potential for hundreds or even thousands of
>> companies adopting such a module for their own institutional or
>> company needs.
>> 
>> Regarding the "archiving" module in particular, you could see how the
>> Perl mailing lists are archived, and easily imagine how they might be
>> improved. There would be a need to access data from a database, filter
>> out spam, organize the data by date and/or thread, and serve up the
>> data in a web-accessible format. Selfishly, I would love to see a
>> searchable archive of every Perl6/Raku email ever written.
>> 
>> I've communicated with Ask Bjorn Hansen about the Perl software
>> presently running the NNTP archive (www.nntp.perl.org), in particular
>> the Perl6-Users mailing list. Ask Bjorn Hansen says the NNTP archive
>> runs on Colobus which is written in Perl, with commits going all the
>> way back to 2001. So why not rewrite it in Raku/Perl6?? In particular,
>> I was hoping to see a better "subject threading" algorithm, since with
>> Colobus (on occasion) emails from different "eras" are lumped together
>> in the same thread (example: emails from 2010 showing up in Sept. 2019
>> threads).
>> 
>> I don't know if your group has an interest in writing a full-blown
>> NNTP server, but below are resources for Raku/Perl6, Python, and R.
>> You can decide for yourself if the Raku/Perl6 resources need
>> improving:
>> 
>> Raku/Perl6:
>> https://www.nntp.perl.org/group/
>> https://www.nntp.perl.org/group/perl.perl6.users/
>> https://trainedmonkey.com/projects/colobus/
>> https://github.com/abh/colobus
>> 
>> Python:
>> https://www.python.org/community/lists/
>> https://mail.python.org/archives/
>> https://mail.python.org/mailman/listinfo
>> 
>> R:
>> https://www.r-project.org/mail.html
>> https://stat.ethz.ch/mailman/listinfo
>> https://r.789695.n4.nabble.com
>> 
>> 
>> HTH, Bill.
>> 
>> 
>> 
>> On Fri, Dec 6, 2019 at 1:59 AM Tom Blackwood  wrote:
>> >
>> > Thanks, I'll check it out!
>> >
>> > On Fri, Dec 6, 2019 at 5:50 PM JJ Merelo  wrote:
>> >>
>> >> Try something in the most wanted repo: 
>> >> https://github.com/perl6/perl6-most-wanted/blob/master/most-wanted/modules.md
>> >>  That way you will learn _and_ help the community.
>> >>
>> >> El vie., 6 dic. 2019 a las 8:11, Tom Blackwood () 
>> >> escribió:
>> >>>
>> >>> Hello
>> >>>
>> >>> My team most time developed with ruby language.
>> >>> These recent days we took  time reading the book Learning Perl 6.
>> >>> Then we consider to take an actual project to learn more deeply.
>> >>> What project do you suggest for us to get involve into?
>> >>>
>> >>> Regards,
>> >>> Tom
>> >>
>> >>
>> >>
>> >> --
>> >> JJ


Re: need doc help with []

2018-10-02 Thread Peter Scott

On 10/2/2018 6:29 PM, Trey Harris wrote:
So it is for the [] postcircumfix. For those of us who have been 
following Perl 6 development for 18 years, the fact that it—and almost 
every other low-level particle—can be described at all in such a way 
is a remarkable triumph of the language.


Amen to that.  I am in awe of the beauty and the genius every time I see 
one of those definitions.


Re: Could this be any more obscure?

2018-10-02 Thread Peter Scott

On 10/2/2018 5:45 PM, ToddAndMargo wrote:

On 10/2/18 5:31 PM, Curt Tilmes wrote:


On Tue, Oct 2, 2018 at 8:28 PM ToddAndMargo > wrote:


    Question: in Perl syntaxland, is "postfix" short
    for "postcircumfix"?


Nope.  Each are different types of oeprator.  Here is the list:
https://docs.perl6.org/language/operators#Operator_classification



Hi Curt,

Maybe I am blind, but I can only find

postcircumfix [ ]
https://docs.perl6.org/language/operators#postcircumfix_[_]

in that list.


It's second in the list:



Searching within web page for the term you want usually finds it if it's 
there.  Ctrl-F postfix.


Re: Could this be any more obscure?

2018-09-30 Thread Peter Scott

On 9/30/18 2:45 AM, ToddAndMargo wrote:

The manual need to be written for the common user to
understand, not just developer level and very advanced
users.  They don't need the manual anyway. 


Of course we do. I constantly refer to the Perl 5 manual rather than 
waste memory on rote information.  I'm always looking up format 
descriptors in printf, for instance, and the near-endless special cases 
in split.


The amount of syntactic capacity in function/method calls is far greater 
in Perl 6 than in Perl 5. Your argument is like asking why C functions 
are so much harder to learn than assembler where all one has to do is 
push words onto a stack and jump.  The features of signatures and types 
are much larger in Perl 6 than their Perl 5 equivalents (where 
everything is a list except for weird prototypes that even the manuals 
advise you not to use) and critical to using the language properly and 
effectively.


Understanding these key concepts among others is foundational to 
programming in Perl 6 and is, again, covered in the excellent tutorial 
material that you are determined not to read and are instead extracting 
message by message from the members of this list. That latter approach 
is going to end up being more frustrating and alienating for you in the 
long term than gritting your teeth and forcing yourself to read a book.


Re: Could this be any more obscure?

2018-09-26 Thread Peter Scott

On 9/26/2018 3:21 PM, ToddAndMargo wrote:


I use words all the time.  I never would have figured it out
from

    multi method words(Str:D $input: $limit = Inf --> Positional)

Do your really think any beginner would be able to figure out
"words" from the above?


If the beginner had studied the metasyntax of function prototypes, 
probably.  But this is not necessarily for beginners, this is reference 
documentation, which has to serve a purpose unencumbered by pedagogical 
weight.  This documentation is not a tutorial, it is autogenerated.  You 
are relatively unique in insisting that the reference documentation also 
function as a beginners' roadmap, so you are going to experience this 
kind of frustration repeatedly.


I taught Perl 5 trainings for many years in addition to authoring books, 
videos, and courses on same, and the difference between what is best for 
learning and what is best for reference is stark.  I heard about people 
who claim to have taught themselves Perl 5 from the Camel instead of the 
Llama, but they are few and far between, and in any case, most of the 
Camel contains exposition, if dense. You're looking just at something 
corresponding to the list of functions.  I honestly think you'll get 
further forcing yourself to plow through the new Learning Perl 6 book 
than these random access forays into reference specs.  brian just spent 
two years of intense effort arranging it to fit precisely the graduated 
path your questions tell me you need.


Re: A comparison between P5 docs and p6 docs

2018-09-12 Thread Peter Scott

Ordinarily I would agree with you.  But I know my own brain and
how it works.  I only learn by doing.  Have tried to change that
and can't.



A good tutorial book *will* make you "do." The brian d foy book does 
exactly that with things to try, and questions to explore in your own 
code. It takes you on a structured, pre-thought-out journey through the 
concepts and features in an optimal order.


Re: RFE: contains documentation

2018-09-09 Thread Peter Scott

On 9/9/18 3:47 PM, ToddAndMargo wrote:

I also LOVE examples.  Sometimes an example will get past the
fog quicker than anything else.  And you will notice in a
(spoken) language dictionary, they ALWAYS give
an example of how to use a work in its various contexts. 


"Learning Perl 6" by brian d foy just came out, and it is fantastic. He 
spent over a year creating just the sort of structured guide that you 
are looking for.


Re: RFE: contains documentation

2018-09-09 Thread Peter Scott


> On Sep 9, 2018, at 2:50 PM, ToddAndMargo  wrote:
> 
> My point is that the dictionary should teach you how to use
> the word in question.  I do believe I am correct in my
> assertion too.

Let's be clear that reference documentation is not the same as a tutorial. This 
is the difference between the Camel and the Llama. Absolutely, programmers need 
both of these, but at different times. When you are in programming mode as 
opposed to learning mode, and you want a definitive, authoritative, complete 
answer to a specific question, you need reference documentation that is not 
encumbered by pedagogical devices, interstitial examples, or simplifying 
assumptions. 

Open source projects frequently shoot themselves in the foot by assuming that 
they can improve any documentation simply by adding whatever people are asking 
for to the same buckets. Perl 5 got this right (at least, initially) by 
creating the ---tut series of pods. Good programmers are not always good 
writers or teachers.

Peter Scott
Author, "Perl Debugged," "Perl Medic," and "Perl Fundamentals."

Re: ding!

2017-05-31 Thread Peter Scott

On 5/31/17 8:44 PM, ToddAndMargo wrote:

On 05/31/2017 08:39 PM, Lloyd Fournier wrote:

perl6 -e 'say "\a"'


No joy under linux.

0x07 does not work either.  Just prints a 7


ITYM chr(7).


Re: Perl 6 Advocacy Suggestion

2016-01-19 Thread Peter Scott
I have seen Damian demonstrate how Perl 6 can be the best language for 
teaching functional, procedural, and object-oriented programming.


On 1/19/2016 10:37 AM, Darren Duncan wrote:
I very much agree with this idea, of arguing Perl 6 as a teaching 
language. Academia are the ones that would appreciate what Perl 6 
offers the most in the short term, whereas industry would demand a 
higher standard for it becoming popular.  And the first can lead to 
the second. -- Darren Duncan


On 2016-01-19 9:19 AM, Parrot Raiser wrote:
I believe Damian Conway thinks P6 would be a very good CS teaching 
language.


On 1/19/16, Tom Browder  wrote:

On Tue, Jan 19, 2016 at 10:18 AM, Steve Mynott 
wrote:

I think targeting Perl 6 at CS academic teachers is an excellent idea
as a way of generally promoting use of the language.

But I'd be wary of "bashing" current choices such as Python and don't
believe any objective comparison of the two languages is possible.

Python is in any case derived from ABC which was explicitly designed
for teaching purposes.


I'm not suggesting bashing Python, Steve, I just think some comparison
is necessary.