classes and objects questions

2020-12-14 Thread ToddAndMargo via perl6-users

Hi All,

https://docs.raku.org/language/classtut

 "A tutorial about creating and using classes
 in Raku"

So far so good.

 "Raku has a rich built-in syntax for defining
 and using classes."

U. Forgot something did we?  What is a "class"?


Next up:

 "A default constructor allows the setting of
 attributes for the created object:"

U.  Forgot something else, did we?  What is
an "object"?


The "tutorial" leaves "class" and "object" up to
the reader to guess at from what looks like an
interesting example.


But, again forgetting things, The tutorial also
leaves the syntax up for guess work as well.  Not
described are "$.", "$!", ":$", ^$" what are they
and what are the rules for using them.

Next up:

 my $r = Rectangle.new(
  lower => Point.new(x => 0, y => 0),
  upper => Point.new(x => 10, y => 10));


Why are we using ".new"?

Why are we using the syntax for a hash (=>)?

And:
 $!upper.x

What is the rules and purpose for such?  Why
the "!" and why the "."?


I do realize the documentation is not meant for
beginners, but rather a refresher for advanced
users that do not need it, but this link definitely
said "tutorial" -- fifth word in.

Would some kind soul please fill in the missing
parts of the "tutorial" for me?

Many thanks,
-T


Re: classes and objects questions

2020-12-14 Thread Aureliano Guedes
Hi Todd,

I'm a computational biologist and my knowledge is limited to what I need to
do data science and data analysis in my field.

So far, after a few years, I developed a very shy ability in programming
languages. Luckily, having Perl 5 as my first love.
Perhaps, at the time I was able to use Moose to support OO. Then I had to
do a job with Python and I didn't know the language itself at the time.
Perhaps, nowadays I have skills enough to Perl/Python/R also C/C++, but I
still missing skills in Raku, perhaps by the time or perhaps because I have
some language addiction.

But, as far I follow this group, trying to learn something, I saw you doing
some questions. And somehow I notice you have more knowledge than me in
this long waited new-born (after 15y) language.

That's why, as a community-developed language (including docs) I'd like to
suggest to you help to improve the docs.
This way, when I have - with some lucky - free time, I may learn with you
and all others that wrote these docs.

Regards,
acpguedes

PS: Perhaps, sorry for my really bad English

On Mon, Dec 14, 2020 at 7:34 PM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> Hi All,
>
> https://docs.raku.org/language/classtut
>
>   "A tutorial about creating and using classes
>   in Raku"
>
> So far so good.
>
>   "Raku has a rich built-in syntax for defining
>   and using classes."
>
> U. Forgot something did we?  What is a "class"?
>
>
> Next up:
>
>   "A default constructor allows the setting of
>   attributes for the created object:"
>
> U.  Forgot something else, did we?  What is
> an "object"?
>
>
> The "tutorial" leaves "class" and "object" up to
> the reader to guess at from what looks like an
> interesting example.
>
>
> But, again forgetting things, The tutorial also
> leaves the syntax up for guess work as well.  Not
> described are "$.", "$!", ":$", ^$" what are they
> and what are the rules for using them.
>
> Next up:
>
>   my $r = Rectangle.new(
>lower => Point.new(x => 0, y => 0),
>upper => Point.new(x => 10, y => 10));
>
>
> Why are we using ".new"?
>
> Why are we using the syntax for a hash (=>)?
>
> And:
>   $!upper.x
>
> What is the rules and purpose for such?  Why
> the "!" and why the "."?
>
>
> I do realize the documentation is not meant for
> beginners, but rather a refresher for advanced
> users that do not need it, but this link definitely
> said "tutorial" -- fifth word in.
>
> Would some kind soul please fill in the missing
> parts of the "tutorial" for me?
>
> Many thanks,
> -T
>


-- 
Aureliano Guedes
skype: aureliano.guedes
contato:  (11) 94292-6110
whatsapp +5511942926110


Re: classes and objects questions

2020-12-14 Thread ToddAndMargo via perl6-users

On 12/14/20 5:24 PM, Aureliano Guedes wrote:
That's why, as a community-developed language (including docs) I'd like 
to suggest to you help to improve the docs.
This way, when I have - with some lucky - free time, I may learn with 
you and all others that wrote these docs.


Hi Aureliano,

I absolutely adore Raku.  But the docs are truly awful.
They do not start out simple and build to the complex.
They throw terms out without defining them.  They use
things in examples that are require advanced level of
knowledge to understand, and so on and so forth.
They have broken virtually rule of technical writing.
The docs are simply refreshers for those that already
know what they are doing and do not need them.

I have tried several times to contribute to and get
the docs improved.  I have been told I am providing
too much detail or just get ignored.  So I have
stopped.  The culture of the "docs" is not something
I can change.

I would absolute love to see some kind of contributed
docs portal that any user could pick out a subject and
write on it with the ability for others to correct
mistakes or add content.

Once I get Classes and Object figured out, I will
write my own documentation of the subject.  If I
think it is good enough to share (some of my technical
writing stinks too), I will post it back here.

For starters, I need to have the definition of
"class" and "object".  Then I need their rules.

-T


Re: classes and objects questions

2020-12-14 Thread WFB
Hi ToddAndMargo,

Thanks for the effort to improve the Raku docs. However, this is a Raku not
OO (Object Oriented
) related
tutorial. As JJ already pointed out, these pages are to show the reader how
you get things done in Raku, not what OO or other programming concepts are.
There are probably thousands of OO books around and can teach you what a
class is and why you need them. See the Wikipedia link I linked above for
example. That's not in the scope of this tutorial.

The parts you are missing are already there, but unfortunately not linked.
You can find them in the Raku documentation:  =>
, $!
 and $.

:$ stands for a named parameter
 and
can be also found in the documentation.
^$ is used for ranges and is also already
there.

So the information you are missing is already there. You could argue that
the links are missing and I would agree with you. But again this tutorial
is for Raku classes not OO concept, Pairs, named parameters or ranges.

I hope that helped,
Wolfgang



On Tue, 15 Dec 2020 at 05:28, ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> On 12/14/20 5:24 PM, Aureliano Guedes wrote:
> > That's why, as a community-developed language (including docs) I'd like
> > to suggest to you help to improve the docs.
> > This way, when I have - with some lucky - free time, I may learn with
> > you and all others that wrote these docs.
>
> Hi Aureliano,
>
> I absolutely adore Raku.  But the docs are truly awful.
> They do not start out simple and build to the complex.
> They throw terms out without defining them.  They use
> things in examples that are require advanced level of
> knowledge to understand, and so on and so forth.
> They have broken virtually rule of technical writing.
> The docs are simply refreshers for those that already
> know what they are doing and do not need them.
>
> I have tried several times to contribute to and get
> the docs improved.  I have been told I am providing
> too much detail or just get ignored.  So I have
> stopped.  The culture of the "docs" is not something
> I can change.
>
> I would absolute love to see some kind of contributed
> docs portal that any user could pick out a subject and
> write on it with the ability for others to correct
> mistakes or add content.
>
> Once I get Classes and Object figured out, I will
> write my own documentation of the subject.  If I
> think it is good enough to share (some of my technical
> writing stinks too), I will post it back here.
>
> For starters, I need to have the definition of
> "class" and "object".  Then I need their rules.
>
> -T
>


Re: classes and objects questions

2020-12-14 Thread ToddAndMargo via perl6-users

For starters, I need to have the definition of
"class" and "object".  Then I need their rules.

-T




On 12/14/20 10:33 PM, WFB wrote:

Hi ToddAndMargo,

Thanks for the effort to improve the Raku docs. However, this is a Raku 
not OO (Object Oriented 
) related 
tutorial. As JJ already pointed out, these pages are to show the reader 
how you get things done in Raku, not what OO or other programming 
concepts are. There are probably thousands of OO books around and can 
teach you what a class is and why you need them. See the Wikipedia link 
I linked above for example. That's not in the scope of this tutorial.


The parts you are missing are already there, but unfortunately not 
linked. You can find them in the Raku documentation: => 
, $! 
 and $. 

:$ stands for a named parameter 
 
and can be also found in the documentation.
^$ is used for ranges and is also 
already there.


So the information you are missing is already there. You could argue 
that the links are missing and I would agree with you. But again this 
tutorial is for Raku classes not OO concept, Pairs, named parameters or 
ranges.


I hope that helped,
Wolfgang


Hi Wolfgang,

Thank you for the links!

JJ may be right about the OO thing, but it makes the
tutorial pretty much useless.  How "class" and "object"
*relate* to Raku needs to be explained.

"The best is the enemy of the good".  It is better to
slum it a bit and make the tutorial useful. JJ will
hate it, but he will live.

-T