Re: REPL / Linenoise question (backslashes)

2021-07-19 Thread William Michels via perl6-users
Hi Rob! Thanks for the reply. So what you're saying is the "backslash-newline" combination tells the REPL that it has received incomplete input? Otherwise I don't see how the Raku REPL knows how to cycle from taking input at its prompt and moving to the read/evaluate step. I took a quick look at

Re: Why does .new initialize?

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

Re: pod questions

2021-07-19 Thread Tom Browder
On Mon, Jul 19, 2021 at 09:20 Marcel Timmerman wrote: > On 7/19/21 2:29 PM, Tom Browder wrote: > > On Mon, Jul 19, 2021 at 06:57 Marcel Timmerman wrote: > > Reading a bit, I came across old documents (with a warning that these are >> out of date)

Re: Why does .new initialize?

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

Re: Why does .new initialize?

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

Re: Why does .new initialize?

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

Re: Why does .new initialize?

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

Re: pod questions

2021-07-19 Thread Tom Browder
On Mon, Jul 19, 2021 at 06:57 Marcel Timmerman wrote: Reading a bit, I came across old documents (with a warning that these are > out of date) https://design.raku.org/S02.html#Multiline_Comments . It > states that any unrecognized format name should be treated as a comment > block, which the

pod questions

2021-07-19 Thread Marcel Timmerman
Hi, Still trying to find a way to have test code in my programs. Normally not executed but an imported class could make some sense of it. Others have tried already but I wanted to do the following which looks promising; =begin Gnome-T =begin code my Int $i = 10; =end code =end Gnome-T I

Re: Why does .new initialize?

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