Re: Nil ?

2018-09-13 Thread Todd Chester
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

Re: Nil ?

2018-09-13 Thread Elizabeth Mattijsen
> 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

Re: Nil ?

2018-09-13 Thread ToddAndMargo
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's

Re: Nil ?

2018-09-13 Thread Elizabeth Mattijsen
> 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 bit

Re: Nil ?

2018-09-13 Thread ToddAndMargo
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 particles

Re: Nil ?

2018-09-12 Thread Larry Wall
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 time. B

Re: Nil ?

2018-09-12 Thread JJ Merelo
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: >>

Re: Nil ?

2018-09-12 Thread Simon Proctor
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 to it

Re: Nil ?

2018-09-12 Thread Elizabeth Mattijsen
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 the same effect

Re: Nil ?

2018-09-12 Thread Simon Proctor
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; my $x; $x := Nil

Nil ?

2018-09-11 Thread ToddAndMargo
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

Re: nil mystery

2018-04-30 Thread ToddAndMargo
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 reading &

Re: nil mystery

2018-04-30 Thread Andrew Kirkpatrick
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 (Str

Re: nil mystery

2018-04-30 Thread ToddAndMargo
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

Re: nil mystery

2018-04-29 Thread ToddAndMargo
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

Re: nil mystery

2018-04-29 Thread ToddAndMargo
dma...@zoho.com> wrote: 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&q

Re: nil mystery

2018-04-29 Thread Andrew Kirkpatrick
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 ~= "abcd

nil mystery

2018-04-29 Thread ToddAndMargo
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

Re: zef install Linenoise: Use of Nil in string context, (Linenoise) line 15

2018-04-26 Thread ToddAndMargo
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>:aut

Re: zef install Linenoise: Use of Nil in string context, (Linenoise) line 15

2018-04-26 Thread mimosinnet
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

Re: zef install Linenoise: Use of Nil in string context, (Linenoise) line 15

2018-04-25 Thread Todd Chester
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 (Lineno

zef install Linenoise: Use of Nil in string context, (Linenoise) line 15

2018-04-24 Thread mimosinnet
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: <

Re: Need help with Nil values

2016-02-23 Thread Lloyd Fournier
; > > Regards, > > Emiliano > > > -- > *From:* Brandon Allbery <allber...@gmail.com> > *Sent:* Tuesday, February 23, 2016 2:21 AM > *To:* TS xx > *Cc:* perl6-users@perl.org > > *Subject:* Re: Need help with Nil values > On

Re: Need help with Nil values

2016-02-22 Thread TS xx
Thanks, That was it. Somtimes I get confused with the way other languages treat undefined/null/nil values. Regards, Emiliano From: Timo Paulssen <t...@wakelift.de> Sent: Tuesday, February 23, 2016 2:20 AM To: perl6-users@perl.org Subject: Re: Nee

Re: Need help with Nil values

2016-02-22 Thread Brandon Allbery
le? You don't want Nil there; it's not the undefined value, it's a value of a special type. You want Str, the type object for Strings, which also serves as the undefined value (also true for other types). You can test it with `defined`. $myObject = MyClass.new(Str); then you can test

Re: Need help with Nil values

2016-02-22 Thread Timo Paulssen
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. The