What am, I missing?
$ p6 'my $x; if $x =:= Nil { say "Nil" } else { say "Not Nil"; };'
Not Nil
$ p6 'my $x = Nil; if $x =:= Nil { say "Nil" } else { say "Not Nil"; };'
Not Nil
Hi All,
These two throw an operating on a "Nil" error:
$PartsStr ~= "$PartNo";
$PartsStr ~= "{$PartNo}";
But this does not:
$PartsStr ~= "{$PartNo}" ~ "";
And this does not either:
$PartsStr ~= "abcde";
Huh?
Many
If you don't define the type of a Scalar and don't assign to it you'll have
an undefined Any (the Parent class of all the other types). If you assign
Nil to it then you have the same effect.
You can make $x to be Nil by iether casting it : my Nil $x; or binding it
to Nil; m
Also:
my $a is default(Nil);
> On 12 Sep 2018, at 09:25, Simon Proctor wrote:
>
> If you don't define the type of a Scalar and don't assign to it you'll have
> an undefined Any (the Parent class of all the other types). If you assign Nil
> to it then you have
O learn something new everyday :)
On Wed, 12 Sep 2018 at 08:46 Elizabeth Mattijsen wrote:
> Also:
>
> my $a is default(Nil);
>
> > On 12 Sep 2018, at 09:25, Simon Proctor wrote:
> >
> > If you don't define the type of a Scalar and don't assign t
When you assign Nil to a string or any object, it takes its default value.
Cheers
El mié., 12 sept. 2018 a las 10:23, Simon Proctor ()
escribió:
> O learn something new everyday :)
>
> On Wed, 12 Sep 2018 at 08:46 Elizabeth Mattijsen wrote:
>
>> Also:
>>
Basically, ignore any advice to treat Nil as a normal value, because
it really is intended to represent the *absence* of a value as much as
possible. It's a bit like the way solid-state electronics treats "holes"
as if they were real particles, and gets away with it much of the ti
On 09/12/2018 10:09 AM, Larry Wall wrote:
Basically, ignore any advice to treat Nil as a normal value, because
it really is intended to represent the *absence* of a value as much as
possible. It's a bit like the way solid-state electronics treats "holes"
as if they were real part
> On 13 Sep 2018, at 20:47, ToddAndMargo wrote:
> On 09/12/2018 10:09 AM, Larry Wall wrote:
>> Basically, ignore any advice to treat Nil as a normal value, because
>> it really is intended to represent the *absence* of a value as much as
>> possible. It's a
On 09/13/2018 12:29 PM, Elizabeth Mattijsen wrote:
On 13 Sep 2018, at 20:47, ToddAndMargo wrote:
On 09/12/2018 10:09 AM, Larry Wall wrote:
Basically, ignore any advice to treat Nil as a normal value, because
it really is intended to represent the *absence* of a value as much as
possible. It
> On 13 Sep 2018, at 23:21, ToddAndMargo wrote:
> On 09/13/2018 12:29 PM, Elizabeth Mattijsen wrote:
>>> On 13 Sep 2018, at 20:47, ToddAndMargo wrote:
>>> On 09/12/2018 10:09 AM, Larry Wall wrote:
>>>> Basically, ignore any advice to treat Nil as a nor
On 09/13/2018 02:24 PM, Elizabeth Mattijsen wrote:
On 13 Sep 2018, at 23:21, ToddAndMargo wrote:
$ p6 'my $x="\na\nb\nc\n"; for ( split "\n", $x ) -> $i {print "<$i>\n"};'
<>
<>
with beginning and ending new lines.
FWIW, a more Perl6ish way would be:
$ p6 'my $x="\na\nb\nc\n"; for $
There is not enough context to answer or even reproduce the problem -
how are the variables declared and what values do they have just prior
to this line? Also, what version of rakudo?
On 30 April 2018 at 11:29, ToddAndMargo wrote:
> Hi All,
>
> These two throw an operating on a &q
,
These two throw an operating on a "Nil" error:
$PartsStr ~= "$PartNo";
$PartsStr ~= "{$PartNo}";
But this does not:
$PartsStr ~= "{$PartNo}" ~ "";
And this does not either:
$PartsStr ~= "abcde";
Huh?
Many thanks
On 04/29/2018 10:12 PM, ToddAndMargo wrote:
On 04/29/2018 09:32 PM, Andrew Kirkpatrick wrote:
There is not enough context to answer or even reproduce the problem -
how are the variables declared and what values do they have just prior
to this line?
Some simpler examples:
$ perl6 -e 'my $x="ab
On Sun, Apr 29, 2018 at 10:20:48PM -0700, ToddAndMargo wrote:
On 04/29/2018 10:12 PM, ToddAndMargo wrote:
On 04/29/2018 09:32 PM, Andrew Kirkpatrick wrote:
There is not enough context to answer or even reproduce the problem -
how are the variables declared and what values do they have just pr
The original error you quoted was about use of Nil. I couldn't
reproduce this by assigning Nil to a variable, turns out that's
because such an assignment is specified to set the variable to the
default value of the type of the variable. my $x = Nil gives (Any), my
Str $y = Nil gives
On 04/30/2018 05:20 PM, Andrew Kirkpatrick wrote:
I couldn't
reproduce this by assigning Nil to a variable
Well as it transpires, when I tested the {$x} version, I
forgot to press "save". Also, a one liner operated
differently than a program. And to top things off,
when read
Dear perl 6 users,
I am trying to pass a Nil value to a method new of a class that expects a Str.
The method new will assign this Nil value to a Str member variable. Then, this
value will change during runtime.
At the moment I am getting this error: Type check failed in binding $value
Hi All,
How do I turn this:
$ raku -e 'my $x="abc"; say $x.index( "q" );'
Nil
into a test?
$ raku -e 'my $x="abc"; if $x.index( "q" ) eq Nil {say "Nil"}else{say
"Exists";}'
Use of Nil in string context
in bloc
Hello Emiliano,
In this case, I think you may want to use just "Str" instead of "Nil".
"Str" is the "type object" for Str objects, and you can check whether
it's a string like "foo" or just the Str object by checking $!value.defined.
Th
On Mon, Feb 22, 2016 at 9:15 PM, TS xx wrote:
> I expect $.value to hold Strings, but I want to be able to instantiate
> MyClass whether I have a value already or not, and I also want to be able
> to tell if $.value has a real String or not. Is this possible?
You don't want Nil t
Thanks,
That was it.
Somtimes I get confused with the way other languages treat undefined/null/nil
values.
Regards,
Emiliano
From: Timo Paulssen
Sent: Tuesday, February 23, 2016 2:20 AM
To: perl6-users@perl.org
Subject: Re: Need help with Nil values
Thanks Brandon,
That was what I was looking for.
I'm trying it already.
Regards,
Emiliano
From: Brandon Allbery
Sent: Tuesday, February 23, 2016 2:21 AM
To: TS xx
Cc: perl6-users@perl.org
Subject: Re: Need help with Nil values
On Mon, Feb 22, 2016
>
> Regards,
>
> Emiliano
>
>
> --
> *From:* Brandon Allbery
> *Sent:* Tuesday, February 23, 2016 2:21 AM
> *To:* TS xx
> *Cc:* perl6-users@perl.org
>
> *Subject:* Re: Need help with Nil values
> On Mon, Feb 22, 2016 at 9:15 PM, TS xx wrote:
>
&g
Generally you don't need to test for 「Nil」.
You can just test for defined-ness.
$ raku -e 'my $x="abc"; with $x.index( "q" ) {say "Exists"} else {say
"Nil";}'
Also 「Nil」 is not a 「Str」, so why would you use 「eq」?
$ raku -e 'N
On Tue, May 26, 2020 at 4:24 PM ToddAndMargo via perl6-users
mailto:perl6-users@perl.org>> wrote:
Hi All,
How do I turn this:
$ raku -e 'my $x="abc"; say $x.index( "q" );'
Nil
into a test?
$ raku -e 'my $x="abc&q
via perl6-users
> >> mailto:perl6-users@perl.org>> wrote:
> >>
> >> Hi All,
> >>
> >> How do I turn this:
> >>
> >> $ raku -e 'my $x="abc"; say $x.index( "q" );'
> >> Nil
> &
On 2020-05-26 16:29, Brad Gilbert wrote:
There are various equality operators.
「==」 Tests for numeric equality
「eq」 Tests for string equality
「===」 Tests for value identity
「=:=」 Tests for pointer equality (Note that it looks a bit like 「:=」)
「eqv」 Tests for structure equivalence.
The 「==」 and
correctly returned; in bash
line [3] using "say" only the $/ match string is returned. So far so
good. However, a virtually-identical call in bash line [4] using "put"
instead of "say" returns an error for the first line of the target
text file: "Use of Nil in st
"say $x" is essentially equivalent to "put $x.gist".
Since Nil is undefined (roughly equivalent to a type object), Nil.gist has a
string value of "Nil" and can be printed. However, attempting to convert Nil
directly into a Str throws an error because tha
> Bool.Str
Use of uninitialized value of type Bool in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to
something meaningful.
in block at line 1
> Nil.Str
Use of Nil in string context
in block at line 1
Which means
On Mon, May 18, 2020 at 4:03 AM Patrick R. Michaud wrote:
>
> "say $x" is essentially equivalent to "put $x.gist".
>
> Since Nil is undefined (roughly equivalent to a type object), Nil.gist has a
> string value of "Nil" and can be printed. However,
gt; Many objects will throw an error if you call `.Str` on them when they are
> undefined.
>
> > Bool.Str
> Use of uninitialized value of type Bool in string context.
> Methods .^name, .raku, .gist, or .say can be used to stringify it to
> something meaningful.
>
This message appears when installing Linenoise
<---
$ zef install Linenoise
===> Installing: Linenoise:ver<0.1.1>:auth
Use of Nil in string context
in block at home#sources/0BDF8C54D33921FEA066491D8D13C96A7CB144B9 (Linenoise)
line 15
--->
The above mentioned line is:
<
On 04/24/2018 11:30 AM, mimosinnet wrote:
This message appears when installing Linenoise
<---
$ zef install Linenoise
===> Installing: Linenoise:ver<0.1.1>:auth
Use of Nil in string context
in block at home#sources/0BDF8C54D33921FEA066491D8D13C96A7CB144B9
(Linenoise) line 1
El Wednesday, 25 de April del 2018 a les 18:31, Todd Chester va escriure:
On 04/24/2018 11:30 AM, mimosinnet wrote:
This message appears when installing Linenoise
<---
$ zef install Linenoise
===> Installing: Linenoise:ver<0.1.1>:auth
Use of Nil in string context
in block at
On 04/26/2018 12:45 AM, mimosinnet wrote:
El Wednesday, 25 de April del 2018 a les 18:31, Todd Chester va escriure:
On 04/24/2018 11:30 AM, mimosinnet wrote:
This message appears when installing Linenoise
<---
$ zef install Linenoise
===> Installing: Linenoise:ver<0.1.1>:auth
U
38 matches
Mail list logo