At 11:11 PM + 5/5/05, Terrence Brannon wrote:
Luke Palmer <[EMAIL PROTECTED]> writes:
> On 5/5/05, Terrence Brannon <[EMAIL PROTECTED]> wrote:
I was looking at a line in the hangman program:
@letters == @solution.grep:{ $_ ne '' };
and was told that I was looking at an adverbial block.
T
On 5/5/05, Terrence Brannon <[EMAIL PROTECTED]> wrote:
> I was looking at a line in the hangman program:
>
> @letters == @solution.grep:{ $_ ne '' };
>
> and was told that I was looking at an adverbial block.
>
> But I don't understand what that is and could not find a description
> and exampl
On 5/6/05, Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]> wrote:
> I find this table very interesting, in that it shows the fundamental
> difference between reduce and the existing meta-ops.
Yep, that was basically the whole point of the table.
> The existing meta-operators alter the semantics of t
On 5/6/05, Stuart Cook <[EMAIL PROTECTED]> wrote:
(B> (snip) As long as each meta-operator
(B> explicitly knows what type of regular operator it accepts (and
(B> produces), there shouldn't be any problems with ambiguity.
(B>
(B
(BHaving posted that, I immediately thought of some problems:
(
On 5/5/05, Stuart Cook <[EMAIL PROTECTED]> wrote:
> +-+---+-++
> | Meta-op | is| operates on | to produce |
> +-+---+-++
> | [ ] | circumfix | infix | prefix |
> +-+---+
If I understand correctly, so far we have the following meta-operators:
[ ]
circumfix meta-operator on infix operator which produces a prefix operator
>> <<
circumfix meta-operator on infix operator which produces an infix operator
=
postfix meta-operator on infix operator which produces an infi
Luke Palmer <[EMAIL PROTECTED]> writes:
> Ugh, hit "a" in gmail when replying!
>
> On 5/5/05, Terrence Brannon <[EMAIL PROTECTED]> wrote:
>> I was looking at a line in the hangman program:
>>
>> @letters == @solution.grep:{ $_ ne '' };
>>
>> and was told that I was looking at an adverbial block.
Ugh, hit "a" in gmail when replying!
On 5/5/05, Terrence Brannon <[EMAIL PROTECTED]> wrote:
> I was looking at a line in the hangman program:
>
> @letters == @solution.grep:{ $_ ne '' };
>
> and was told that I was looking at an adverbial block.
The adverbial block is what you're giving to `if`
I was looking at a line in the hangman program:
@letters == @solution.grep:{ $_ ne '' };
and was told that I was looking at an adverbial block.
But I don't understand what that is and could not find a description
and examples in a reverse search on dev and nntp.perl.org.
I would appreciate a
On Thu, 5 May 2005, John Williams wrote:
> or even
>
> @x -= @y;
Doh! That should be C< $x -= $y; > of course.
On Thu, 2005-05-05 at 12:31, Larry Wall wrote:
> On Thu, May 05, 2005 at 10:14:34AM +0300, Gaal Yahas wrote:
> : On Wed, May 04, 2005 at 11:44:58PM -0700, Larry Wall wrote:
> : > : How do I open a file named "-"?
[...]
> : > $fh = io("-");
> : > $fh = open "-";
> : My concern is again with
On Thu, May 05, 2005 at 03:03:22PM -0400, Rob Kinyon wrote:
: Can I put an operator in a variable and then use it in the []
: reduce meta-operator? Something like:
:
: $op = '+';
: $x = [$op] @x;
Nope. That would be parsed as a list of one element, followed by a
syntax error. You'll have to
Can I put an operator in a variable and then use it in the []
reduce meta-operator? Something like:
$op = '+';
$x = [$op] @x;
Rob
On Thu, 5 May 2005, David Wheeler wrote:
> > I can see how to ask for a binary (hence infix) operator, but how
> > do I ask
> > for a prefix or postfix operator specifically, which +<< and >>+ do?
> > Maybe there are Operator::Prefix, etc, roles defined so you can ask
> > for
> > them?
>
> Ask for
On May 5, 2005, at 11:28 , John Williams wrote:
How does [+] know you mean
reduce &infix:<+>, @array;
instead of
reduce &prefix:<+>, @array;
which is nonsense, but the [+] is in a prefix position.
Because [] applies only to infix operators, as I understand it.
With the hyper metaoperator, the
On Wed, 4 May 2005, Larry Wall wrote:
> It would be nice to have an easy-to-access "What's this?" interface
> that could be stitched into your favorite editor to identify what's
> under the cursor, or at least a command like:
>
> p6explain '[+]'
That would make me extremely happy.
> :$sum
On Thu, May 05, 2005 at 07:50:31PM +0200, Ingo Blechschmidt wrote:
: Hi,
:
: sub gen() {
: state $svar = 42;
: # Only initialized once, as it is (per S04) equivalent to
: # state $svar will first{ 42 };
: return { $svar++ };
: }
:
: my $a = gen();# $svar == 42
: $a()
Hi,
sub gen() {
state $svar = 42;
# Only initialized once, as it is (per S04) equivalent to
# state $svar will first{ 42 };
return { $svar++ };
}
my $a = gen();# $svar == 42
$a(); $a(); # $svar == 44
my $b = gen();# $svar == 44
say $b(); # 44
On May 4, 2005, at 23:19 , Larry Wall wrote:
You must have missed the implied "..." at the end of my list of
other WTDI.
You can also do any of:
say "Two" if /hello/;
/hello/ && say "Two";
/hello/ and say "Two";
/hello/ ?? say "Two" :: leave;
infix:(/hello/, { say "Two" })
On Thu, May 05, 2005 at 10:14:34AM +0300, Gaal Yahas wrote:
: On Wed, May 04, 2005 at 11:44:58PM -0700, Larry Wall wrote:
: > : How do I open a file named "-"?
: >
: > Um, depending on what you mean, and whether we continue to support
: > the '=' pseudofile, maybe:
: >
: > $fh = io("-");
: >
Larry Wall <[EMAIL PROTECTED]> wrote:
> It would be nice to have an easy-to-access "What's this?" interface
> that could be stitched into your favorite editor to identify what's
> under the cursor, or at least a command like:
> p6explain '[+]'
s:p5/nice to have/absolutely necessary/ unless $
On 5/5/05, Gaal Yahas <[EMAIL PROTECTED]> wrote:
> On Thu, May 05, 2005 at 01:32:56AM -0600, Luke Palmer wrote:
> > And I don't think arguing in the name of "security" for the default
> > case is going to buy us anything. Security doesn't come in scripts in
> > any language for free; you have to w
On Thu, May 05, 2005 at 01:32:56AM -0600, Luke Palmer wrote:
> On 5/5/05, Gaal Yahas <[EMAIL PROTECTED]> wrote:
> > getopt(...);
> > $fh = open $in, :allowstdio;
>
> Maybe the opposite:
>
> $fh = open $in, :literal;
>
> One of the nice things about the magical "-" behavior is that p
On Thu, 5 May 2005, Stuart Cook wrote:
What I refer to now is something that takes two {coderefs,anonymous
subs,closures} and returns (an object that behaves like) another anonymous
sub, precisely the one that acts like the former followed by the latter
(or vice versa!).
Do you mean like the mathem
On Wed, May 04, 2005 at 11:58:59PM -0600, Luke Palmer wrote:
: On 5/4/05, Larry Wall <[EMAIL PROTECTED]> wrote:
: > [<] could mean "monotonically increasing".
:
: Not unless we make boolean operators magic. There are arguments for
: doing that, but I don't really want to think about how that woul
On Wed, May 04, 2005 at 11:00:46PM -0700, David Wheeler wrote:
: On May 4, 2005, at 22:31 , Larry Wall wrote:
:
: >given "hello" {
: >when /hello/ {
: >say "One";
: >if /hello/ { say "Two"; }
: >if /hello/ { say "Three"; }
: >continue;
:
On May 4, 2005, at 8:13 AM, Uri Guttman wrote:
AS> Why? Because IO::Socket.new takes parameters that are built out
of its
AS> entire inheritance tree, so a change to IO::Handle might
radically
AS> modify the signature of the constructor.
makes sense. we should look at the p5 IO:: tree and
On Wed, May 04, 2005 at 11:44:58PM -0700, Larry Wall wrote:
> : How do I open a file named "-"?
>
> Um, depending on what you mean, and whether we continue to support
> the '=' pseudofile, maybe:
>
> $fh = io("-");
> $fh = open "-";
> $fh = $name eq '-' ?? $*IN :: open $name;
My conc
28 matches
Mail list logo