Brent Dax wrote:
Joseph F. Ryan:
# By default, references should not stringify to anything
# "pretty", they should stringifiy to something useful for
# debugging. Heck, even perl5 style should be fine. Not only
Why? Isn't the pretty form more generally useful?
I don't think so; I'd think
I would suggest that we could get away with a single n-ary built-in.
And I would strongly suggest that C isn't the right name for it,
since, apart from being a ugly, slang word, "divvy" implies dividing up
equally. The built-in would actually be doing classification of the
elements of the list, so
Michael Lazzaro wrote:
Huh... having a comma-separated list to represent multiple characters.
I can't think of any problems with that, and it would be marginally
easier for some sequences...
Unless someone on the design team objects, I'd say let's go for it.
Larry was certainly in favour of
Joseph F. Ryan:
# By default, references should not stringify to anything
# "pretty", they should stringifiy to something useful for
# debugging. Heck, even perl5 style should be fine. Not only
Why? Isn't the pretty form more generally useful?
# is this handy, but also prevents problems wit
A big issue that still remains with literals is the stringification of
objects and references. In an effort to get the behaviors hammered
down, here are a few ideas:
First off, references:
By default, references should not stringify to anything "pretty", they
should stringifiy to something usefu
--- Dave Whipp <[EMAIL PROTECTED]> wrote:
>
> I think that c would be an abysmal name: that implies
> "keep the false ones". I'm not sure that there is a synonym
> for "boolean partition" though. Perhaps we need some help
> from a linguist! ;)
>
What's wrong with split()?
split { f($_) }, $ite
On 5 Dec 2002, Rafael Garcia-Suarez wrote:
> If you want good'ol Unix flavor, call it "vrep". Compare the ed(1) /
> ex(1) / vi(1) commands (where 're' stands for regular expression, of
> course) :
> :g/re/p
> :v/re/p
I like it. Fits in with our Un*x heritage, and doesn't have any existin
On Thursday, December 5, 2002, at 07:53 AM, Austin Hastings wrote:
And in general, without resorting to something hideous like scanf, is
there going to be some more-advanced want() variant that allows saying
@a, $i, $j, @b, %w, $k, @c = scramble(...);
This is a terribly important question, fo
"Miko O'Sullivan" <[EMAIL PROTECTED]> wrote:
> On Thu, 5 Dec 2002, Dave Whipp wrote:
>
> > Only if we apply a bit of magic (2 is a true value). The rule might be:
>
> How about if we just have two different methods: one for boolean and one
> for multiple divvies:
>
> my(@true, @false) := @array.c
John Williams wrote in perl.perl6.language :
>
> While "purge" is cute, it certainly is not obvious what it does. Of
> course neither is "grep" unless you are an aging unix guru...
>
> How about something which is at least obvious to someone who knows what
> grep is, such as "vgrep" or "grep:v"?
On Thu, 5 Dec 2002, Dave Whipp wrote:
> Only if we apply a bit of magic (2 is a true value). The rule might be:
How about if we just have two different methods: one for boolean and one
for multiple divvies:
my(@true, @false) := @array.cull{/some test/};
my (@a, @b, @c) := @array.divvy{some co
> FWIW, I came up with "purge" because my first inclination was to spell
> "grep" backwards: "perg". :-)
I like "purge", although "except", "exclude", and "omit" all have their
charms.
For partition function, I like "divvy", "carve", "segment" (in that order)
and almost anything other than "sepa
"Larry Wall" <[EMAIL PROTECTED]> wrote:
> On Thu, Dec 05, 2002 at 10:09:08AM -0800, Michael Lazzaro wrote:
> : What about "divvy" (or are we already using that for something else?)
> :
> : my(@a,@b) = divvy { ... } @c;
>
> Any such solution must use := rather than =. I'd go as far as to say
>
On Thu, Dec 05, 2002 at 10:09:08AM -0800, Michael Lazzaro wrote:
: What about "divvy" (or are we already using that for something else?)
:
: my(@a,@b) = divvy { ... } @c;
Any such solution must use := rather than =. I'd go as far as to say
that divvy should be illegal in a list context.
Not
On Thursday, December 5, 2002, at 10:09 AM, Michael Lazzaro wrote:
What about "divvy" (or are we already using that for something else?)
my(@a,@b) = divvy { ... } @c;
Other possibilities from the ol' thesaurus: C, C,
C, C.
@$#@%*. Trying to do too many %#@%@ things at once. I meant 'di
On Thu, 5 Dec 2002, Robert Spier wrote:
> -R (who does not see any benefit of 'perg' over grep { ! code } )
My problem with grep { ! code } is the same problem I have with if (!
expression): I've never developed a real trust in operator precedence.
Even looking at your pseudocode example, I itche
>How about my original inclinaton: "perg"? It just screams out "the
>opposite of grep".
So it greps a list in reverse order?
-R (who does not see any benefit of 'perg' over grep { ! code } )
On Wed, 4 Dec 2002, John Williams wrote:
> While "purge" is cute, it certainly is not obvious what it does. Of
> course neither is "grep" unless you are an aging unix guru...
>
> How about something which is at least obvious to someone who knows what
> grep is, such as "vgrep" or "grep:v"?
How a
I like it except for the name, which feels too active to me (ie, if I were to
purge those elements from the array I'd expect the array to be altered, instead
of returning a new array with only those elements). But I do like the idea. I
think the name "except" would be pretty nice, though. Then a
On Thu, Dec 05, 2002 at 09:18:21AM -0800, Michael Lazzaro wrote:
:
: On Thursday, December 5, 2002, at 02:11 AM, James Mastros wrote:
:
: >On 12/04/2002 3:21 PM, Larry Wall wrote:
: >>\x and \o are then just shortcuts.
: >Can we please also have \0 as a shortcut for \0x0?
:
: \0 in addition to
On Wednesday, December 4, 2002, at 09:11 PM, John Williams wrote:
On Wed, 4 Dec 2002, Miko O'Sullivan wrote:
FWIW, I came up with "purge" because my first inclination was to spell
"grep" backwards: "perg". :-)
While "purge" is cute, it certainly is not obvious what it does. Of
course neit
On Wednesday, December 4, 2002, at 12:55 PM, David Whipp wrote:
How far can we go with this \c thing? How about:
print "\c[72, 101, 108, 108, 111]";
will that print "Hello"?
Huh... having a comma-separated list to represent multiple characters.
I can't think of any problems with that, and i
On Thursday, December 5, 2002, at 02:11 AM, James Mastros wrote:
On 12/04/2002 3:21 PM, Larry Wall wrote:
\x and \o are then just shortcuts.
Can we please also have \0 as a shortcut for \0x0?
\0 in addition to \x, meaning the same thing? I think that would get
us back to where we were wit
In thinking about how to write a "partition" function (or separate, or
whatever you want to call it) it occurs to me that you might want some
sort of reverse-varargs behavior, like
my (@a, @b, @c, @d) = @array.partiton { $_ % 4 };
So in this case, partition is supposed to determine, on the fly, h
> Explain how having indexes (arrays, substr, etc...) in Perl 6 start
> at 0 will benefit most users.
The languages which do not start their indices at 0 are dead or dying.
> Do not invoke legacy.
How about FUD? :-)
=Austin
--- Michael G Schwern <[EMAIL PROTECTED]> wrote:
> I'm going to ask
Angel Faus:
> Maybe the solution is to make it hash-wise:
>
> %hash = @array.sep {
> when /^[A-Z]*$/ {'uppercase'}
> when /^[a-z]*$/ {'lowercase'}
> default {'mixedcase'}
> }
I agree that general partitioning is 'better' than a fixed binary proposal,
but what is ga
Michael G Schwern wrote:
> and that's just entirely too much work. I'd love to be able to do
> it with a grep like thing.
>
> (@switches, @args) = seperate /^-/, @ARGV;
>
> seperate() simply returns two lists. One of elements which match,
> one of elements which don't. I think Perl 6 will
Aaron Crane:
> However, I don't think it should be called 'seperate'. I also don't think
> it should be called 'separate', because that word seems to be commonly
> misspelled...
That seems like an excellent argument for calling it 'separate'. Perhaps it
will be the first of many spelling-improvi
Michael G Schwern writes:
> I'd love to be able to do it with a grep like thing.
>
> (@switches, @args) = seperate /^-/, @ARGV;
Yes. I've written that function in Perl 5, which isn't ideal, because you
have to return array refs, not arrays.
However, I don't think it should be called 'seper
On Thu 05 Dec, Michael G Schwern wrote:
> So here's your essay topic:
>
> Explain how having indexes (arrays, substr, etc...) in Perl 6 start at 0
> will benefit most users. Do not invoke legacy. [1]
>
> [1] ie. "because that's how most other languages do it" or "everyone is
> used to it by now"
> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Date: Thu, 5 Dec 2002 02:45:39 -0800
> From: Michael G Schwern <[EMAIL PROTECTED]>
> Content-Disposition: inline
> Sender: Michael G Schwern <[EMAIL PROTECTED]>
> X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
>
> I'm going to as
I'm going to ask something that's probably going to launch off into a long,
silly thread. But I'm really curious what the results will be so I'll ask
it anyway. Think of it as an experiment.
So here's your essay topic:
Explain how having indexes (arrays, substr, etc...) in Perl 6 start at 0
wil
[EMAIL PROTECTED] (Miko O'Sullivan) writes:
> FWIW, I came up with "purge" because my first inclination was to spell
> "grep" backwards: "perg". :-)
For reference, Ruby uses .detect and .reject.
--
3rd Law of Computing:
Anything that can go wr
fortune: Segmentation violation -- Core dum
On 12/04/2002 3:21 PM, Larry Wall wrote:
On Wed, Dec 04, 2002 at 11:38:35AM -0800, Michael Lazzaro wrote:
: We still need to verify whether we can have, in qq strings:
:
:\033 - octal (p5; deprecated but allowed in p6?)
I think it's disallowed.
Thank the many gods ... or One True
> From: "Brent Dax" <[EMAIL PROTECTED]>
> Date: Thu, 5 Dec 2002 00:28:52 -0800
>
> Michael G Schwern:
> # You can do it with a map without much trouble:
> #
> # my @indexes = map { /condition/ ? $i++ : () } @stuff;
>
> Unless I'm mistaken, that won't work, since $i only gets incremented on
>
Michael G Schwern:
# You can do it with a map without much trouble:
#
# my @indexes = map { /condition/ ? $i++ : () } @stuff;
Unless I'm mistaken, that won't work, since $i only gets incremented on
matches. I think this:
my @indexes = map { $i++; /condition/ ? $i : () } @stuff;
Wil
36 matches
Mail list logo