On Sat, 04 Dec 2004 08:01:46 -0700, [EMAIL PROTECTED] (David Green) wrote:
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Larry Wall) wrote:
S9 talk about it. We current have things like:
my Cat %pet is shape(Str);
and parameters to types are in square brackets, so it's more like:
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Larry Wall) wrote:
Maybe type parameters are just subscripts? [...]
my Fight %fight does key{Dog;Cat};
I like that.
But if English-like is the criterion that'd still read better as
my Fight %fight has key{Dog;Cat};
I like that even
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Matt Diephouse) wrote:
On Sat, 04 Dec 2004 08:59:24 -0700, David Green [EMAIL PROTECTED] wrote:
Cdoes Iterate signifies a role named Iterate. Roles are sort of a
mix of interfaces and mixins (as I understand it -- I'm still waiting
for E12). So
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Smylers) wrote:
No! Avoid synonyms. They're initially tempting, because then everybody
gets to pick the one he/she wants to use, but then it turns out you need
to learn all of them so as to read other people's code, and that's worse
than not
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Luke Palmer) wrote:
But what we'd really like to do is: given the user knows what push/pop
do, what would they *guess* to mean shift (I tend to think that this
is a very good technique for naming).
And, well, I'm thinking pull. So it's a
David Green writes:
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Larry Wall) wrote:
Maybe type parameters are just subscripts? [...]
my Fight %fight does key{Dog;Cat};
I like that.
Yeah, me too. Except I'm having trouble seeing how key is a role. It's
not adding anything into a
David Green writes:
I guess we could always use prepend/append, pull/pop.
No! Cpush and Cpop are a well-defined pair, not just in Perl, for
dealing with stacks; we should keep those as they are. (And no
synonyms, before somebody suggests any!)
Smylers
Larry Wall wrote:
But here's the kicker. The null filename can again represent the
standard filter input, so we end up with Perl 5's
while () {...}
turning into
for = {...}
Two more issues: idiom, and topification
= Topification:
There are cases in P5 when I *don't* want
while ()
Smylers wrote:
Larry Wall writes:
But then are we willing to rename shift/unshift to pull/put?
Yes. Cunshift is a terrible name; when teaching Perl I feel
embarrassed on introducing it.
No!
But I'd be willing to rename them to get/put.
'Pull' is the opposite of 'push', but 'pop'
On Dec 6, 2004, at 7:38 AM, Austin Hastings wrote:
for = {...}
I dub the...the fish operator!
:-)
David
On Mon, Dec 06, 2004 at 05:43:16AM +, Nigel Sandever wrote:
: I probably missed teh comprehensive dismissal thread, but why not 'type'?
:
: my %pet is Hash[:type(Str) :returns(Cat)];
Well, type is just a little off in a couple of ways. On the one hand,
it's not specific enough,
On Mon, Dec 06, 2004 at 09:06:22AM -0800, David Wheeler wrote:
: On Dec 6, 2004, at 7:38 AM, Austin Hastings wrote:
:
:for = {...}
:
: I dub the...the fish operator!
:
: :-)
Mmm. Next thing you'll know, people will name their files oddly just so
they can write things like:
for =///º
On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote:
: Two more issues: idiom, and topification
:
: = Topification:
:
: There are cases in P5 when I *don't* want
:
: while () {...}
:
: but prefer
:
: while ($input = ) {...}
:
: so that I can have something else be the
On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote:
: = Idiom:
:
: The other concern is idiom. Using Cfor suggests start at the
: beginning, continue to the end. OTOH, using Cwhile is a little
: weaker -- keep doing this until it's time to stop. Obviously they'll
: usually be
Or even the dead fish operator:
while =###x - $net {...}
And here's a flounder:
while =:
Larry
On Mon, Dec 06, 2004 at 10:45:22AM -0500, Austin Hastings wrote:
: But I'd be willing to rename them to get/put.
If I went with get, the opposite would be unget for both historical
and huffmaniacal reasons.
Larry
David Wheeler wrote:
On Dec 6, 2004, at 7:38 AM, Austin Hastings wrote:
for = {...}
I dub the...the fish operator!
:-)
Back before there was a WWW, I used an editor called tgif. It was
written in france, and part of the idiom was to have two GUI buttons
showing respectively the head ( * )
Austin Hastings writes:
The other concern is idiom. Using Cfor suggests start at the
beginning, continue to the end. OTOH, using Cwhile is a little
weaker -- keep doing this until it's time to stop. Obviously they'll
usually be used in the same way:
for = {...} vs. while () {...}
On Mon, 6 Dec 2004, Larry Wall wrote:
Hmm. Also says maybe you could attach a block to a hash or array to
define what subscripting does. Hmm.
That's tantalizing. Did you have something like this in mind:
# Count number of accesses to each key
our %counter_hash;
my %hash is subscripted
-
Larry Wall writes:
Currently it does. There have been some rumblings in the design team
that maybe it shouldn't. But it occurs to me that this might be another
spot to have our cake and eat it to. We could say that
for @foo - $input { ... $input ... }
doesn't set the topic in the
Smylers writes:
To me Cfor makes sense when you've got a pile of stuff you're
intending to process (such as array items or lines in a file), and
Cwhile makes sense when you're waiting for a condition (such as the
user correctly entering her/his password) and you couldn't possibly know
in
On Mon, Dec 06, 2004 at 09:56:57AM -0800, Larry Wall wrote:
On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote:
: Can we ditch Cfor in the examples in favor of Cwhile, for a while? :)
Okay. Have an example:
while =$IN - $line {...}
I think that works. I'm back to
If I went with get, the opposite would be unget for both historical
and huffmaniacal reasons.
But get has too strong a class accessor connotation in most OO.
unpull? ;-)
On Mon, Dec 06, 2004 at 12:45:18PM -0600, Jonathan Scott Duff wrote:
: On Mon, Dec 06, 2004 at 09:56:57AM -0800, Larry Wall wrote:
: On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote:
: : Can we ditch Cfor in the examples in favor of Cwhile, for a while? :)
:
: Okay. Have an
On Monday 06 December 2004 01:26 pm, Smylers wrote:
I think that Cfor reads much better than Cwhile for English-ness.
Having taught Perl 5 beginners that Cforeach can be used to iterated
over each item in a list, many of them then instinctively try to use the
same keyword for iterating over
On Mon, Dec 06, 2004 at 10:59:18AM -0800, Larry Wall wrote:
On Mon, Dec 06, 2004 at 12:45:18PM -0600, Jonathan Scott Duff wrote:
: On Mon, Dec 06, 2004 at 09:56:57AM -0800, Larry Wall wrote:
: On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote:
: : Can we ditch Cfor in the
Dan Brian wrote:
If I went with get, the opposite would be unget for both historical
and huffmaniacal reasons.
But get has too strong a class accessor connotation in most OO.
unpull? ;-)
pushf/popf. f is for front.
But I still don't see anything wrong with shift/unshift.
I'd prefer to avoid
S2:
my $foo = 42;
say %MY::$foo;# prints 42
S6:
Perl5ish subroutine declarations
...
sub say { print qq{@_\n}; } # args appear in @_
Because Cprint has no final newline, I would expect Csay will have
one. Final newline or not. What is your say?
--
stef
On Mon, Dec 06, 2004 at 01:25:29PM -0600, Rod Adams wrote:
Dan Brian wrote:
If I went with get, the opposite would be unget for both historical
and huffmaniacal reasons.
But get has too strong a class accessor connotation in most OO.
unpull? ;-)
pushf/popf. f is for front.
Ew!
On Mon, Dec 06, 2004 at 11:52:22AM -0700, Dan Brian wrote:
: If I went with get, the opposite would be unget for both historical
: and huffmaniacal reasons.
:
: But get has too strong a class accessor connotation in most OO.
:
: unpull? ;-)
Given the existence of a unary = for abbreviated use,
On Mon, Dec 06, 2004 at 03:11:15AM -0700, David Green wrote:
[snip]
: I like that.
[snip]
: I like that even better.
[snip]
: I'm happy with those too (perhaps because I do want to be a bit
: mathematical).
[snip]
: is FAT? Yeah, that works for me too. =)
[snip]
: I would take that as an
On Sat, Dec 04, 2004 at 03:28:12PM -0800, Ashley Winters wrote:
: On Sat, 4 Dec 2004 11:15:14 -0800, Larry Wall [EMAIL PROTECTED] wrote:
: On Sat, Dec 04, 2004 at 10:25:49AM -0700, Luke Palmer wrote:
: : But this convention provides much more accuracy than memorizing a list
: : of methods that
On Sun, Dec 05, 2004 at 12:05:46AM +, Matthew Walton wrote:
: I'm sorry, but from a C++ background, overriding postcircumfix:( )
: feels far more natural to me than setting 'is default' on some method.
That only works for disambiguation if you know which .() to call in
the first place. It
On Mon, Dec 06, 2004 at 08:26:48PM +0100, Stéphane Payrard wrote:
: S2:
:
: my $foo = 42;
: say %MY::$foo;# prints 42
:
: S6:
:
: Perl5ish subroutine declarations
: ...
: sub say { print qq{@_\n}; } # args appear in @_
:
:
: Because Cprint has no final
Luke Palmer wrote:
The remaining problem is what to do about unary dot. Repeated here for
the, er, benefit? of p6l:
class Duple {
has $.left;
has $.right;
method perform (oper) {
oper($.left);
oper($.right);
}
}
Let's change that
Elyse M. Grasso wrote:
But you need to process the file while you haven't reached the end yet, or
until you reach the end. And I can't think of an occasion where I knew going
in what the length of the file I was processing was going to be. I suppose
foreach might make sense if you sucked in the
Larry Wall wrote:
On Mon, Dec 06, 2004 at 11:52:22AM -0700, Dan Brian wrote:
: If I went with get, the opposite would be unget for both historical
: and huffmaniacal reasons.
Why? (I get the huffman, not the history.) Is it just a nod to unshift?
Given the existence of a unary = for abbreviated
On Mon, Dec 06, 2004 at 03:50:42PM -0500, Austin Hastings wrote:
: Larry Wall wrote:
:
: On Mon, Dec 06, 2004 at 11:52:22AM -0700, Dan Brian wrote:
: : If I went with get, the opposite would be unget for both historical
: : and huffmaniacal reasons.
:
:
: Why? (I get the huffman, not the
Matthew Walton writes:
Luke Palmer wrote:
The remaining problem is what to do about unary dot. Repeated here for
the, er, benefit? of p6l:
class Duple {
has $.left;
has $.right;
method perform (oper) {
oper($.left);
oper($.right);
Larry Wall writes:
Any foo() can return a list. That list can be a Lazy list. So the
ordinary return can say:
return 0...;
to return an infinite list, or even
return 0..., 0...;
Is it just me, or did you just return *2?
Luke Palmer wrote:
Larry Wall writes:
Any foo() can return a list. That list can be a Lazy list. So the
ordinary return can say:
return 0...;
to return an infinite list, or even
return 0..., 0...;
Is it just me, or did you just return *2?
On Mon, Dec 06, 2004 at 06:14:56PM -0500, Austin Hastings wrote:
(B: Luke Palmer wrote:
(B:
(B: Larry Wall writes:
(B:
(B:
(B: Any foo() can return a list. That list can be a Lazy list. So the
(B: ordinary return can say:
(B:
(B:return 0...;
(B:
(B: to return an infinite
Luke Palmer wrote:
class MyStream {
has $.stream;
method :send_one ($item) {
$.stream.send($item);
}
method send ([EMAIL PROTECTED]) {
.:send_one(BEGIN);
for @data {
.:send_one($_);
}
stuff grab :-)
--
Mark Biggar
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
-- Original message --
On Mon, Dec 06, 2004 at 10:45:22AM -0500, Austin Hastings wrote:
: But I'd be willing to rename them to get/put.
If I went with get, the opposite would
On Mon, 6 Dec 2004 11:34:24 -0800, Larry Wall [EMAIL PROTECTED] wrote:
Though it's awfully tempting to fill in the holes in the periodic table:
($a, $b, $c) = @foo * 3;
And then just say all the corresponding unaries default to 1 (or the arity
of the left):
$bit = + $number;
Perl 6 Summary for 2004-11-29 through 2004-12-06
All~
Last week I asked for help identifying the source of a quotation. One
friendly soul suggested Alan J. Perlis, but could not find an actual
attribution. It did lead me to find a very applicable (and in my mind
funny) quote
Larry Wall writes:
As far as I can recall we haven't renamed C.specs to anything else yet.
That sounds like a challenge ...
Smylers
47 matches
Mail list logo