what is the behavior of the x operator (string replication) with negative values

2007-05-25 Thread Chas Owens
In my mind perl -le 'print join "\n", map { "[" . 0 x $_ . "]" } -1 .. 1' and pugs -e 'say join "\n", map { "[{ 0 x $_}]" }, -1 .. 1' should both print [] [] [0] But the Pugs code throws pugs: List.genericTake: negative argument Is this Pugs specific behavior or has the the x operator change

x and xx operators fail when given negatives

2007-05-25 Thread Chas Owens
"-" x -1 should evaluate to an empty string and 0 xx -1 should evaluate to an empty list. I have hacked pugs/src/Pugs/Prim.hs to correctly handle negatives, but I don't know Haskell very well and am not familiar with the layout of Pugs, so I may have written bad code in a bad place. I have also

Re: x and xx operators fail when given negatives

2007-05-25 Thread Chas Owens
it looks like the patch did not make it to the list, so here it is inline diff -ruN pugs.orig/src/Pugs/Prim.hs pugs/src/Pugs/Prim.hs --- pugs.orig/src/Pugs/Prim.hs 2007-05-25 16:34:55.0 -0400 +++ pugs/src/Pugs/Prim.hs 2007-05-25 15:59:47.0 -0400 @@ -923,6 +923,11 @@ | l

Re: x and xx operators fail when given negatives

2007-05-26 Thread Chas Owens
On 5/25/07, Moritz Lenz <[EMAIL PROTECTED]> wrote: snip It did. For the future I'd suggest that you commit them yourself, that's far more efficient. Just tell us what nick name you want, and somebody will invite you. If you want a different email address then the one you used on this list, please

Re: x, xx, and negative counts

2007-05-29 Thread Chas Owens
On 5/29/07, Mark J. Reed <[EMAIL PROTECTED]> wrote: My expectation before reading the delta was that negative counts would do a reversal: "123" x -1 = "321" ('a', 'b', 'c') xx -3 = ('c', 'b', 'a', 'c', 'b', 'a', 'c', 'b', 'a'); I don't know why I think that makes sense, but it was honestly my

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

2007-05-29 Thread Chas Owens
On 5/29/07, Larry Wall <[EMAIL PROTECTED]> wrote: On Tue, May 29, 2007 at 04:05:39PM -0400, Chas Owens wrote: : On 5/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: : snip : >+If the count is less than 1, returns the null string. : >+The count may not be C<*> because

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

2007-05-29 Thread Chas Owens
On 5/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: snip +If the count is less than 1, returns the null string. +The count may not be C<*> because Perl 6 does not support +infinite strings. (At least, not yet...) snip Does "may not be c<*>" mean that the compiler should throw a fatal erro

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

2007-05-29 Thread Chas Owens
On 5/29/07, Larry Wall <[EMAIL PROTECTED]> wrote: On Tue, May 29, 2007 at 04:43:20PM -0400, Chas Owens wrote: : Just an odd corner case, but :"foo" x -* : should return an empty string and :"foo" xx -* : should return an empty list, right? I'm doubt &

How to die

2007-05-29 Thread Chas Owens
I have poked around a bit in the code and can't find a good way to die. I am currently using perlReplicate n a = if n == 1/0 then error "Infinite replications would exhaust memory" else if n < 0 then genericReplicate 0 a else genericReplicate (truncate n) a But that gives th

Re: propose renaming Hash to Dict

2007-05-31 Thread Chas Owens
On 5/31/07, Darren Duncan <[EMAIL PROTECTED]> wrote: Barring some better name, I highly recommend/propose renaming Hash to Dict. And lets rename Perl to Python. This is just change for the sake of change. snip The term Dict (as a short form of "dictionary") is well understood by general peopl

Re: propose renaming Hash to Dict

2007-06-01 Thread Chas Owens
On 6/1/07, Doug McNutt <[EMAIL PROTECTED]> wrote: At 09:15 -0700 6/1/07, Larry Wall wrote: >: To conclude, as hash definitely tastes better than a dictionary, we >: should stick to that name. ;) >: >: At least nobody can say that Perl is bad taste! > >Then maybe we should rename Array to Skewer o

Re: 'x' vs. 'xx'

2007-06-02 Thread Chas Owens
On 6/2/07, Jonathan Lang <[EMAIL PROTECTED]> wrote: Is there any reason why we can't simply define '$a x $n' as being shorthand for 'cat($a xx $n)'? In what way does the former differ from the latter, other than the use of a Whatever in place of $n? -- Jonathan "Dataweaver" Lang "$a x $n" is

Re: 'x' vs. 'xx'

2007-06-03 Thread Chas Owens
On 6/3/07, Jonathan Lang <[EMAIL PROTECTED]> wrote: Chas Owens wrote: > Jonathan Lang wrote: > > Is there any reason why we can't simply define '$a x $n' as being > > shorthand for 'cat($a xx $n)'? In what way does the former differ > > from t

Re: 'x' vs. 'xx'

2007-06-03 Thread Chas Owens
On 6/3/07, Jonathan Lang <[EMAIL PROTECTED]> wrote: Chas Owens wrote: > Jonathan Lang wrote: > > Chas Owens wrote: > > > Jonathan Lang wrote: > > > > Is there any reason why we can't simply define '$a x $n' as being > > > > sho

Re: 'x' vs. 'xx'

2007-06-03 Thread Chas Owens
On 6/3/07, Jonathan Lang <[EMAIL PROTECTED]> wrote: snip From what you're saying, I get the impression that you think that "'-' x 5" ought to produce a single string of five dashes regardless of whether the context is item or list. Correct? (Note: I'm not asking about what the spec says, since

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

2007-06-14 Thread Chas Owens
On 6/14/07, Damian Conway <[EMAIL PROTECTED]> wrote: snip To get the multi-line quote, you'd need: say :to(END); =begin POD blah blah blah =end POD END Damian Would this work as well? say :to(END); \x{3D}begin POD blah blah blah \x{3D}end POD END

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

2007-06-22 Thread Chas Owens
On 6/22/07, Mark Overmeer <[EMAIL PROTECTED]> wrote: snip * Jonathan Lang ([EMAIL PROTECTED]) [070622 10:41]: snip > Please forgive my ignorance: what does "AST" stand for? The Abstract Syntax Tree, the result of the code parser, un-interpreted. snip You mean it isn't Andrew S. Tanenbaum? W

Re: Web Module (Was: Perl6 new features)

2007-06-22 Thread Chas Owens
On 6/22/07, chromatic <[EMAIL PROTECTED]> wrote: On Thursday 21 June 2007 15:23:38 Smylers wrote: > Has Larry yet decreed whether Web will be bundled with Perl 6? I also like to proceed from the assumption that the only core modules should be those required to install other modules. -- c Pl

Re: Web Module (Was: Perl6 new features)

2007-06-22 Thread Chas Owens
On 6/22/07, Daniel Hulme <[EMAIL PROTECTED]> wrote: On Fri, Jun 22, 2007 at 02:07:35PM -0400, Chas Owens wrote: > On 6/22/07, chromatic <[EMAIL PROTECTED]> wrote: > >I also like to proceed from the assumption that the only core modules > >should be those requir

Re: Web Module (Was: Perl6 new features)

2007-06-22 Thread Chas Owens
On 6/22/07, jerry gay <[EMAIL PROTECTED]> wrote: On 6/22/07, Chas Owens <[EMAIL PROTECTED]> wrote: > Most of the time the policy is enacted by lower-case-l lazy sysadmins > who can't be bothered to type > > perl -MCPAN -e install Foo::Bar > > My normal route a

Re: Web Module (Was: Perl6 new features)

2007-06-22 Thread Chas Owens
On 6/22/07, chromatic <[EMAIL PROTECTED]> wrote: On Friday 22 June 2007 11:07:35 Chas Owens wrote: > Please, god, no. Or at least make two distributions: Bare Perl 6 and > Perl 6. Many companies have a "Only Core Perl" policy. They refuse > to install CPAN modules bec

Re: Ternary endweight alternative?

2007-06-29 Thread Chas Owens
On 6/29/07, raiph <[EMAIL PROTECTED]> wrote: snip Finally, but very importantly imo, what if there are 3 or more alternatives? snip Use a hash or array (depending on the selecting data). system((zip , )<$?OS>); system({win32=>'cls', linux=>'clear', other=>'nuke'}<$?OS>); Of course, this shoul

Re: pugs bugs (or features?)

2007-09-07 Thread Chas Owens
On 9/7/07, Wim Vanderbauwhede <[EMAIL PROTECTED]> wrote: > The following program works fine in pugs r17041 (which is the rev of > /usr/bin/pugs on feather): > > my $r=\{say $x+1}; > my $x=2; > $r(); > > With r17041, this gives 3; > However, on the latest pugs (r17615 or later), it gives an error: >

Re: What is the origin of the nickname, "Texas quotes"?

2007-12-07 Thread Chas. Owens
On Dec 7, 2007 5:46 PM, Thom Boyer <[EMAIL PROTECTED]> wrote: snip > But, back to Perl I didn't get an answer to my follow-up question: > > So, it's because <> is so much bigger than «this», "this", or 'this'? snip That is my take on it: "Everything is bigger in Texas", even French Quotes.

Re: What is the origin of the nickname, "Texas quotes"?

2007-12-07 Thread Chas. Owens
On Dec 7, 2007 11:50 AM, Larry Wall <[EMAIL PROTECTED]> wrote: > On Thu, Dec 06, 2007 at 12:12:36PM -0700, Thom Boyer wrote: > > Larry Wall wrote: > >> Good guess, but no. It comes from the fact that Texas always bragged > >> about how they were the largest state in the union, and had the biggest

Re: Bite-sized Tasks for the Interested (was Re: Standards bearers)

2007-12-13 Thread Chas. Owens
On Dec 13, 2007 6:30 PM, ispyhumanfly <[EMAIL PROTECTED]> wrote: snip > This task list is available via an rss feed. I think this will help > solve the problem in the way you described. snip What is the URL for this feed?

Re: Bite-sized Tasks for the Interested (was Re: Standards bearers)

2007-12-13 Thread Chas. Owens
On Dec 13, 2007 4:37 PM, ispyhumanfly <[EMAIL PROTECTED]> wrote: > Hello list, > > I've created a group on www.hiveminder.org for Perl6 collaborative > task tracking and management. I've done some thinking and I've come up > with a way in which I would like to maintain this group, its organize

Re: Concerns about "{...code...}"

2007-12-21 Thread Chas. Owens
On Dec 21, 2007 4:51 PM, Dave Whipp <[EMAIL PROTECTED]> wrote: > Larry Wall wrote: > > > As for the Q base form, it's not really there so much for end-use, > > For an operator not intended for end use, it has a remarkable low > Huffman rank... > But since it will be combined with adverbs like my

Re: not wanting something

2009-01-06 Thread Chas. Owens
rved for [0-9] and \p{IsDigit} (or the equivalent Perl 6 construct) be used for matching Unicode digits? -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Re: what should be the default extension?

2008-01-07 Thread Chas. Owens
On Jan 7, 2008 1:34 PM, Richard Hainsworth <[EMAIL PROTECTED]> wrote: snip > Definitely a good idea for the implementation / implementors to decide > how to get a resource magically. > > But ... > I have run into situations where I wanted to have more control over > where specific resources were lo

Re: Easy question: what is a "list comprehension" ?

2008-04-05 Thread Chas. Owens
x in xrange(100) if x**2 > 3] -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Re: Nomenclature Question - BEGIN etc.

2008-04-09 Thread Chas. Owens
t;special named blocks" because > that is not the block name (that already means something). snip The perldocs call them "Five specially named code blocks", The Camel names them individually (e.g. BEGIN block). How about phase blocks? They control in what phase of compilation/runti

Re: Nomenclature Question - BEGIN etc.

2008-04-09 Thread Chas. Owens
in. > > I don't know, "phase" sounds too specific to me. Does the catching of > an exception really bring us into a new phase of execution? What > about the LAST time through a loop? etc. > > > -- > Mark J. Reed <[EMAIL PROTECTED]> > It lo

Re: Nomenclature Question - BEGIN etc.

2008-04-09 Thread Chas. Owens
On Thu, Apr 10, 2008 at 2:29 AM, Mark J. Reed <[EMAIL PROTECTED]> wrote: > On Thu, Apr 10, 2008 at 2:26 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > > It looks like they already have a name in S04: Closure traits*. > > > > * http://dev.perl.org/perl6/doc/d

Re: Decrement of Numbers in Strings (Was: [svn:perl6-synopsis] r14460 - doc/trunk/design/syn)

2008-04-23 Thread Chas. Owens
quot;060")? > Then you'll have the problem that this gets (or might get) interpreted as > octal somewhere; if not in perl6 directly (because of different base > specifications), you're likely to get problems when passing that to other > programs, eg. via system(). snip If you are certain to want a number then you either need to say $a = +("100"); or use +($a) when passing it. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Re: negative index in perl6 array

2009-06-19 Thread Chas. Owens
ve_and_differential_subscripts -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Re: negative index in perl6 array

2009-06-20 Thread Chas. Owens
On Sat, Jun 20, 2009 at 02:49, Aruna Goke wrote: > Chas. Owens wrote: >> >> On Sat, Jun 20, 2009 at 00:58, Aruna Goke wrote: >>> >>> is negative index not allowed in perl6? >>> >>> i tried >>> >>> my @test = (1 .. 20); >>&

Re: A few questions

2009-07-11 Thread Chas. Owens
e.g., of the form ".‽method") for calling > a method on an object if the object is defined and returning undef if it is > not defined?  I was hoping that ".?method" could do this, but it doesn't > seem to (in Rakudo, at least). Not a clue. > > Thank you in advance, >        Minimiscience -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Re: hash slice failed ?

2009-07-18 Thread Chas. Owens
ng ? > > regards > marc > It looks like array dereferencers don't interpolate currently in double quotish strings, so you were trying to look up '@a[0]' in the hash. This is likely a bug a Rakudo. I think S02 says that "@a[0]" should be interpolated and that &q

Re: Annoying list user -- again

2009-11-22 Thread Chas. Owens
ed messages about whitelisting to > anyone who posts to it. > > It's up to the list admins, but I for one wouldn't be too disappointed > if this member was booted from the list. If memory serves me, this is > the third time this happens for this particular member on p

Re: Q: Is there a reason why I can't do this?

2010-12-27 Thread Chas. Owens
convenienced. > The [conditional operator][1] is now spelled test ?? true !! false not test ? true : false. [1] : http://perlcabal.org/syn/S03.html#Conditional_operator_precedence -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Re: Q: Is there a reason why I can't do this?

2010-12-27 Thread Chas. Owens
On Mon, Dec 27, 2010 at 15:55, Daniel Carrera wrote: > On Mon, Dec 27, 2010 at 9:49 PM, Chas. Owens wrote: >> >> The [conditional operator][1] is now spelled test ?? true !! false not >> test ? true : false. > > Thanks! > Now the following code works: > %

Re: Q: Is there a reason why I can't do this?

2010-12-27 Thread Chas. Owens
On Mon, Dec 27, 2010 at 16:00, Chas. Owens wrote: > On Mon, Dec 27, 2010 at 15:55, Daniel Carrera wrote: >> On Mon, Dec 27, 2010 at 9:49 PM, Chas. Owens wrote: >>> >>> The [conditional operator][1] is now spelled test ?? true !! false not >>> test ? tr

Re: Q: Is there a reason why I can't do this?

2010-12-27 Thread Chas. Owens
hello $_[0]\n"; }; $lambda->("world"); Perl 6 just has lots of short cuts that make them nicer. Like the ^ twigil: my $lambda = { say "hello $^name" }; $lambda("world"); -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Re: Q: Is there a reason why I can't do this?

2010-12-27 Thread Chas. Owens
x27;s really the TTIAR thing that makes reading Perl6 so incredibly >> predictable, I think. > > > What is TTIAR? snip It is an error to have Two Terms In A Row. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Re: Q: Is there a reason why I can't do this?

2010-12-27 Thread Chas. Owens
e routines that can have multiple variants that share the same name, selected by arity, types, or some other constraints.][3] [1] : http://perlcabal.org/syn/S03.html#Operator_precedence [2] : http://perlcabal.org/syn/S32/IO.html#multi_print_(*...@list_-->_Bool) [3] : http://perlcabal.org/sy

Re: Q: Is there a reason why I can't do this?

2010-12-28 Thread Chas. Owens
rint to a file handle: > $filehandle.print("Hello world\n"); > $filehandle.say("Hello world"); snip [Indirect object][1] notation is still in Perl 6; it just got an unambiguous syntax: print $filehandle: "Hello world"; [1]: http://perlcabal.org/syn/S12.html#line_274 -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Re: Questions for Survey about Perl

2010-12-29 Thread Chas. Owens
Perl 5, but benefits from Perl 6. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Re: Questions for Survey about Perl

2010-12-31 Thread Chas. Owens
ass the test suite and conforms to the specification IS a Perl 6. Right now the program that passes the most tests and conforms most closely to the specification is Rakudo. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.