-setting-library/Str.pod
Log Message:
---
Improve wording about substr-rw aliasing
Thanks to itz++ for pointing out the sentence's meaning.
Am Montag, den 19.10.2009, 16:43 -0700 schrieb Jon Lang:
> Raphael Descamps wrote:
> > I personally don't understand why we don't have a exclude and alias
> > operator in Perl 6 but I have not read all the synopses and don't have
> > an overview.
>
> I don't think that it's explicitly spelled out
Raphael Descamps wrote:
> In the original traits paper the aliasing is not "deep": to respect the
> flattening property, the semantic of the role must not change, so
> aliasing a recursive method will call the original method. It's a known
> theoretical weakness of the
Raphael Descamps wrote:
> I personally don't understand why we don't have a exclude and alias
> operator in Perl 6 but I have not read all the synopses and don't have
> an overview.
I don't think that it's explicitly spelled out anywhere; but the
reason is fairly straightforward: exclude and alias
On 2009-Oct-18, at 3:44 pm, Jon Lang wrote:
David Green wrote:
I would expect that role Logging { method log(Numeric $x:) {...} }
means the invocant is really of type Numeric & Logging, without
Logging having to do Numeric. On the other hand, I can see that
strictly that might not make se
ve to be solved
> explicitly. The traits paper propose 3 different operators to solve
> such conflicts: overriding, excluding or aliasing.
>
> I definitively think that perl 6 roles should also have an excluding
> operator because I think that *every* composition conflicts arrising
&
David Green wrote:
> Jon Lang wrote:
>>
>> This implies that both Logging and Math do Numeric, since the invocant
>> ought to be of a type that the class does.
>
> I would expect that
> role Logging { method log(Numeric $x:) {...} }
> means the invocant is really of type Numeric & Logging, witho
On 2009-Oct-17, at 1:55 am, Jon Lang wrote:
This implies that both Logging and Math do Numeric, since the
invocant ought to be of a type that the class does.
I would expect that
role Logging { method log(Numeric $x:) {...} }
means the invocant is really of type Numeric & Logging, without
David Green wrote:
> Aha, so the bark:(Dog:) syntax identifies the method by its signature as
> well, thus distinguishing it from the .bark:(Tree:) method. This works fine
> when the sigs can distinguish the invocants, which is very common. However,
> I could have ambiguous methods even including
On 2009-Oct-16, at 12:54 am, Richard Hainsworth wrote:
Is there syntactic sugar for aliasing the conflicting method? Eg.
something like
does XML :db-write;
There needs to be something more than sugar: making a new class or
role with different methods will break substitutability. However
does XML;
method xml-db-write ( @_ ) { self.db-write( @_ ) };
};
This seems a bit clunky just to rename a method to prevent a conflict.
Is there syntactic sugar for aliasing the conflicting method? Eg.
something like
does XML :db-write;
Moreover, suppose that the two modules have roles with the same na
methods don't topicalize their invocant.
method bar ($_:) {
.foo();
}
Ahh, does this mean that the auto-aliasing is ditched?
I personally regard $_ as a bit too volatile and if it
is a rw binding it's outright dangerous to not have access
to $?SELF after some topicalizing statem
Ovid skribis 2005-04-10 10:47 (-0700):
> Apologies if this has been covered. What should this do?
> ($x,$y) := ($y,$x);
It would let $x be a second name for the variable that is also called
$y, and $y for $x. The old names $x and $y are overwritten, so
essentially the names for the two variable
Hi all,
Apologies if this has been covered. What should this do?
($x,$y) := ($y,$x);
In Perl5:
$x=2; $y=3;
print "x: $x y: $y\n";
(*::x, *::y) = (*::y, *::x);
$y=4;
print "x: $x y: $y\n";
$x=5;
print "x: $x y: $y\n";
This program shows typeglob
On Fri, Jul 18, 2003 at 06:05:52PM -0400, Benjamin Goldberg wrote:
> What would happen if I used 1,2,3 instead of 1..3? Would it do the same
> thing?
I would think so.
> I wanna know what happens if I do:
>
>@a[0,2,4] = qw/ a b c d e /;
Yup, you're right, I didn't consider non-cont
Benjamin Golberg writes:
> Luke Palmer wrote:
> >
> > > David Storrs wrote:
> > > >
> > > > Thinking about it, I'd rather see lvalue slices become a nicer version
> > > > of C.
> > > >
> > > > my @start = (0..5);
> > > > my @a = @start;
> > > >
> > > > @a[1..3] = qw/ a b c d e /;
>
Dave Whipp wrote:
> "Luke Palmer" wrote:
> > Benjamin Goldberg wrote:
> > > David Storrs wrote:
> > > > @a[1..3] = qw/ a b c d e /;
> > > > print @a; # 0 a b c d e 4 5
> > >
> > > What would happen if I used 1,2,3 instead of 1..3?
> > > Would it do the same thing?
> >
> > Of course.
>
"Luke Palmer" <[EMAIL PROTECTED]> wrote:
> Benjamin Goldberg wrote:
> > David Storrs wrote:
> > > @a[1..3] = qw/ a b c d e /;
> > > print @a; # 0 a b c d e 4 5
> >
> > What would happen if I used 1,2,3 instead of 1..3? Would it do the same
> > thing?
>
> Of course.
I tend to agree, I
Luke Palmer wrote:
>
> > David Storrs wrote:
> > >
> > > Thinking about it, I'd rather see lvalue slices become a nicer version
> > > of C.
> > >
> > > my @start = (0..5);
> > > my @a = @start;
> > >
> > > @a[1..3] = qw/ a b c d e /;
> > > print @a; # 0 a b c d e 4 5
> >
>
> David Storrs wrote:
> >
> > Thinking about it, I'd rather see lvalue slices become a nicer version
> > of C.
> >
> > my @start = (0..5);
> > my @a = @start;
> >
> > @a[1..3] = qw/ a b c d e /;
> > print @a; # 0 a b c d e 4 5
>
> What would happen if I used 1,2,3 instead
David Storrs wrote:
>
> Thinking about it, I'd rather see lvalue slices become a nicer version
> of C.
>
> my @start = (0..5);
> my @a = @start;
>
> @a[1..3] = qw/ a b c d e /;
> print @a; # 0 a b c d e 4 5
What would happen if I used 1,2,3 instead of 1..3? Would it do
--- David Storrs <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 08, 2003 at 05:52:04PM -0700, Austin Hastings wrote:
> >
> > --- Jonadab the Unsightly One <[EMAIL PROTECTED]> wrote:
> > > Am I now thinking clearly?
> > >
> > I don't think so.
> >
> > If you've created two separate arrays that happen
On Tue, Jul 08, 2003 at 05:52:04PM -0700, Austin Hastings wrote:
>
> --- Jonadab the Unsightly One <[EMAIL PROTECTED]> wrote:
> > Am I now thinking clearly?
> >
> I don't think so.
>
> If you've created two separate arrays that happen to start with related
> values, then the changes to the first
--- Jonadab the Unsightly One <[EMAIL PROTECTED]> wrote:
> "Jonadab the Unsightly One" <[EMAIL PROTECTED]> writes:
>
> > Does this imply, though, that it's pointing to specific elements,
>
> Wow, I wasn't paying attention to what I was thinking there.
> Obviously it points to specific elements,
"Jonadab the Unsightly One" <[EMAIL PROTECTED]> writes:
> Does this imply, though, that it's pointing to specific elements,
Wow, I wasn't paying attention to what I was thinking there.
Obviously it points to specific elements, because the subscripts used
to create a slice don't have to be sequen
David Storrs <[EMAIL PROTECTED]> writes:
> my $r_slice = [EMAIL PROTECTED];
> @$r_slice = qw/ a b c d e /;
> print @a; # 0 a b c d e 4 5
This seems right to me. It would take approximately no time to get
used to this semantic, IMO.
> # Note that it does NOT modify in r
Thinking about it, I'd rather see lvalue slices become a nicer version
of C.
my @start = (0..5);
my @a = @start;
@a[1..3] = qw/ a b c d e /;
print @a; # 0 a b c d e 4 5
# Similarly:
@a = @start;
my $r_slice = [EMAIL PROTECTED];
@$r_slice = qw/ a b c
On 5 Jul 2003, Luke Palmer wrote:
> > return [EMAIL PROTECTED] $begin .. $end ];
>
> I fear that this might take a reference to each element in the slice,
> rather than a reference to the slice
Yes, that would indeed return a list of refs in perl5. Can it also be
assumed that the magic hy
> > On Sat, Jul 05, 2003 at 09:51:29AM -0600, Luke Palmer wrote:
> >
> > > Actually, you can't reference a slice! Where the heck does the
> > > reference point? I would probably do:
> >
> > Of course not. I presume it points to something non-existent just like
> > a substring reference would in
> On Sat, Jul 05, 2003 at 09:51:29AM -0600, Luke Palmer wrote:
>
> > Actually, you can't reference a slice! Where the heck does the
> > reference point? I would probably do:
>
> Of course not. I presume it points to something non-existent just like
> a substring reference would in perl5 :-)
>
On Sat, Jul 05, 2003 at 09:51:29AM -0600, Luke Palmer wrote:
> Actually, you can't reference a slice! Where the heck does the
> reference point? I would probably do:
Of course not. I presume it points to something non-existent just like
a substring reference would in perl5 :-)
$ perl -le '$a =
> On Fri, 4 Jul 2003, Damian Conway wrote:
>
> > > Will it be possible (or sane even) to bind a variable to an array slice
> > It *should* be, since it's possible (if ungainly) to do it in Perl 5:
>
> Ouch, blatant abuse of perl5's aliasing with @_ and glob
On Fri, 4 Jul 2003, Damian Conway wrote:
> > Will it be possible (or sane even) to bind a variable to an array slice
> It *should* be, since it's possible (if ungainly) to do it in Perl 5:
Ouch, blatant abuse of perl5's aliasing with @_ and globs ;) Can I also
assume tha
Dan Brook wrote:
Will it be possible (or sane even) to bind a variable to an array slice
It *should* be, since it's possible (if ungainly) to do it in Perl 5:
use Data::Dumper 'Dumper';
@bar = (1,2,3);
*foo = (sub [EMAIL PROTECTED])->(@bar[1,0,3]);
print Dumper [EMAIL PROTECTED];
> Will it be possible (or sane even) to bind a variable to an array slice
> e.g
>
> ## correct syntax?
> my @array = << a list of values >>;
>
> my @array_slice := @array[ 1 .. @array.end ];
Yeah, that'll work. It has to, lest:
my [EMAIL PROTECTED] := (1, 1, map { $^a + $^b } zip(@fi
Will it be possible (or sane even) to bind a variable to an array slice
e.g
## correct syntax?
my @array = << a list of values >>;
my @array_slice := @array[ 1 .. @array.end ];
Or would this merely bind @array_slice to the list returned by the slice,
or would it DTRT (in my eyes at least)
;
>for $a, $b <- @foo { ... } # "for $a and $b from @foo..."
All else aside, I think that a <- will not
fly. It's too easily read as greater-than-unary-minus
-Erik
>
>(heck, that even looks like shifting -- "shifty aliasing". The A4 syntax
>look
On Saturday, February 8, 2003, at 02:53 AM, Luke Palmer wrote:
If you're talking about your own C example, actually, this would
match it better:
grep $x <- @list { $x eq 3 }
But if you're talking about A4's:
grep @list -> $x { $x eq 3 }
Which is very close to (one of) the currently v
ll or good):
>
> for $a, $b <- @foo { ... } # "for $a and $b from @foo..."
>
> (heck, that even looks like shifting -- "shifty aliasing". The A4 syntax
> looks like popping until you realize it is really shoving the left N
> thingees into the contain
t even looks like shifting -- "shifty aliasing". The A4 syntax
looks like popping until you realize it is really shoving the left N
thingees into the containers on the right -- Syntactical Action at a
Distance).
Then, A4 gives this example of C:
grep -> $x { $x eq 3 } @
--
On Sun, 08 Sep 2002 22:24:11
Damian Conway wrote:
>
>Think of it as punctuation. As a necessary alternative to the poor
>overworked colon.
>
Or the poor overworked dot?
>
>
>> it all looks the same to me. And I like different things to look different.
>
>A fair point. My counterargume
Steve Canfield wrote:
> I was under the impression that compile time properties, like runtime
> properties, can be arbitrarily invented and/or assigned.
Yes, but not purely lower-case ones. They're reserved for Perl 6 itself.
(i.e. only Larry can invent/assign them ;-)
> If that is
> correct,
>From: Uri Guttman <[EMAIL PROTECTED]>
>that is not a variable property so it should be
>a compile time error.
I was under the impression that compile time properties, like runtime
properties, can be arbitrarily invented and/or assigned. If that is
correct, why would "my $var is true", meaningle
Erik Steven Harrison wrote:
> But still, what counts as a runtime property, other than true or
> false, as in the delightful '0 but true'? What other kind of runtime
> labels can I slap on a value?
Here's ten to start with...
for <> but tainted(0) {...} # note that external data
Erik Steven Harrison wrote:
> Just found this hidden in my inbox.
> I didn't think anyone was paying attention ;-).
Oh, we *always* pay attention. We just don't always respond. ;-)
>>What I most like about the C syntax is (like methods in
>>OO Perl), it associates a meaningful *name* with e
> "SC" == Steve Canfield <[EMAIL PROTECTED]> writes:
SC> Would it be accurate to say that "is" sets properties of variables,
SC> whereas "but" sets properties of values? If so, what would this output:
SC> my $var is true;
that is not a variable property so it should be a compile tim
>From: Trey Harris <[EMAIL PROTECTED]>
>To: Steve Canfield <[EMAIL PROTECTED]>
> > I would expect it to output "false".
>
>Why? I believe that, whatever you set $var to, you have marked the
>variable as constantly true in booleans.
Because in my experience variables are not true or false. They
In a message dated Sun, 8 Sep 2002, Steve Canfield writes:
> Would it be accurate to say that "is" sets properties of variables, whereas
> "but" sets properties of values? If so, what would this output:
>
> my $var is true;
> $var=0;
> if ($var) {print "true"}
> else {print "false"}
>
> I
Would it be accurate to say that "is" sets properties of variables, whereas
"but" sets properties of values? If so, what would this output:
my $var is true;
$var=0;
if ($var) {print "true"}
else {print "false"}
I would expect it to output "false".
__
Peter Behroozi wrote:
>> sub hidden (str $name, int $force is aka($override)) {...}
>
>
> Hang on a moment! In your original answer to this question, you used
> the "is named('alias')" syntax, but now you are suggesting using the
> sigil in the syntax.
Yes, but for a *different* property.
> Damian Conway wrote:
> >>And is the is/but distinction still around?
> >
> >Oh, yes.
>
> Could someone please reference where this decision was
> made. I do not find any information describing the distinction.
The following May 2001 post was related. Poke around the
thread it was in, especial
Damian Conway wrote:
>>And is the is/but distinction still around?
>
>Oh, yes.
Could someone please reference where this decision was made. I do not find
any information describing the distinction.
Steve
_
Join the worlds larges
--
On Thu, 05 Sep 2002 09:26:08
Damian Conway wrote:
>Erik Steven Harrison wrote:
>
>
>> Is it just me or is the 'is' property syntax a little
>> too intuitive? Seems like everywhere I turn, the
>> proposed syntax to solve a problem is to apply a
>> property.
>
>That's because most of th
reposted because my mailer is evil
--
On Thu, 05 Sep 2002 09:31:45
Damian Conway wrote:
>Erik Steven Harrison wrote:
>
>> I know that the property syntax is pseudo established,
>> but I'm beggining to become a bit jaded about all the
>> built in properties were building. What about good ol'
--
On Thu, 05 Sep 2002 09:31:45
Damian Conway wrote:
>Erik Steven Harrison wrote:
>
>> I know that the property syntax is pseudo established,
>> but I'm beggining to become a bit jaded about all the
>> built in properties were building. What about good ol'
>> aliases?
>>
>> sub hidden (s
Erik Steven Harrison:
# But still, what counts as a runtime property, other than true or
# false, as in the delightful '0 but true'? What other kind of runtime
# labels can I slap on a value?
These occur to me:
$foo=0 but string("zero");
$bar='foobar' but num(1);
$baz=1
On Thu, 2002-09-05 at 04:31, Damian Conway wrote:
>sub hidden (str $name, int $force is aka($override)) {...}
Hang on a moment! In your original answer to this question, you used
the "is named('alias')" syntax, but now you are suggesting using the
sigil in the syntax. So, should it really b
Erik Steven Harrison wrote:
> I know that the property syntax is pseudo established,
> but I'm beggining to become a bit jaded about all the
> built in properties were building. What about good ol'
> aliases?
>
> sub hidden (str $name, int $force := $override) {...}
I'm not keen on it becaus
Erik Steven Harrison wrote:
> Is it just me or is the 'is' property syntax a little
> too intuitive? Seems like everywhere I turn, the
> proposed syntax to solve a problem is to apply a
> property.
That's because most of the problems we're discussing are solved
by changing the semantics of
> sub hidden (str $name, int $force is aka($override))
>{ ... }
I know that the property syntax is pseudo established,
but I'm beggining to become a bit jaded about all the
built in properties were building. What about good ol'
aliases?
sub hidden (str $name, int $force := $override)
{
Somewhere, in another thread . . .
Dr. Claw wrote . . .
>> sub hidden (str $name, int $force is aka($override))
>>{ ... }
>
>Yeah, that's what I meant.
Is it just me or is the 'is' property syntax a little
too intuitive? Seems like everywhere I turn, the
proposed syntax to solve a problem
[EMAIL PROTECTED] wrote:
>> sub hidden (str $name, int $force, int $override is aka($force))
>> { ... }
>
>
> Would the following be simpler...?
>
> sub hidden (str $name, int $force is aka($override))
>{ ... }
Yeah, that's what I meant.
Sorry. I've travelled 14,000 miles and given 93
From: Damian Conway [EMAIL PROTECTED]
> If it were allowed, it would probably be done
> via properties instead:
>
> sub hidden (str $name, int $force, int $override is aka($force))
>{ ... }
How does this method affect the non-parameter-based calling scheme? It
looks like it is possible to
From: Damian Conway [EMAIL PROTECTED]
> If it were allowed, it would probably be done
> via properties instead:
>
> sub hidden (str $name, int $force, int $override is aka($force))
>{ ... }
Would the following be simpler...?
sub hidden (str $name, int $force is aka($override))
{ ... }
Peter Behroozi wrote:
> Has anyone considered a syntax for allowing subroutines to have many
> different names for the same argument?
If it were allowed, it would probably be done via properties instead:
sub hidden (str $name, int $force, int $override is aka($force)) { ... }
Damian
From: Peter Behroozi [EMAIL PROTECTED]
> Has anyone considered a syntax for allowing
> subroutines to have many different names for
> the same argument? For example, in CGI.pm, many
> methods support the "-override" parameter but
> can also accept the alias of "-force":
Yes. See the thread start
Hello All,
Has anyone considered a syntax for allowing subroutines to have many
different names for the same argument? For example, in CGI.pm, many
methods support the "-override" parameter but can also accept the alias
of "-force":
$cgi->hidden(-name => "a", -override => 1); #same as
$cgi->hi
Uri asked:
> but what if there are multiple bound variables like this example:
>
> for %phonebook.kv -> $name, $number {
> print "$name: $number\n"
> }
>
> is $_ aliased to either/both/neither of the two topics? are those now
> not topics but just aliased variabl
from exegesis 4:
In Perl 6, the current topic -- whatever its name and however
you make it the topic -- is always aliased to $_.
and one of the examples is:
for @list -> $next {# iterate @list, aliasing each element to
# $next (
\%foo = \%bar is fine with me, it's the "is alias" I was a little worried
about.
Ilya
-Original Message-
From: David L. Nicol
To: Sterin, Ilya
Cc: 'Davíð Helgason '; '[EMAIL PROTECTED] '; 'John Porter '
Sent: 07/24/2001 5:45 PM
Subject: Re:
Sent: 7/20/01 2:25 PM
Subject: Sv: aliasing a value in a while each loop
John Porter wrote:
> Perhaps a simple
>
> alias( %foo, %bar );
>
> for those times when you really just need a simple WTDI!
Would
alias %foo = %bar;
not be ok, 'alias' acting and bindin
John Porter wrote:
> Perhaps a simple
>
> alias( %foo, %bar );
>
> for those times when you really just need a simple WTDI!
Would
alias %foo = %bar;
not be ok, 'alias' acting and binding like 'my' of course. Or
my %foo is alias = %bar;
No?
/davíð
David L. Nicol wrote:
>
>Are there really situations where
>
> $$reference = An Expression;
>
>is clearer than
>
> $reference = \(An Expression);
>
>?
Eric is confused. I don't know about in Perl 6-to-be, but in Perl 5
those two mean totally different things:
$foo = \$bar;
David L. Nicol wrote:
> No, that does not work:
Right; I misunderstood what was wanted.
--
John Porter
David L. Nicol wrote:
> Assignment to a nonexistent reference becomes an
> alias instead of a copy.
Uh, I dunno. Like Python/Ruby, but without the consistency.
I think special constructs -- defined as NOT doing assignment
-- should be allowed to set up aliases. This includes, e.g. for().
P
/20/2001 1:38 PM
Subject: aliasing a value in a while each loop
"Mark J. Reed" wrote:
>
> Well, other than the fact that the while(each) doesn't do aliasing.
> Since that would be the whole point, ignore that last message.
>
> On Fri, Jul 20, 2001 at 01:21:57PM -0400
> Sounds like what we really want is a form of "for" which can iterate
> over a list of hashes or arrays:
>
> for my @a ( @foo, @bar ) { ...
>
> for my %h ( %foo, %bar ) { ...
Yes.
Isn't the underlying issue in the above how perl6 handles manipulation
and ali
> Why would you want it to print Monkey Hero, I would expect $_ to be
> localized, rather than global, which could prove more convenient.
No, it's still localized.
But the With would mean that $_ in a way becomes a normal variable like $foo
was, and the $foo is now the 'default variable'.
ce option, in my opinion it's useless, but if
was implemented this could be a way:)
Ilya
-Original Message-
From: 'John Porter '
To: [EMAIL PROTECTED]
Sent: 07/19/2001 1:46 PM
Subject: Re: what's with 'with'? (was: [aliasing - was:[nice2haveit]])
Sterin, Ily
Sterin, Ilya wrote:
> Well then maybe $_ can be a reference to a multidimensional array or hash,
> and temp vars can be access like this.
>
> for ( @foo, @bar ) {
> print "$_->[0] : $_->[1]\n";
> }
That's bizarre and unnecessary. We can already do this:
for ( \@foo, \@bar ) {
print "$_
Why would you want it to print Monkey Hero, I would expect $_ to be
localized, rather than global, which could prove more convenient.
Ilya
-Original Message-
From: Stuart Rocks
To: [EMAIL PROTECTED]
Sent: 07/19/2001 1:13 PM
Subject: Re: what's with 'with'? (was:
Bart Lateur wrote:
> So, in this case, a "with" synonym for "for" would work.
>
> But this only works for scalars. You can't have a %foo alias to
> %Some::Other::hash this way, or a @bar alias to @Some::Other::array.
Sounds like what we really want is a form of "for" which can iterate
over a lis
> But can someone reiterate the
> difference between the above and
>
> for($foo){
>print "I am not a $foo\n";
> # or:
>print "I am not a ";
>print;
> }
Try this under the current for system, cause it's unclear what will happen
for those new to Perl:
$foo="monkey"; $_=" coward";
Agree. I think that with() should only be used with object references only,
and $_ should be set accordingly.
Ilya
-Original Message-
From: John Porter
To: [EMAIL PROTECTED]
Sent: 07/19/2001 1:01 PM
Subject: Re: aliasing - was:[nice2haveit]
Sterin, Ilya wrote:
> But I thought t
: John Porter
To: [EMAIL PROTECTED]
Sent: 07/19/2001 12:59 PM
Subject: Re: what's with 'with'? (was: [aliasing - was:[nice2haveit]])
I believe what is really wanted is for "for" to be able to iterate
over lists of arrays or hashes:
for my @i ( @foo, @bar ) { ...
Sterin, Ilya wrote:
> But I thought this was related to more than just with(), so if we have
>
> ### Would now have to be printed as
>
> print "This is number ";
> print;
> print " of 10\n";
>
> I still believe that although not defining a variable source will use the
> temp variable there is s
> Like "I am not a
> coward" which can be easily done with print "I am not a $_"; will now have
> to be written in two separate lines, and possibly more if there is more to
> follow.
>
> Ilya
Um, of course the original way is still possible!
I believe what is really wanted is for "for" to be able to iterate
over lists of arrays or hashes:
for my @i ( @foo, @bar ) { ...
for my %i ( %foo, %bar ) { ...
with real aliasing occuring.
If @_ and %_ are the default iterator variables, then imagine:
for
I question this too, since as you mentioned with, in my experience works
nicely to reference and object like
with(object)
{
.foo();
.bar();
}
Ilya
-Original Message-
From: Mark Koopman
To: [EMAIL PROTECTED]
Sent: 07/19/2001 12:42 PM
Subject: Re: what's with 'with'?
es, and possibly more if there is more to
follow.
Ilya
-Original Message-
From: Garrett Goebel
To: 'Stuart Rocks'; [EMAIL PROTECTED]
Sent: 07/19/2001 12:34 PM
Subject: what's with 'with'? (was: [aliasing - was:[nice2haveit]])
From: Stuart Rocks [mailto:[EMAIL PROTECTED]
cks
To: [EMAIL PROTECTED]
Sent: 07/19/2001 11:31 AM
Subject: Re: aliasing - was:[nice2haveit]
> >Then how would you write "I am not a coward"
>
> with ($foo)
> {
> print "I am not a"; ##What do I use here or do I have to issue a
>#
Garrett Goebel wrote:
> From: Stuart Rocks [mailto:[EMAIL PROTECTED]]
>
>>Both the following would work:
>>
>>with($foo){
>> print "I am not a $foo\n";
>> # or:
>> print "I am not a ";
>> print;
>>}
>>
>
> Okay... I've been mostly ignoring this thread. But can someone reiterate the
> d
From: Stuart Rocks [mailto:[EMAIL PROTECTED]]
>
> Both the following would work:
>
> with($foo){
>print "I am not a $foo\n";
> # or:
>print "I am not a ";
>print;
> }
Okay... I've been mostly ignoring this thread. But can someone reiterate the
difference between the above and
for
> >Then how would you write "I am not a coward"
>
> with ($foo)
> {
> print "I am not a"; ##What do I use here or do I have to issue a
>##separate print like...
> print;
> }
>
> Ilya
Well in Perl5, for the print to use default value it's just 'print;'. The
same applie
Stuart Rocks wrote:
>>
>> C would also make the [variable, alias, whatever]
>> default, but not replace the $_:
>>
>> $_ = "monkey ";
>> $foo = "coward";
>> with ($foo){
>> print;
>> print "$_";
>> }
>>
>> would output "monkey coward".
>okay, "coward" is default but $_ has not been r
> > So, in this case, a "with" synonym for "for" would work.
> >
> Particularly if '$_' was implied... So with Perl 6's '.' replacing '->',
> and 'with' aliasing 'for':
>
>with ( $XL.{Applic
> > So, in this case, a "with" synonym for "for" would work.
> >
> Particularly if '$_' was implied... So with Perl 6's '.' replacing '->',
> and 'with' aliasing 'for':
>
>with ( $XL.{Applic
>> Does such a thing exist already?
>
>A WTDI exists already:
>
>for ( $XL->{Application}->{ActiveSheet} ) {
> $_->cells(1,1) = "Title";
> $_->language() = "English";
>}
>
>(presuming lvalue-methods, of course...)
So, in this case, a "with" synonym for "for" would work.
]- OR
resuming lvalue-methods, of course...)
>
> So, in this case, a "with" synonym for "for" would work.
>
Particularly if '$_' was implied... So with Perl 6's '.' replacing '->',
and 'with' aliasing 'for':
On Wed, 18 Jul 2001 09:00:25 -0400, John Porter wrote:
>> Does such a thing exist already?
>
>A WTDI exists already:
>
>for ( $XL->{Application}->{ActiveSheet} ) {
> $_->cells(1,1) = "Title";
> $_->language() = "English";
>}
>
>(presuming lvalue-methods, of course...)
So, in th
1 - 100 of 103 matches
Mail list logo