On Wed, Oct 4, 2017 at 1:29 PM, ToddAndMargo <toddandma...@zoho.com
<mailto:toddandma...@zoho.com>> wrote:
On 10/02/2017 01:18 PM, ToddAndMargo wrote:
Hi All,
I am writing up a keeper note on <<>> and such. This example
puzzles me. Why the space?
Example of <<>> (double quote and allow insertion of variables
into strings):
$ perl6 -e 'my $x="abc"; my $y=<<xyz{$x}def>>; say "\$x=$x
\$y=$y";'
$x=abc $y=xyz abc def
Many thanks,
-T
Hi Guys,
I am trying to document for myself what the difference is
between "" and <<>>.
Maybe I should rephrase the question. Why are these
two different? Why the spaces when using <<>>?
$ perl6 -e 'my $x="abc"; my $y=<<xyz{$x}def>>; say "\$x=$x \$y=$y";'
$x=abc $y=xyz abc def
$ perl6 -e 'my $x="abc"; my $y="xyz{$x}def"; say "\$x=$x \$y=$y";'
$x=abc $y=xyzabcdef
-T
On 10/04/2017 11:45 AM, Andy Bach wrote:
Why the spaces when using <<>>?
in REPL
> my $x="abc"; my $y="xyz{$x}def"; say "\$x=$x \$y=$y"
$x=abc $y=xyzabcdef
> $y.WHAT
(Str)
> $x.WHAT
(Str)
> my $z=<<xyz{$x}def>>;
(xyz abc def)
> $z.WHAT
(List)
<<>> makes a list, the { } make a closure, so you've got 3 things in the
list; "xyz", the value of $x ("abc"), and "def"
> $z=<<xyz$xdef>>;
===SORRY!=== Error while compiling:
Variable '$xdef' is not declared
------> $z=<<xyz⏏$xdef>>;
> $z=<<xyz$x def>>;
(xyz abc def)
Love that "what" command.
I think maybe I don't understand how <<>> is used in a
and how <<>> differs from a ""