Hi everyone! My name is Miko O'Sullivan, and I've been a devoted Perl
Hacker for several years now. I'm looking forward to participating in the
discussion of Perl 6. To give a little perspective on my comments, I got my
degree in Marketing about a decade ago, and I've never
The current plans indicate that a subroutine's params should be defaulted
like this:
sub load_data ($filename ; $version / /= 1) {...}
(The space between / and / is on purpose, my emailer has problems if they
are together.) If that's the technique, how does the caller indicate that
the secon
> I think you're right that this is a valid distinction, I'm just not
> sure if it's not a little too subtle and that the two different
> notations won't cause confusion.
Well, I had been hoping to appeal to the mathematical mindset of the list,
but there is a second reason for = in addition to /
>sub foo($a=1, $b, $c=3) { ... }
>
> is ambiguous: While foo(2) sets $a=1, $b=2, $c=3, it's impossible to
> say what foo(4,5) should do.
foo(2) means that $a = 2, $b defaults to undef, $c defaults to 3
foo(4,5) means $a = 4, $b = 5, and $c defaults to 3.
-Miko
SUMMARY
A way to declare public names for params irrelevant to the internal variable
names:
sub load_data (-filename $filename_tainted ; 'version' 'ver'
$version_input / /= 1) {...}
DETAILS
Subroutine variables are like underwear: you don't generally go showing them
to everybody. So, when
> Yay, tagmemics! :) Shall I offer an "Intro to Linguistics for Perl 6
> Developers" class? That would be fun!
Please!!!
-Miko "Wouldn't Know a Tagmemic if it Bit Him on the Parse" O'Sullivan
> > "Wouldn't Know a Tagmemic if it Bit Him on the Parse"
>
> Ooh, can I steal that as a title? (Though I'll s/Tagmemic/Tagmeme/.) I
> like it! :)
You got it!
I hope this isn't too off topic, but... is the word "tagmeme" somehow
related to the urban legend concept of a cultural "meme"?
-Miko
SUMMARY
A proposal for a set of loop structures that simplify code that is based on
loop iterations.
foreach my $var (@arr) { ... }
before { ... } # run before first iteration, only if there is at least
one iteration
between { ... } # run between iterations, not before first or after l
(note: this repsonse arrived just in my mailbox, not to the list, but I
thought I'd post my response to the list. -Miko)
> Okay, that's if you can store the results somewhere all at once, but
> so was your example. Iteration objects could be used to optimize for
> the case where you can't (or d
> > And "" won't be printed before "Done."?
>
> It *will* be printed there, according to the current design. A C is
> *always* called when the iteration leaves the block (whether it's coming
> around again or not). By analogy, C is a terminator, not a
separator.
Darn, we're so close. I understand
> This is now extensible to any number of precedence levels, and you can
> now use simple string comparison to compare any two precedences. It even
> short circuits the comparison as soon as it finds a character that
> differs.
>
> Gee, maybe I should patent this.
Too late. Amazon has already p
> Of course it brings other less wholesome things to mind like "elsfor"
> and "elsloop" and "if ... elsfor" and "for ... elsif ... elsloop ...
> else", but why not?
Well, I agree with the concept, but boyoboy those names ain't gonna
fly. We'll have to head down the road of
unlessfor
> Well, if there's no while (replaced by generic "loop", per Apoc4) why
> would there be an until?
Whoa. I actually had a moment of panic there. Then I checked for myself.
I don't see anything in Apoc4 about getting rid of while. It may be
excluded from evolution, but it's still there, sorta l
Concerning the els(loop|for|while) controversy, I'd like to bring it back to
the point that started it all: loop-else. There seems to be a fair amount
of support for a loop-else contruct. Can we/Larry decide to accept
loop-else, regardless of what other decisions need to be made? It would be
a
> and C<$cond> is defined *outside* the block. So if Larry were to allow
C
> on loops, you'd be able to write:
> [snip]
> Given how rarely this kind of thing is actually needed (I've *never* used
such
> a construct), I suspect that an explicit variable is adequate.
I don't know if we're talking a
> In Perl 6 a lexical variable is scoped to the block in which it's
declared.
> Since C<$cond> is declared in the block *containing* the C and
C,
> it's scoped to that block. So you can use it inside the C's block,
> inside the C's block (assuming Larry allows such a construct), and
in
> the follo
> Damian, now having terrible visions of someone suggesting C ;-)
Then may I also give you nightmares on: elsdo, elsdont, elsgrep, elstry ...
:-)
-Miko
> Then if you want "else when" or "else do", you're all set. It's an easy
> change and there are no new keywords.
Agree with everything else you said. One minor question: how would "else
do" be different than "else"? do always does, doesn't it?
-Miko
Damian said:
> 6. C would seem to fit the bill rather nicely.
To me, "otherwise" is a synonym for "else", and that makes it too
confusingly similar. I foresee forever explaining to people the difference
between C and C. I'm not sure if C is popular
because it is similar to C, but I think t
Damian posted:
> NAME
> Acme::Don't - The opposite of `do'
Wonderful job, Damian! I'll get to work on the complementary Acme::TryNotTo
module.
:-)
-Miko
Jonathan said:
> I actually think exactly the opposite. In my mind "otherwise" would
> just be a synonym for "else" so that
>
> loop { ... } else { ... }
> loop { ... } otherwise { ... }
>
> would both be syntactically valid.
I believe that the intention is that they *aren't* synonyms, i.e. they
Damian said:
> The C block can't decide whether to execute until
> it knows whether the loop is going to iterate again. And it can't
> know *that* until it has evaluated the condition again. At which
> point, the $filename variable has the wrong value. :-(
>
> The example is a little contrived per
From: "David Whipp" <[EMAIL PROTECTED]>
> don't { die } unless .error;
Whoa. This don't thing is starting to look eerily useful. Shades of the
Parrot parody.
-Miko
> It's odd, folks are still talking about the icky elsstuff, but I never
> saw any discussion of my BNF proposal. Was it that no one saw it, that
> my BNF was too rusty, or the idea of abandoning elsif for (in
> pseudo-ebnf)
Sorry, I thought I'd expressed agreement at some point. I like the
"els
> The implication is that we can only provide advanced "PRE_LAST"
> style blocks (or their equiv.) on the C loop. The fact
> that they are impossible on the C loop should not
> constrain our thinking for the C loop.
Just checking here: is PRE_LAST a separate and non-mutually exclusive
concept fro
> while getNextValue() -> $i {
> ...
> }
>
> while getOtherNextValue() -> $i {
> ...
> }
>
> which generates no warning because each C<$i> is a parameter of the
> corresponding loop block, and hence scoped to that block.
Ok, now I understand the plan. In brief, in the following example $result
i
From: "Damian Conway" <[EMAIL PROTECTED]>
> while (my $res = $search->getnext) { ...}
>
> has a valid meaning in Perl 6. In fact, it's meaning in Perl 6 is far more
> reasonable than in Perl 5.
I don't think the new meaning makes sense at all. Essentially it's saying
"the statement gets run many
> While thinking Eiffel-ish thoughts the other day, I began to wonder if
> Perl6's classes could go beyond the simple private/public/protected
> scheme by optionally allowing for a property or method to only be
> accessed by a certain set of classes.
Many times when I've used OO languages I've wi
From: "David Whipp" <[EMAIL PROTECTED]>
> It it too much to ask, of the creator of a tied array, to implement
> their code in such a way that *reading* an element of that array
> does not have significant side-effects?
Actually, I think that *is* a significant imposition. The whole point of
tied
From: "Larry Wall" <[EMAIL PROTECTED]>
> It's unlikely that {n,m} will still have that meaning in Perl 6. Maybe
we'll
> have something like this:
>
> Perl 5 Perl 6
> {1,3} <1..3>
> {3} <3>
> {3,} <3+>
> {0,3} <3->
What are your feelings on multiple ranges for matches? E.g. t
SUMMARY
Arrays should always have known lengths because that's what arrays do. This
requirement is enforced culturally, not programmatically.
DETAILS
I submit for consideration the idea that if an array doesn't always have a
defined length then it ceases to be that incredibly handy construct t
From: "Chris Angell" <[EMAIL PROTECTED]>
> I have an idea for the int() function. I think it would be cool if it
> returned false/undefined when the argument passed to it is a
> whole number.
This is related to something I've been pondering about variables and typing.
Question A: In Perl6, how
[This seems like a good time to post something that's been on my mind for
some time.]
SUMMARY
The world needs a really easy CPAN client. Here's one design for such a
thing.
DETAILS
A few brief philosphical points:
1) People like languages that have tons of built-in
doohickeys. See PH
> For the record, you will hear no disagreement from me. I recognize that
> this is a HARD problem. Nonetheless, I think it's an important one, and
> solving it (even imperfectly, by only supporting well-defined platforms)
> would be a major coup.
I'd like to take that even further: just suppor
This is a small collection of ideas for the Perl6 language. Think of this
posting as a light and refreshing summer fruit salad, composed of three
ideas to while away the time during this August lull in perl6-language.
Give split an option
From: "Dave Mitchell" <[EMAIL PROTECTED]>
> But perl5 already does this:
Dave gets the "First to Point Out the Feature Exists" award. I knew that
out of three ideas I'd be lucky if just one of them was actually a new
feature idea.
I might still say that the parens don't make things quite obvio
> > - There's already a huge population of programmers out there who already
use
> > this notation. I frankly admit that I think of PHP as a great idea that
> > wasn't done quite right.
>
> I agree. Including that notation! ;-)
Touche. Darn it's difficult disagreeing with pithy people. :-)
OK
From: "Damian Conway" <[EMAIL PROTECTED]>
> > what would "true" (the string) be converted to?
>
> In a numeric context: 0 (as in Perl 5).
which was my point. You wouldn't want to cast any ol' scalar as a
number just to get 1 or 0 representations or TRUE or FALSE... that wouldn't
DWIM.
From: "Nicholas Clark" <[EMAIL PROTECTED]>
> In Damian's excellent perl6 talk, I think he said that by default a hash
> in list context will return a list of pairs. Hence this
>
>@array = %hash
>
> for %hash with n keys would give an array of n elements, all pairs.
Will there actually be a
From: "Dan Sugalski" <[EMAIL PROTECTED]>
> How about a JPEG object? Might take a string with the image data, an
> array with byte data, a filehandle that's got the data to it.
But those situations are all covered by the #= concept: call the new method
passing the right argument. So for a JPEG th
> > On top of which, Damian has expressed an interest in ! for a
> > superpositional xor.
>
> Which would behave how, exactly?
! the way people expect, I fear.
-Miko
From: "Larry Wall" <[EMAIL PROTECTED]>
> : ? - force to bool context
> : ! - force to bool context, negate
> : + - force to numeric context
> : - - force to numeric context, negate
> : ~ - force to string context
>
> We're obviously missing the "force to string co
At 10:22 AM -0800 10/29/02, Michael Lazzaro wrote:
> This is why I am nervous about introducing terms like eigenbunny, etc.
Beats the heck out of "thingy". I had to read that chapter three times
before I realized that Randal hadn't just forgotten the real word.
I still feel uncomfortable saying
s well enough, but just like "unless" somehow
simplifies the logic by removing that leading !, "purge" can simplifiy the
array filter:
@members = purge {$_->{'quit'}} @members;
FWIW, I came up with "purge" because my first inclination was to spell
"grep" backwards: "perg". :-)
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
, such as "vgrep" or "grep:v"?
How about my original inclinaton: "perg"? It just screams out "the
opposite of grep".
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
udocode example, I itched to "fix" it with grep {!
(code) }.
This may be a weakness on my part, but I like computers to address my
weaknesses: I certainly spend enough time addressing theirs.
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
ome code}
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
our Un*x heritage, and doesn't have any existing
meaning that implies things it doesn't do.
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
ot;falsetrue" is a stupid name, please replace with something better.)
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
argument for arbitrary features.
> Is not a slogan. I repeat, is not a slogan. :) ?
But it has such a Johnnie Cochran sound to it: "It's obvious WIM, you must
DWIM". Language design by catch phrase...
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
is type of thing a lot:
$var = $var ? 1 : 0;
How 'bout a shortcut for that, something like this:
$var ?= 1 : 0;
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
find myself
explicitly setting variables to 1 or 0 quite frequently, and I always use
?:. It would be a nice little shorthand addition to have ??= in Perl6.
Obviously this isn't a major requirement. It's just a nice little
shortcut that would clean the code in the same way the other shortcu
reach a
consensus that the summary correctly summarizes the thread.
See http://www.idocs.com/perl6/ for the home page for the summaries and
one example summary.
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
E TO ALLISON RANDAL: in your face-to-face meetings next week, please
make sure that "Larry Wall" isn't really Guido van Rossum with a fake
mustache.
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
sionally post a list of new
summaries.
I'll be starting with three of my own favorites: vrep
(http:[EMAIL PROTECTED]/msg09684.html), the
monolithic "Loop controls" thread
(http:[EMAIL PROTECTED]/msg09684.html), and
named params in subroutines
(http:[EMAIL PROTECTED]/msg09551.html).
ies
are a way of letting them cut to the chase on the discussion of each idea.
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
it? Many of the RFCs weren't written until after
> the idea had been discussed.
Sure, I'm aware of that. However, the language list goes on (and
sometimes, on and on and on). If those discussions are to be useful,
somebody needs to summarize them.
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
eady to send to
the development team. Sorry, the Electronic Frontier Foundation got the
other $5 that was in that account this morning.
-Miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
could even do grammar and spell checking on
English content.
It wouldn't have to be much of an extension to the here doc syntax to
allow for a language indicator:
$myml = MyXmlParser->new(<< '(MARKUP)', type=>'text/xml');
or
print << '(MARKUP)', type=>'human/en';
-Miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
tend. Um, I don't remember the cast operator to do that (is
there one?) but say it's simply "ob", you just say C.
-Miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
t have a DESTROY method (or whatever it will be called
in Perl6)? You get the same benefit without the additional brain-overhead
of manually indicating that the class needs to be tracked.
-Miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
61 matches
Mail list logo