-glossary.pod
Log Message:
---
[S99] associativity's got nothing to do with it :)
Commit: 793babac4bf1316f787b2a08403bb7b1ca6b072c
https://github.com/perl6/specs/commit/793babac4bf1316f787b2a08403bb7b1ca6b072c
Author: Carl Masak
Date: 2013-07-01 (Mon, 01 Jul
Moritz Lenz wrote:
> Since afaict this is not specced, I'll hand that over to p6l.
>
> Eric Hodges (via RT) wrote:
>> use v6;
>>
>> rule test {test};
>>
>> "test" ~~ //;
>> say '$/.keys => ', $/.keys.perl;
>> say '%($/).keys => ', %($/).keys.perl;
>>
>> # outputs
>> # $/.keys => []
>> # %($/).keys
Since afaict this is not specced, I'll hand that over to p6l.
Eric Hodges (via RT) wrote:
> use v6;
>
> rule test {test};
>
> "test" ~~ //;
> say '$/.keys => ', $/.keys.perl;
> say '%($/).keys => ', %($/).keys.perl;
>
> # outputs
> # $/.keys => []
> # %($/).keys => ["test"]
>
>
> Same could be
On Thu, Sep 29, 2005 at 11:21:20PM -0600, Luke Palmer wrote:
[ discussion on undefs elided ]
Since we can annotate our undefs now, perhaps undefs that would be
generated because there are no previous or next elements get "tagged"
as such. Something like:
# assuming $b and $a are "before"
def" in most code is
considered bad style--then we can steal them for the language's
purposes, such as passing to a for block as lookbehind and lookahead
parameters when you're near the beginning or end of a list.
It seems like I'm making a pretty big deal out of just passing undef
w
Juerd wrote:
Austin Hastings skribis 2005-03-21 15:55 (-0500):
I'd like to see nothing as just an alias for {}.
if $expr
{
do nothing;
}
Possibly the most clear piece of P6 code ever.
Dangerous, though :)
do nothing if $input =~ /\W/;
system "rm -- $input";
Bu
Austin Hastings skribis 2005-03-21 15:55 (-0500):
> I'd like to see nothing as just an alias for {}.
> if $expr
> {
>do nothing;
> }
> Possibly the most clear piece of P6 code ever.
Dangerous, though :)
do nothing if $input =~ /\W/;
system "rm -- $input
Juerd wrote:
Rod Adams skribis 2005-03-21 14:25 (-0600):
if $expr {
nothing;
}
is harder to get confused over, IMO
Except writing something when you mean nothing is kind of weird. It
makes sense in rules because it doesn't usually make sense to match
nothingness, but for blocks
Rod Adams skribis 2005-03-21 14:25 (-0600):
> if $expr {
> nothing;
> }
> is harder to get confused over, IMO
Except writing something when you mean nothing is kind of weird. It
makes sense in rules because it doesn't usually make sense to match
nothingness, but for bl
Larry Wall wrote:
On Sun, Mar 20, 2005 at 09:08:08PM -0600, Rod Adams wrote:
: I propose creating a no-op function "nothing" that can be used
: here or anywhere else you specifically wish to do nothing at all.
:
: given $this {
:when Even { nothing };
:when Prime { ... };
:
the value in a void context, and we could suppress that warning for
0 and 1 like we do Perl 5 without violating our "no barewords" dictum.
: I propose creating a no-op function "nothing" that can be used
: here or anywhere else you specifically wish to do nothing at all.
:
:
Does Perl need a no-op function?
With the addition of "no bare literals", it makes constructs like
1 while some_func();
an error. I propose creating a no-op function "nothing" that can be used
here or anywhere else you specifically wish to do nothing at all.
given
Joe Gottman writes:
> How do you declare a function that doesn't return anything? For instance, a
> C++ swap function might be declared
>template
> void swap(X &x, X &y);
>
> It would be nice to declare the corresponding Perl6 function as
> sub swap ($
How do you declare a function that doesn't return anything? For instance, a
C++ swap function might be declared
template
void swap(X &x, X &y);
It would be nice to declare the corresponding Perl6 function as
sub swap ($x is rw, $y is rw) returns nothing {...}
or something s
--- Larry Wall <[EMAIL PROTECTED]> wrote:
> On Mon, Sep 08, 2003 at 11:18:12AM +0200, Paul Johnson wrote:
> : By the way, I trust this will be addressed (if it hasn't been
> : already):
> :
> : perl5 -le 'print "gah!" if exists $a{b}{c}; print "phooey!"
> : if exists $a{b}'
> :
> : perlfunc say
On Mon, Sep 08, 2003 at 11:18:12AM +0200, Paul Johnson wrote:
: By the way, I trust this will be addressed (if it hasn't been already):
:
: perl5 -le 'print "gah!" if exists $a{b}{c}; print "phooey!" if exists $a{b}'
:
: perlfunc says:
:
: This surprising autovivification in what does not at f
Jonadab the Unsightly One said:
> $s = %h{foo} = nonex;
>
> After deleting the foo key (and its value, if any) from %h this then
> probably procedes to autovivify it when evaluating it as an rvalue;
Now why on earth would you want to do that? Perl 5 doesn't.
By the way, I trust this will be
Luke Palmer <[EMAIL PROTECTED]> writes:
> A synonym of:
>
> delete %h{foo};
>
> would be
>
> %h{foo} = nonex;
This has the potential, if not documented exactly right, to create
bogus expectations. Consider...
$s = %h{foo} = nonex;
After deleting the foo key (and its value, if any)
efined in C<&part>
> > > originally, i.e. C<< <> >>.
> > >
> > > What if one wanted to curry in whatever the default is, i.e., assuming
> > > "nothing" (different from "assuming nothing"), so that if List::Part::part
<> >>.
> >
> > What if one wanted to curry in whatever the default is, i.e., assuming
> > "nothing" (different from "assuming nothing"), so that if List::Part::part
> > changed its default for C to C<< <> >>, the client
> >
Trey asked:
To take the E6 example of currying &part:
&List::Part::part.assuming(labels => <>)
One had to curry in C to be the same as it was defined in C<&part>
originally, i.e. C<< <> >>.
What if one wanted to curry in whatever the default
:
> In a message dated Thu, 31 Jul 2003, Austin Hastings writes:
> > assuming(labels => undef)
>
> Okay... I think you're wrong, because this would have to be a special
> case
> (defaults take effect only when *nothing* is passed in, not when the
> argument is un
In a message dated Thu, 31 Jul 2003, Austin Hastings writes:
> assuming(labels => undef)
Okay... I think you're wrong, because this would have to be a special case
(defaults take effect only when *nothing* is passed in, not when the
argument is undefined) but, assuming you're ri
;> >>.
>
> What if one wanted to curry in whatever the default is, i.e.,
> assuming
> "nothing" (different from "assuming nothing"), so that if
> List::Part::part
> changed its default for C to C<< <> >>, the
> client
> c
To take the E6 example of currying &part:
&List::Part::part.assuming(labels => <>)
One had to curry in C to be the same as it was defined in C<&part>
originally, i.e. C<< <> >>.
What if one wanted to curry in whatever the default is, i.e., assumin
Me wrote:
> > "given nothing...":
> >
> > given () { ... }
>
> do { ... }
>
> seems simpler.
But doesn't have the same effect. A C inside a C responds to
the current value of the "subject" specified by any surrounding
topica
> "given nothing...":
>
> given () { ... }
do { ... }
seems simpler.
> Suppose you want to preserve $_ and alias
>
>given $value -> $g {
'->' seems more visually noisy than it need be in this case.
Perhaps:
given $value as $g
Resending due to BT doing bad things to good nameservers.
Damian Conway <[EMAIL PROTECTED]> writes:
>> >$val = (foo())[0];
>> >
>> > List?
>>
>> Scalar, obviously.
>
> How do you figure that? (Not a criticism: I'd really like to understand your
> thought process her
Damian Conway <[EMAIL PROTECTED]> writes:
>> >$val = (foo())[0];
>> >
>> > List?
>>
>> Scalar, obviously.
>
> How do you figure that? (Not a criticism: I'd really like to understand your
> thought process here so I can assess the relative DWIMity of the two
> alternat
Aaron Sherman wrote:
> >> $ref = [1,2];
> >> @ary[$ref] = foo(); # probably a syntax error
>
> Ok, as far as I can recall, Larry hinted that arrays and references to
> arrays would be interchangable in many contexts in P6. In this case, I
> can't see any reason that subscripting wou
> > $val = (foo())[0];
> >
> > List?
>
> Scalar, obviously.
How do you figure that? (Not a criticism: I'd really like to understand your
thought process here so I can assess the relative DWIMity of the two
alternatives).
> With a possible runtime error if foo doesn't ret
Aaron Sherman <[EMAIL PROTECTED]> writes:
> On Sun, Dec 16, 2001 at 03:55:10PM +1100, Damian Conway wrote:
>
> [...]
>
>>> And, just for laughs:
>>>
>>> $ref = [1,2];
>>> @ary[$ref] = foo(); # probably a syntax error
>
> Ok, as far as I can recall, Larry hinted that arrays a
On Sun, Dec 16, 2001 at 03:55:10PM +1100, Damian Conway wrote:
[...]
>> And, just for laughs:
>>
>> $ref = [1,2];
>> @ary[$ref] = foo(); # probably a syntax error
Ok, as far as I can recall, Larry hinted that arrays and references to
arrays would be interchangable in many
Piers posed the following puzzles:
> @ary[0] = foo() # scalar
Yes.
> @ary[1,2] = foo() # list context
Yes.
> @bar = 1;
> @ary[@bar] = foo() # ? probably list or maybe scalar...
List. With an explicit array as index, it's definitely a (one-element) slice.
> @bar = (1,
"Brent Dax" <[EMAIL PROTECTED]> writes:
> Piers Cawley:
> # In the following code fragment, what context is foo() in?
> #
> # @ary[0] = foo()
>
> The short answer is scalar context. The long answer is below. Note
> that the long answer is only the way I think of it. You may think
> differe
> > @ary[0] =()= foo(); # " " " " " "" "
>
> Hm, thats a change from perl5. In perl5 that would assign the number of
> elements returned from foo(). Is there a good reason for this change ?
Firstly, Larry may have to rule on which behaviour actually *is*
On Fri, Dec 14, 2001 at 06:39:02AM +1100, Damian Conway wrote:
>
>> In the following code fragment, what context is foo() in?
>>
>> @ary[0] = foo()
>
> Scalar context. @ary[0] is a single element of @ary.
>
> To call foo() in list context use any of the following:
>
> (@
On Thu, 13 Dec 2001 12:17:44 -0500, Mark J. Reed wrote:
> @i = (0);
> @ary[@i] = foo();
>
>How could one get that behavior without the intermediate array?
Parens, likely.
(@ary[0]) = foo();
--
Bart.
> In the following code fragment, what context is foo() in?
>
> @ary[0] = foo()
Scalar context. @ary[0] is a single element of @ary.
To call foo() in list context use any of the following:
(@ary[0]) = foo(); # Assign @ary[0] the first element returned
@(@ary[
ll next to mine's.)
--Brent Dax
[EMAIL PROTECTED]
Configure pumpking for Perl 6
"Nothing important happened today."
--George III of England's diary entry for 4-Jul-1776
On Thu, Dec 13, 2001 at 12:12:14PM -0500, Ted Ashton wrote:
> Thus it was written in the epistle of Piers Cawley,
> > In the following code fragment, what context is foo() in?
> >
> > @ary[0] = foo()
>
> Scalar, I would think.
I assume that the following would make the assignment a slice
an
Thus it was written in the epistle of Piers Cawley,
> In the following code fragment, what context is foo() in?
>
> @ary[0] = foo()
Scalar, I would think.
Just my guess,
Ted
--
Ted Ashton ([EMAIL PROTECTED]) | From the Tom Swifty collection:
Southern Adventist University| "Multiplicati
In the following code fragment, what context is foo() in?
@ary[0] = foo()
the following code
@ary= foo()
obviously evaluates @foo in a list context, but in the first I'm no
longer sure.
--
Piers
"It is a truth universally acknowledged that a language in
possession of a ri
43 matches
Mail list logo