Re: Missing NullPointerException

2020-12-19 Thread yary
gt; > > But Raku is Raku, there is surely a way to make sure that my Nil > > explodes in my code. Is there a `use FailingNil`? > > > > Concerning documentation: I do not know where there is an > > appropriate place to warn about this behavior. The

Re: Missing NullPointerException

2020-12-18 Thread Konrad Bucheli via perl6-users
Sent: Saturday, 5 December 2020 15:58 To: Konrad Bucheli mailto:kbuch...@open-systems.com>> Cc: perl6-users mailto:perl6-us...@perl.org>> Subject: Re: Missing NullPointerException On Thu, Dec 3, 2020 at 10:20 PM Konrad Bucheli via perl6-users mailto:perl6-us...@

Re: Missing NullPointerException

2020-12-18 Thread Konrad Bucheli via perl6-users
Hi Ralph I understand that this is about avoiding the pyramid of doom. And it is enjoyable that it can be avoided. Opt in. No programming language I worked so far has this semantics of method call. So we might name it differently as it is doing something different... -> that is the trap. (I

Re: Missing NullPointerException

2020-12-17 Thread Ralph Mellor
On Wed, Dec 16, 2020 at 5:10 AM Konrad Bucheli ... wrote: > there is surely a way to make sure that my Nil > explodes in my code. Is there a `use FailingNil`? I'd +1 a `use fatal :Nil;`. In the meantime, this appears to work: ``` engine.?Raptor::start ``` Might be a bug because an

Re: Missing NullPointerException

2020-12-16 Thread Brad Gilbert
tion: I do not know where there is an appropriate > place to warn about this behavior. There where we teach how methods are > called? Surely it would not have found me. I look up a lot in > documentation, but not such trivial stuff. > > Cheers > > Konrad > > From: Ral

Re: Missing NullPointerException

2020-12-15 Thread Konrad Bucheli via perl6-users
place to warn about this behavior. There where we teach how methods are called? Surely it would not have found me. I look up a lot in documentation, but not such trivial stuff. Cheers Konrad From: Ralph Mellor Sent: Saturday, 5 December 2020 15:58 To: Konrad Bucheli Cc: perl6-users Subj

Re: Missing NullPointerException

2020-12-05 Thread Konrad Bucheli via perl6-users
The returned Nil aka bug was from my side. But when debugging it took me a while to find the culprit because when the statement with the chained methods was executed I expected all of them being executed... So that was a bit of a surprise. Thanks for the insights! On 03.12.20 23:25,

Re: Missing NullPointerException

2020-12-05 Thread Ralph Mellor
On Thu, Dec 3, 2020 at 10:20 PM Konrad Bucheli via perl6-users wrote: > > What is actually the rationale for such a behaviour? Ergonomically sound null safety. First, consider what other languages have. Quoting https://en.wikipedia.org/wiki/Safe_navigation_operator: > In object-oriented

Re: Missing NullPointerException

2020-12-03 Thread Elizabeth Mattijsen
Nil is really a Failure that doesn't throw. It indicates the absence of a value where there is one expected. That is why Nil doesn't throw. If you want to indicate a soft failure, you should use fail(). If the chain of methods you mention are core methods, and one of them is returning Nil,

Re: Missing NullPointerException

2020-12-03 Thread Konrad Bucheli via perl6-users
On 02.12.20 15:55, Ralph Mellor wrote: On Wed, Dec 2, 2020 at 7:08 AM Patrick R. Michaud wrote: Nil.any_non_existent method always seems to return Nil. I'm not sure where this is documented It's near the top of the `Nil` doc page you linked: Any method call on `Nil` of a method that

Re: Missing NullPointerException

2020-12-02 Thread Timo Paulssen
On 02/12/2020 17:18, William Michels via perl6-users wrote: Does this explain why calling "dd" in the REPL returns Nil on the final line, but Nil doesn't seem to be returned on the final line when using "dd" from the Bash shell? user@mbook:~$ raku -e 'dd "0123456789";' "0123456789"

Re: Missing NullPointerException

2020-12-02 Thread William Michels via perl6-users
On Wed, Dec 2, 2020 at 6:56 AM Ralph Mellor wrote: > On Wed, Dec 2, 2020 at 7:08 AM Patrick R. Michaud > wrote: > > Nil.any_non_existent method always seems to return Nil. I'm not sure > where this is documented > > It's near the top of the `Nil` doc page you linked: > > > Any method call on

Re: Missing NullPointerException

2020-12-02 Thread Ralph Mellor
On Wed, Dec 2, 2020 at 7:08 AM Patrick R. Michaud wrote: > Nil.any_non_existent method always seems to return Nil. I'm not sure where > this is documented It's near the top of the `Nil` doc page you linked: > Any method call on `Nil` of a method that does not exist ... will succeed and >

Re: Missing NullPointerException

2020-12-01 Thread Patrick R. Michaud
The difference is between the result of "Nil.c" and "Any.c". On my current version of Rakudo, "Nil.c" returns Nil, while Any.c throws the "No such method" exception. In fact, Nil.any_non_existent method always seems to return Nil. I'm not sure where this is documented, but it's likely the

Missing NullPointerException

2020-12-01 Thread Konrad Bucheli via perl6-users
Hi I miss an error on my first invocation of `c` below: $ raku Welcome to 퐑퐚퐤퐮퐝퐨™ v2020.10. Implementing the 퐑퐚퐤퐮™ programming language v6.d. Built on MoarVM version 2020.10. To exit type 'exit' or '^D' > class a { method b {return}} (a) > say a.b.c Nil > my $b = a.b (Any) > say $b.c No such