"David L. Nicol" wrote:
> Ken Fox wrote:
> > IMHO, curries have nothing to do with this. All "with" really does is
> > create a dynamic scope from the contents of the hash and evaluate its
> > block in that scope.
...
> But that doesn't give us the speed win we want from compiling offset lookups
>
> "Bart" == Bart Lateur <[EMAIL PROTECTED]> writes:
Bart> On Tue, 22 Aug 2000 00:03:48 -0600 (MDT), Nathan Torkington wrote:
>> Normally what you'd say is:
>>
>> with (%record) {
>>
>> }
>>
>> (look at me, using Larry's new ... operator :-)
Bart> No you didn't. You typed four dots.
T
-Original Message-
From: Bart Lateur [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 23, 2000 7:00 PM
To: [EMAIL PROTECTED]
Subject: Re: PROTOPROPOSAL FOR NEW BACKSLASH was Re: implied pascal-like
"with" or "express"
On Tue, 22 Aug 2000 00:03:48 -0600 (MDT), Nat
On Thu, 24 Aug 2000 02:02:06 +0200, Markus Peter wrote:
>$one{two\three\four} instead of $$$one{two}{three}{four}
Isn't that
$one{two}{three}{four}
--
Bart.
On Tue, 22 Aug 2000 00:03:48 -0600 (MDT), Nathan Torkington wrote:
>Normally what you'd say is:
>
> with (%record) {
>
> }
>
>(look at me, using Larry's new ... operator :-)
No you didn't. You typed four dots.
--
Bart.
> And that's just too much punctuation for too little value.
>
> How special purpose is "with"? Do people envision using it *only* on
> hashes? (I did until this email) If so, I like Damian's version best:
>
> http://www.mail-archive.com/perl6-language@perl.org/msg02649.html
-Original Message-
From: Jonathan Scott Duff [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 23, 2000 1:06 PM
To: David L. Nicol
Cc: Nathan Torkington; [EMAIL PROTECTED]
Subject: Re: PROTOPROPOSAL FOR NEW BACKSLASH is still Re: implied
pascal-like"with" or "express&quo
From: "Damian Conway" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, August 18, 2000 12:56 AM
Subject: Re: implied pascal-like "with" or "express"
> Aha! How about this...which would give us your desired C
functionality
> *and* solve a n
On Wed, Aug 23, 2000 at 12:45:06PM -0500, David L. Nicol wrote:
> with %container {
> ->$fieldname = $value;
> ${->destinationvaluename} = ->value_to_put_there
> }
Then I'd've expected that to have been:
with \%container {
->{$fieldname} = $value;
${->
Thanks, the actual effects of \ in doublequotes slipped my mind.
Nathan Torkington gracefully extolled:
> I'd be more receptive to something that reuses existing or similar
> Perl syntax (e.g., extend ->).
with %container {
->$fieldname = $value;
${->destinationvaluename}
Correct me if I'm wrong here, but I think what David wanted was an easy way
to reference other keys of an hash while creating one, ie:
How to do this, in a line:
%h = ( first => 10 );
$h{second} = $h{first} * 2;
Because, as I'm sure you know, this code (when run w/out strict):
David L. Nicol writes:
> Do either of those expressions make sense in terms of
> references to something? If not, then syntactically we
> are in the clear. They don't, because currently it makes
> no sense to butt a reference up to the LHS of anything.
>
> It isn't any less clear than, for inst
On Wed, Aug 23, 2000 at 12:17:18AM +, David L. Nicol wrote:
> Nathan Torkington wrote:
> > The precedent of "if you're doing a hash
> > lookup, use {} around the key" is fairly well-ingrained in Perl.
>
> I don't care how "ingrained" the concept of wrapping the
> field names in curlies is, I
Nathan Torkington wrote:
> Except that you often don't know the keys in advance, and so now
> your code turns into:
>
> with %one\$keytwo {
> push @\$keythree\$keyfour, 5, 6;
> }
>
> which is decided sub-clear.
Do either of those expressions make sense in terms of
references to some
David L. Nicol writes:
> okay but we still have the hiding issue, in case we want it to
What's the hiding issue? I must have missed that.
> $one{two} is $one\two
> $$one{two}{three} is $one\two\three
> $$$one{two}{three}{four} is $one\two\three\four
Your le
On Tue, 22 Aug 2000, David L. Nicol wrote:
> And you dont have to make sure the $s on the left of the names match
> the {}s on the right, just use one $ and string the names together with
> backslashes. This is not easier?
>
>
> $one{two} is $one\two
> $$one{two}{three}
Nathan Torkington wrote:
> # making this part up
> struct Person => [ qw(Name Age Height Weight) ];
> # but once you have a named structure, you can say ...
> my Person %nat;
> with (%nat) {
> $Name = "Nathan"; # rewritten to $nat{Name} at compile-time
> ...
> }
>
> It's ki
Markus Peter writes:
> > use %record{
> >
> > $\interest_earned += $\balance * $\rate_daily;
> > };
Guys, where in the sweet name of Jesus did this awful syntax
come from?
For a start,
%start{ }
is only analogous to a slice operation. It has no precedent in
Perl.
Normally what
--On 18.08.2000 14:36 Uhr -0700 David L. Nicol wrote:
> How about backslash, after the type-qualifier?
>
> use %record{
>
> $\interest_earned += $\balance * $\rate_daily;
> };
I don't really like having backslashes in front of ordinary characters
anywhere except when I mean them :-) (\n,
Ken Fox wrote:
> IMHO, curries have nothing to do with this. All "with" really does is
> create a dynamic scope from the contents of the hash and evaluate its
> block in that scope.
Right, the "with" people are using ^hats because its an available
operator, just the same way the "curry" people
Ken Fox wrote:
> Dave Storrs wrote:
> > On Thu, 17 Aug 2000, Jonathan Scott Duff wrote:
> > > BTW, if we define C to map keys of a hash to named place holders
> > > in a curried expression, this might be a good thing:
> > >
> > > with %person {
> > > print "Howdy, ", ^firstname, "
Dave Storrs wrote:
> On Thu, 17 Aug 2000, Jonathan Scott Duff wrote:
> > BTW, if we define C to map keys of a hash to named place holders
> > in a curried expression, this might be a good thing:
> >
> > with %person {
> > print "Howdy, ", ^firstname, " ", ^lastname;
> > }
> >
Dave Storrs wrote:
> The following words could also be overloaded for this purpose:
> map, use
I think I like
use %record{
is a macro that expands to
{my \%_ = \%record;
even better than the same thing without the key word.
> What if the hash keys we want to use are not valid scalar names? For example,
> I've had keys like "total - female" as keys, but using the ^ syntax
> would fail on this...
^{"total - female"}, just like $ variables.
Damian
On Fri, 18 Aug 2000, Jonathan Scott Duff wrote:
> On Fri, Aug 18, 2000 at 10:39:36AM -0500, Brian Wheeler wrote:
> > "Using" might be an interesting alternative
>
> Reminds me of BASIC :-)
Works for me.
> > What if the hash keys we want to use are not valid scalar names? For examp
On Fri, Aug 18, 2000 at 10:39:36AM -0500, Brian Wheeler wrote:
> "Using" might be an interesting alternative
Reminds me of BASIC :-)
> What if the hash keys we want to use are not valid scalar names? For example,
> I've had keys like "total - female" as keys, but using the ^ syntax
> would fai
I've usually been lurking, but I have a few thoughts
>
> On Thu, 17 Aug 2000, Jonathan Scott Duff wrote:
>
> > BTW, if we define C to map keys of a hash to named place holders
> > in a curried expression, this might be a good thing:
> >
> > with %person {
> > print "How
On Thu, 17 Aug 2000, Jonathan Scott Duff wrote:
> BTW, if we define C to map keys of a hash to named place holders
> in a curried expression, this might be a good thing:
>
> with %person {
> print "Howdy, ", ^firstname, " ", ^lastname;
> }
>
> # becomes
> sub {
Damian Conway <[EMAIL PROTECTED]> writes:
> Okay, what if C simply aliased its hash argument to a
> localized %_ (remember that one?):
>
> with (%ws) {
> print $_{height}; # prints $ws{height}
> print $height; # perl5 visibility rules
>
> Mmm... yummy... And placeholder names seem to be getting a real
> role in life too! I wonder if hashes used as HOF arguments in
> general should use placeholder names to fill in their arguments
> from the corresponding hash elements. That would be even yummier!
Personally I think an
Damian Conway wrote:
> Suppose C were a built-in function with parameter list:
>
> sub with (\%; ^&) {...}
>
> That is, C takes an explicit hash and -- optionally -- a block, sub
ref,
> or higher order function.
> <...>
> If C is called with *both* a hash and a block/sub ref/h.o.f. as
> arguments,
> On Thu, Aug 17, 2000 at 10:48:25PM -0500, David L. Nicol wrote:
> > Lets use hats again then.
> >
> > %ws{
> > print ^$height; #prints $ws{height}
> > print $height; # perl5 visibility rules
> > };
>
> But no $ for the keys of %ws.
>
>
Jonathan Scott Duff wrote:
> But no $ for the keys of %ws.
>
> %ws {
> print ^height; # prints $ws{height}
> print $height; # prints $height
> }
I'm thinking that ^name is short for $^name is short for ${^name}
and the longer version is what you
On Thu, Aug 17, 2000 at 10:48:25PM -0500, David L. Nicol wrote:
> Lets use hats again then.
>
> %ws{
> print ^$height; #prints $ws{height}
> print $height; # perl5 visibility rules
> };
But no $ for the keys of %ws.
%ws {
print ^heigh
> Lets use hats again then.
>
>%ws{
>print ^$height; #prints $ws{height}
>print $height; # perl5 visibility rules
>};
>
> AFAIK, the entirety of %name{something here} is unplowed ground, as
> far as perl syntax goes.
For good reason, A
Jeremy Howard wrote:
>
> This is one of those
> few cases where VB has nicer syntax--within a 'with' block you have to
> precede a property name with '.' to get the with block scope:
>
> dim height as double
> dim ws as new Excel.worksheet // 'worksheet' has a 'height' property
>
> with
David L. Nicol wrote:
> Yes, absolutely, about the semantics.
>
> About the syntax, how about just in a block behind %HASHNAME?
>
> (as long as it doesn't use $a and $b, of course )
> (or if the insta-sort thing needs "sort" written in and this doesn't)
>
> %record{
>
> $something_new = 3; # just
37 matches
Mail list logo