oncise.
> >
> > 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
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...@
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 am
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 *unqua
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
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
Subject
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, Elizabeth
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 program
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, t
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 doe
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"
user@mbook:
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 `N
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
> retu
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
re
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 me
15 matches
Mail list logo