Re: Using Rules Today

2006-07-03 Thread Paul Seamons
', '3', [ \[ '**', '4', '2' ], 0 ] ], 0 ], '5' ], 0 ]; I apologize that the expression parsing isn't a little more abstracted for you, but the result should be usable. Also, the parse_expr is designed for also parsing variable names in the TT2 language, so the first portion of the method applies variable names. The entire thing could be cut down considerably if all you want to parse is math (no variables). Paul Seamons

Re: clarifying the spec for 'ref'

2006-08-25 Thread Paul Seamons
on that particular class. No methods are removed. This is very similar to read only strings. Paul Seamons

Nested statement modifiers.

2006-09-01 Thread Paul Seamons
that it shouldn't be too hard to change. The question is would a patch to add the functionality be accepted if I went to the trouble of figuring out how to do it? Paul Seamons Section of pge2past.tg that re-writes the expression to be enclosed by an if block: transform past (Perl6::G

Re: Nested statement modifiers.

2006-09-01 Thread Paul Seamons
> This was definitively rejected by Larry in 2002: Yes. That is good to see and I do think I remember seeing that or some similar postings come to think of it. Thank you for shaking my memory. Now it is 2006. Object syntax has changed. Little bits and pieces (and sometimes larger chunks) of

Re: Nested statement modifiers.

2006-09-01 Thread Paul Seamons
> $no or $false or $yes and $true and say "OK then" ; > > $no or $false or say "OK then" if $yes and $true ; Thank you for your reply. I know there are other ways to do it. I've had no choice but to do it other ways in Perl5. I don't think I have ever used that notation (outside of file open a

Re: Nested statement modifiers.

2006-09-02 Thread Paul Seamons
> From my early conversations with Larry, I recall that the reason is that > RSTS/E BASIC-PLUS had nested trailing modifiers, and both Larry and I saw > many abuses of these over the years. Therefore, he decided not to repeat > that abomination, limiting it to precisely one level deep. I'm happy

Re: Nested statement modifiers.

2006-09-02 Thread Paul Seamons
> > Yeah, every once in a while, I've wanted the second layer, but I'm > > willing to rewrite the statement as a true normal if/while instead of a > > backwards if/while, and it *does* help the overall readability. > > I'd concede that the actual useful uses are rare enough to not warrant > giving

Re: Nested statement modifiers.

2006-10-03 Thread Paul Seamons
> Of course, that wasn't exactly what you were asking, but it does present > a practical solution when you want to: > > {say $_ for =<>}.() if $do_read_input; > > Which I just verified works fine under current pugs. Thank you. Hadn't thought of that. I think that is workable. But it also

Re: Nested statement modifiers.

2006-10-03 Thread Paul Seamons
> It relates to some old problems in the early part of the RFC/Apocalypse > process, and the fact that: > > say $_ for 1..10 for 1..10 > > Was ambiguous. The bottom line was that you needed to define your > parameter name for that to work, and defining a parameter name on a > modifier means t

Re: Nested statement modifiers.

2006-10-04 Thread Paul Seamons
> It may be more useful to discuss this issue using less contrived > examples. :) I would agree. I haven't had any use for a double "if" or a double "for". The double "if" case is handled by "&&". The double "for" case is handled by "for" and "map". The interesting cases are combinations of "

Re: Runtime role issues

2006-10-11 Thread Paul Seamons
> First, when a role is applied to a class at runtime, a instance of that > class in another scope may specifically *not* want that role. Is there a > way of restricting a role to a particular lexical scope short of applying > that role to instances instead of classes? Seems like you could use an

Re: List assignment question

2006-11-15 Thread Paul Seamons
> > my ($a, undef, $b) = 1..3; > > Huh. I didn't think that worked in Perl 5, either. What am I > misremembering? I distinctly recall having to do things like (my $a, undef, > my $b) to avoid errors because you can't assign to undef. Maybe I'm just > hallucinating. Are you remembering this:

Re: generic ordinal-relevant operators

2006-11-16 Thread Paul Seamons
> Yes. He also accepted the proposal to add min and max operators - > although I'm unsure why they weren't included as functions/methods > instead. It seems more natural to me to say 'max($a, $b, $c)' or > '($a, $b, $c).max' instead of '[max] $a, $b, $c' or '$a max $b max > $c'. Although it _doe

Re: Smart Matching clarification

2006-11-17 Thread Paul Seamons
> So maybe we have some or all of: > > .keys .sortkeys > .values .sortvalues > .kv .sortkv > .pairs.sortpairs > > Possible variations: .skeys, .ordkeys, etc. Also could flip the > default and make .keys sort by default and then you use .rawkeys to get > unor

Re: Fwd: Numeric Semantics

2007-01-23 Thread Paul Seamons
> While I'm in general agreement with everything you've said it makes me a > tad nervous to hinge so much on the difference of one character. Can you > imagine trying to track down the bug where > > if ($alpha === $beta) { ... } > > really should have been > > if ($alpha == $beta) { ... }

Re: for ... else

2007-03-02 Thread Paul Seamons
> foreach my $item (@items) { > #process each item > } else { > #handle the empty list case > } > > What do you think? I'm not sure if I like it, but there have been several times that I would've used it recently. I think it would certainly have utility. Paul

Re: date and time formatting

2005-06-02 Thread Paul Seamons
> So, if we continue following this API, Perl6 core will contain time(), > but no localtime() nor gmtime(). The Date module will provide human > readable date and time strings, and basic date math. localtime() and gmtime() seem fairly core to me. The array contexts are simple, and the scalar co

Re: File.seek() interface

2005-07-07 Thread Paul Seamons
> We should approach this from the perspective that $fh is an iterator, so > the general problem is "how do we navigate a random-access iterator?". Well - I kind of thought that $fh was a filehandle that knew how to behave like an iterator if asked to do so. There are too many applications tha

Re: WTF? - Re: method calls on $self

2005-07-15 Thread Paul Seamons
I'd have to agree. I also think that .foo should always mean $_.foo in methods, without causing any errors if $?SELF =:= $_ becomes false. OK. There is a lot of historical threads on the subject and already a lot of "legacy" in the Perl6 language. OK - As I understand it, this is what A12 say

Re: Do I need "has $.foo;" for accessor-only virtual attributes?

2005-07-21 Thread Paul Seamons
On Thursday 21 July 2005 12:48 pm, Larry Wall wrote: >     * Don't need to topicalize self any more. > >     * .foo can (again) always be the topic without warnings. Thank you. Do the following exist then: has @x; # private, lexically scoped has @_x; # private, class scoped, rw _x access

Re: Demagicalizing pairs

2005-08-24 Thread Paul Seamons
I don't think this example reads very clearly. Visually you have to parse until you see the next => and then back track one word to figure out the key. > move( from=> $x, $y, delta=> $up, $right ); Personally I'd write that as either move(from => [$x, $y], delta => [$up, $right]); OR as

Re: .method == $self.method or $_.method?

2005-03-18 Thread Paul Seamons
hould work on the invocant period - it just happens to be a coincidence that $_ is the same as the invocant for most of the time. Paul Seamons I'll go back to lurking about now.

Re: eval (was Re: New S29 draft up)

2005-03-18 Thread Paul Seamons
> eval read :file("foo") How about: eval slurp "foo"; Paul Seamons

Re: [pugs] regexp ignore case

2005-04-14 Thread Paul Seamons
I would think that :p5 should behave as perl5 does by default. That would mean that /x and /s aren't on by default (for p5). As this is my first post about pugs - all I can say is "wow." It is great to already be coding perl6. Thanks Autrijus and crew. Paul On Thursday 14 April 2005 07:36 a

Statement modifier scope

2005-04-15 Thread Paul Seamons
The following chunks behave the same in Perl 5.6 as in Perl 5.8. Notice the output of "branching" statement modifiers vs. "looping" statement modifiers. perl -e '$f=1; {local $f=2; print "$f"} print " - $f\n"' # prints 2 - 1 perl -e '$f=1; {local $f=2 if 1; print "$f"} print " - $f\n" # pr

Re: Statement modifier scope

2005-04-15 Thread Paul Seamons
On Friday 15 April 2005 11:57 am, Juerd wrote: > Paul Seamons skribis 2005-04-15 11:50 (-0600): > > my %h = ; > > { > > temp %h{$_} ++ for %h.keys; > > Just make that two lines. Is that so bad? > > temp %h; > %h.values »++; > For the given exa

Re: Statement modifier scope

2005-04-15 Thread Paul Seamons
> > temp %h; > %h{ %other.keys } = %other.values; > > or even > > temp %h{ %other.keys } = %other.values; > > should work well already? Almost - but not quite. In Perl5 perl -MData::Dumper -e '%h=qw(a 1 b 2); {local %h; $h{a}="one"; print Dumper \%h} print Dumper \%h; $VAR1 = {

Re: Statement modifier scope

2005-04-15 Thread Paul Seamons
On Friday 15 April 2005 12:28 pm, Juerd wrote: > temp %h{ %other.keys } = %other.values; Oops missed that - I like that for solving this particular problem. It does even work in Perl5: perl -MData::Dumper -e '%h=qw(a 1 b 2); {local @h{qw(a b)}=("one","two"); print Dumper \%h} print Dumper \%h'

Re: Statement modifier scope

2005-04-15 Thread Paul Seamons
> I'm imagining it will be different, as I expect temp to not hide the old > thing. I'm not sure it will. That is another good question. I just searched through the S and A's and couldn't find if temp will blank it out. I am thinking it will act like local. Each of the declarations my, our an

Re: -X's auto-(un)quoting?

2005-04-25 Thread Paul Seamons
I think the original (or the "latest original") reason for breaking .meth from meaning $_.meth is that $_ is transitory and there was no way back to the nameless invocant. In the absense of having a way back, I and others strongly advocated breaking the link. I think we hated to do it. Now i

Re: -X's auto-(un)quoting?

2005-04-25 Thread Paul Seamons
> What is this "way back" you repeatedly mention? > > If it is having a name for the invocant, then there has always been one: > > method foo ($self:) { > for (1..10) { > $self.method(.sqrt) > } > } > > Or, well, two: > > method foo { > my $self := $_

Re: -X's auto-(un)quoting?

2005-04-25 Thread Paul Seamons
Paul Seamons wrote: > Yes, I know there "can be" a "way back." In this thread, none of the > examples give one using existing Perl 6 syntax. They are all proposing new > ways. This is one more. Sorry if this sounded brash. I have a habit of not figuring out that

Re: -X's auto-(un)quoting?

2005-04-25 Thread Paul Seamons
> > meth foo { > > $_.meth; # defaults to the invocant > > .meth; # operates on $_ which defaults to the invocant > > $^.meth; # is the invocant > > $^1.meth; # is the first invocant > > $^2.meth; # is the second invocant > > I'm starting to get confused at the "need" fo

Re: Malfunction Junction, what's your function?

2005-04-27 Thread Paul Seamons
Minor note. Would you want this: >sub &infix:(Str $a, Str $b) { return ($a eq $b) ? $a : ''; } to be: sub &infix:(Str $a, Str $b) { return ($a eq $b) ? $a but bool::true: ''; } (Is that the right way to do it ?) Paul

Re: Nested captures

2005-05-09 Thread Paul Seamons
> =item * > > Quantifiers (except C and C) cause a matched subrule or subpattern to > return an array of C objects, instead of just a single object. What is the effect of the quantifiers C<**{0,1}> and C<**{0,1}?> ? Will they behave like ? and ?? and return a single object - or will they cause t

Re: FW: Periodic Table of the Operators

2004-06-01 Thread Paul Seamons
Or for the few Perl emacs people out there: C-x 8 Y C-x 8 < C-x 8 > Paul On Tuesday 01 June 2004 10:27 am, Gabriel Ebner wrote: > Hello, > > Aaron Sherman wrote: > > Well, first off my US keyboard doesn't contain it. > > Sorry, mistakenly picked an US-International chart. > > > Second, you're no

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Paul Seamons
if you can do @array.push(3 => 'value'); # index 3 gets 'value' # which is harder han @array[3] = 'value' Paul Seamons

Re: Synopsis 2 draft 1 -- each and every

2004-08-19 Thread Paul Seamons
On Thursday 19 August 2004 02:14 pm, Paul Seamons wrote: > @array.push(3 => 'value'); # index 3 gets 'value' Hmm. Well that makes it hard to have an array of pairs - so never mind. Paul Seamons

Re: Instantiation

2004-08-23 Thread Paul Seamons
guess Foo would be a full fledged class which inherits from Some::Module::That::Defines::A::Class. I doubt that it is optimal - but it does give a little bit of flexibility. Paul Seamons

parrotcode.org samples

2004-10-13 Thread Paul Seamons
integer return values The current example is listed below. I am very much a novice at reading PASM so hopefully I didn't interpret the program wrong. Paul Seamons PS - By the way the new examples (I think they are new - they are new to me) are very nice and descriptive of

Re: parrotcode.org samples

2004-10-13 Thread Paul Seamons
Sigh - sheepishly read that I can't even spell "There" correctly. - double sigh. On Wednesday 13 October 2004 12:13 pm, Paul Seamons wrote: > Their is an example at http://www.parrotcode.org/examples/ that returns a > list of integers that span two integers. The return t

Re: Namespaces, part 1 (new bits)

2004-10-04 Thread Paul Seamons
to offer enough justification for the creation of new syntax in either language. Paul Seamons

Re: Referring to source code within Perldoc: the new A<> code

2007-06-21 Thread Paul Seamons
as well - if the code doesn't compile, then perldoc would not be able to generate the code - but it could always show an error that the code doesn't compile and then show what poddoc would show. The outcome is that poddoc can be Pod6 "pure" and perldoc can be (as its name suggests) documentation for Perl. Just my opinions. Paul Seamons

Re: Referring to source code within Perldoc: the new A<> code

2007-06-21 Thread Paul Seamons
> The outcome is that poddoc can be Pod6 "pure" and perldoc can be (as its > name suggests) documentation for Perl. I failed to mention that it also has the benefit that developers can read the perldoc if they care about method details - or they could read poddoc if they only want a 7000 ft view

Re: Referring to source code within Perldoc: the new A<> code

2007-06-21 Thread Paul Seamons
> The outcome is that poddoc can be Pod6 "pure" and perldoc can be (as its > name suggests) documentation for Perl. Sorry to reply to myself twice. Making poddoc independent of Perl 6 opens the doors a little further for having pythondoc and phpdoc and yourlanguageheredoc which extract the POD

Re: [svn:perl6-synopsis] r14449 - doc/trunk/design/syn

2007-09-07 Thread Paul Seamons
> Other available chars: > > <`ws> > <^ws> > <&ws> > <*ws> > <-ws> > <|ws> > <:ws> > <;ws> > I'd vote for <:ws> which is vaguely reminiscent of the former non-capturing parens (?:). It (<:ws>) also bears little similarity to any other regex construct - altho

Generic callback mechanism in NCI

2007-10-19 Thread Paul Seamons
are fired? I don't think I've been clear enough, but I'll post and then answer questions. I think that it would be good to have something that libraries could use without having to drop down to the C level - I just am not sure if this is too much bloat to implement it. Paul Seamons I've been here all along - I'm just really quiet.

Re: Catching exceptions with the // operator

2008-08-06 Thread Paul Seamons
> in my mind, this strays too far from the meaning of C and adds > ambiguity that makes the operator unusable. perhaps there's room for > an operator that gives some sugar for > > my $bill = try { ack() CATCH { thpp() } }; > > but to me that code is concise enough that it doesn't warrant syntacti

Re: Sequential bias in S04 (and Perl6 in general)

2008-01-04 Thread Paul Seamons
> I disagree with the idea that humans don't think concurrently (though > more often they think in terms of data dependencies). I think this is more analogous to event based programming rather than parallel programming. Event based and parallel based have some similarities but the are fundament

Re: Extending Parrot NCI callback functionality

2008-01-17 Thread Paul Seamons
> I am starting to implement a GLUT and OpenGL binding for Parrot. GLUT > is extremely callback-oriented. You essentially can't do anything > beyond open the top-level window until callbacks are functional. You > can't even draw in that window -- the rendered image never actually > appears, and