defaulting parameters

2002-04-04 Thread Miko O'Sullivan
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

Defaulting params

2002-04-10 Thread Miko O'Sullivan
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

Re: Defaulting params

2002-04-11 Thread Miko O'Sullivan
> 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 /

Re: Defaulting params

2002-04-11 Thread Miko O'Sullivan
>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

Subroutine variables are like underwear

2002-04-12 Thread Miko O'Sullivan
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

Re: Unary dot

2002-04-16 Thread Miko O'Sullivan
> 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

Tagmem* (was Unary dot)

2002-04-16 Thread Miko 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

Loop controls

2002-04-25 Thread Miko O'Sullivan
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

Re: Loop controls

2002-04-25 Thread Miko O'Sullivan
(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

Re: Loop controls

2002-04-25 Thread Miko O'Sullivan
> > 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

Re: Please rename 'but' to 'has'.

2002-04-26 Thread Miko O'Sullivan
> 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

Re: Loop controls

2002-04-26 Thread Miko O'Sullivan
> 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

Re: Loop controls

2002-04-29 Thread Miko O'Sullivan
> 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

Re: Loop controls

2002-04-29 Thread Miko O'Sullivan
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

Re: Loop controls

2002-04-29 Thread Miko O'Sullivan
> 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

Re: Loop controls

2002-04-29 Thread Miko O'Sullivan
> 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

Re: Loop controls

2002-04-30 Thread Miko O'Sullivan
> Damian, now having terrible visions of someone suggesting C ;-) Then may I also give you nightmares on: elsdo, elsdont, elsgrep, elstry ... :-) -Miko

Re: Loop controls

2002-04-30 Thread Miko O'Sullivan
> 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

Re: Loop controls

2002-05-01 Thread Miko O'Sullivan
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

Re: Loop controls

2002-05-01 Thread Miko O'Sullivan
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

Re: Loop controls

2002-05-01 Thread Miko O'Sullivan
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

Re: Loop controls

2002-05-01 Thread Miko O'Sullivan
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

Re: Loop controls

2002-05-03 Thread Miko O'Sullivan
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

Re: Loop controls

2002-05-06 Thread Miko O'Sullivan
> 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

Re: FIRST, BETWEEN, etc.. (was Re: Loop controls)

2002-05-09 Thread Miko O'Sullivan
> 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

Re: Loop controls

2002-05-09 Thread Miko O'Sullivan
> 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

Re: Loop controls

2002-05-10 Thread Miko O'Sullivan
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

Re: Selective exporting of properties/methods

2002-05-12 Thread Miko O'Sullivan
> 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

Re: FIRST, BETWEEN, etc.. (was Re: Loop controls)

2002-05-12 Thread Miko O'Sullivan
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

Re: Why not {,n} in quantifiers?

2002-05-15 Thread Miko O'Sullivan
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

Re: FIRST, BETWEEN, etc.. (was Re: Loop controls)

2002-05-16 Thread Miko O'Sullivan
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

Re: Idea

2002-05-23 Thread Miko O'Sullivan
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

Re: 6PAN (was: Half measures all round)

2002-06-04 Thread Miko O'Sullivan
[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

Re: 6PAN (was: Half measures all round)

2002-06-05 Thread Miko O'Sullivan
> 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

perl6-language@perl.org

2002-08-01 Thread Miko O'Sullivan
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

Re: Light ideas

2002-08-01 Thread Miko O'Sullivan
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

Re: Light ideas

2002-08-02 Thread Miko O'Sullivan
> > - 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

Re: Light ideas

2002-08-04 Thread Miko O'Sullivan
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.

Re: @array = %hash

2002-08-31 Thread Miko O'Sullivan
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

Re: auto deserialization

2002-09-03 Thread Miko O'Sullivan
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

Re: perl6 operator precedence table

2002-10-23 Thread Miko O'Sullivan
> > 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

Re: Perl6 Operator List

2002-10-25 Thread Miko O'Sullivan
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

Re: Wh<[ie]>ther Infix Superposition ops

2002-10-29 Thread Miko O'Sullivan
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

purge: opposite of grep

2002-12-04 Thread Miko O'Sullivan
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

Re: purge: opposite of grep

2002-12-05 Thread Miko O'Sullivan
, 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

Re: purge: opposite of grep

2002-12-05 Thread Miko O'Sullivan
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

Re: purge: opposite of grep

2002-12-05 Thread Miko O'Sullivan
ome code} Miko O'Sullivan Programmer Analyst Rescue Mission of Roanoke

Re: purge: opposite of grep

2002-12-05 Thread Miko O'Sullivan
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

Re: purge: opposite of grep

2002-12-06 Thread Miko O'Sullivan
ot;falsetrue" is a stupid name, please replace with something better.) -miko Miko O'Sullivan Programmer Analyst Rescue Mission of Roanoke

Re: AW: nag Exegesis 2

2003-01-06 Thread Miko O'Sullivan
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

Shortcut: ?=

2003-02-02 Thread Miko O'Sullivan
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

Re: Shortcut: ?=

2003-02-03 Thread Miko O'Sullivan
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

Language Discussion Summaries

2003-02-03 Thread Miko O'Sullivan
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

Re: newline as statement terminator

2003-02-03 Thread Miko O'Sullivan
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

Re: Language Discussion Summaries

2003-02-04 Thread Miko O'Sullivan
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).

Re: Language Discussion Summaries

2003-02-04 Thread Miko O'Sullivan
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

Re: Language Discussion Summaries

2003-02-04 Thread Miko O'Sullivan
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

Re: Funding the design team

2003-03-20 Thread Miko O'Sullivan
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

Embedded foreign syntax (was Re: P6ML?)

2003-03-26 Thread Miko O'Sullivan
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

Re: == vs. eq

2003-04-01 Thread Miko O'Sullivan
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

Re: Timely object destruction

2003-06-03 Thread Miko O'Sullivan
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