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
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
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).
-Miko
Miko O'Sullivan
Programmer
on the discussion of each idea.
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
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
.
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 shortcuts do.
I always feel somehow redundant type C$var = $var ? 1 : 0, and ??= would
just be nice and tidy.
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission
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
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
:
$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
with something better.)
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
original inclinaton: perg? It just screams out the
opposite of grep.
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
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
code}
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
meaning that implies things it doesn't do.
-miko
Miko O'Sullivan
Programmer Analyst
Rescue Mission of Roanoke
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
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 context,
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: 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 pair
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.
-Miko
- 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, would
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
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 obvious...
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
[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
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 are
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. the following
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
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 arrays
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 times but
The implication is that we can only provide advanced PRE_LAST
style blocks (or their equiv.) on the Cforeach loop. The fact
that they are impossible on the Cwhile loop should not
constrain our thinking for the Cforeach loop.
Just checking here: is PRE_LAST a separate and non-mutually
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
is scoped to
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
Damian said:
6. Cotherwise 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 Celse and Cotherwise. I'm not sure if Cotherwise is popular
because it is
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 look
Damian said:
The CBETWEEN 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
Damian, now having terrible visions of someone suggesting Celswhen ;-)
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
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 like
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
and C$cond is defined *outside* the block. So if Larry were to allow
Celse
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
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 Cwhile and
Celse,
it's scoped to that block. So you can use it inside the Cwhile's block,
inside the Celse's block (assuming Larry allows such a construct), and
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
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
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
(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
And HR won't be printed before Done.?
It *will* be printed there, according to the current design. A CNEXT is
*always* called when the iteration leaves the block (whether it's coming
around again or not). By analogy, CNEXT is a terminator, not a
separator.
Darn, we're so close. I
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 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
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
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
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 quite decided if I'm
52 matches
Mail list logo