Some questions about miltislices and other things

2007-03-02 Thread Ryan Richter
As a little Perl 6 exercise I translated the Perl 5 Markov chain / dissociated-press script from _The Practice of Programming_: http://cm.bell-labs.com/cm/cs/tpop/markov.pl Here's my Perl 6 attempt, with support for different prefix lengths. my $n = 2; # prefix

Re: Some questions about miltislices and other things

2007-03-13 Thread Ryan Richter
On Mon, 12 Mar 2007 17:41:27 -0700, Larry Wall wrote: On Fri, Mar 02, 2007 at 01:33:50PM -0500, Ryan Richter wrote: : while ($_ = %state{@@w}.pick).say { You maybe don't want each word on a separate line... They did that in the original for some reason. In the unlikely event that I want

Re: Is Perl 6 too late?

2007-05-14 Thread Ryan Richter
On Mon, May 14, 2007 at 20:41:35 +0300, Gabor Szabo wrote: On 5/14/07, John Macdonald [EMAIL PROTECTED] wrote: Removing the sigil on a function call (it used to always be written sub(args...)) did, I think, lead to the difficulty in perl5 where it became difficult to add new keyword

Re: Pair notation for number radix

2007-12-04 Thread Ryan Richter
On Tue, Dec 04, 2007 at 07:39:16AM -0800, Larry Wall wrote: On Sun, Oct 07, 2007 at 03:01:06PM -0600, David Green wrote: What happened to the suggestion of using ` to designate units? It's kinda caught between two other notions. On the one hand, we're trying to reserve ` for user

Re: Factoring Arguments

2007-12-21 Thread Ryan Richter
On Fri, Dec 21, 2007 at 08:41:54AM -0800, Jonathan Lang wrote: and so on, you might do something like: with qq :(c = false) { I think this can be done with normal currying, something like temp circumfix: := quote:qq.assuming(:!c); -ryan

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

2008-01-17 Thread Ryan Richter
On Thu, Jan 17, 2008 at 10:57:11AM +0100, Moritz Lenz wrote: what happens if some of the characters aren't cased at all, like white spaces? my $str = AB DE; $str ~~ s:ii/.*/abcde/; is the result ABcDE ? or is the space ignored and the substition is performed as if $str was ABDE in the

Re: pluralization idea that keeps bugging me

2008-02-10 Thread Ryan Richter
On Sun, Feb 10, 2008 at 12:56:14PM +0300, Richard Hainsworth wrote: How - in sketch form - would I go about creating a module to do what I suggest? I am not suggesting someone writes a module I have suggested, but the barebones steps to creating a new metacharacter. I have written infix

Re: Getting Started - Synopsis

2008-03-30 Thread Ryan Richter
On Sun, Mar 30, 2008 at 07:28:46PM +0800, Agent Zhang wrote: The latest HTML version of all the Synopses can be found at http://perlcabal.org/syn/ , which is automatically updated from both SVN repositories every one hour by a cron job running on feather. Actually, that cron job hasn't been

Re: Getting Started - Synopsis

2008-03-31 Thread Ryan Richter
On Mon, Mar 31, 2008 at 09:54:58AM +0800, Agent Zhang wrote: On Sun, Mar 30, 2008 at 9:23 PM, Ryan Richter [EMAIL PROTECTED] wrote: Actually, that cron job hasn't been working for a long time... I've just checked the cronjob mails and it seems to me that the update-syn script

Re: Conceptual questions about Objects

2008-04-04 Thread Ryan Richter
On Fri, Apr 04, 2008 at 06:31:56PM -0500, John M. Dlugosz wrote: chromatic chromatic-at-wgz.org |Perl 6| wrote: It shouldn't be. So you are saying that in the example of class C { has $.a; method a ($self:) You've declared method a twice here. has $.a is equivalent to

Re: understanding STD.pm

2008-04-05 Thread Ryan Richter
On Sat, Apr 05, 2008 at 08:22:42AM -, John M. Dlugosz wrote: OK, you got me. What is the � used for? For example, ?{ $�.pos === $!ws_to }. I only see that character as used in this manner (a variable name?), never defined (e.g. as a variable or parameter) anywhere. Something is

Re: understanding STD.pm

2008-04-05 Thread Ryan Richter
On Sat, Apr 05, 2008 at 09:16:13AM -0400, Ryan Richter wrote: On Sat, Apr 05, 2008 at 08:22:42AM -, John M. Dlugosz wrote: OK, you got me. What is the ? used for? For example, ?{ $?.pos === $!ws_to }. I only see that character as used in this manner (a variable name?), never

Re: Nomenclature Question - BEGIN etc.

2008-04-10 Thread Ryan Richter
On Thu, Apr 10, 2008 at 04:38:27PM -0400, Brandon S. Allbery KF8NH wrote: On Apr 10, 2008, at 13:29 , John M. Dlugosz wrote: I might have misremembered, but i thought labels were followed by a colon in Perl 6. A quick scan of the docs... It is illegal for a provisional subroutine call to

Re: slurpy scalar parameter?

2008-04-12 Thread Ryan Richter
On Sat, Apr 12, 2008 at 05:06:53AM -, John M. Dlugosz wrote: What is the difference between: sub head(*$head, [EMAIL PROTECTED]) and sub head($head?, [EMAIL PROTECTED]) If you call head(@foo), in the first $head gets @foo[0] and in the second it gets nothing (you didn't pass a

Re: The Inf type

2008-06-02 Thread Ryan Richter
On Mon, Jun 02, 2008 at 11:50:20AM -0700, Jon Lang wrote: TSa wrote: John M. Dlugosz wrote: The sqrt(2) should be a Num of 1.414213562373 with the precision of the native floating-point that runs at full speed on the platform. That makes the Num type an Int with non-uniform spacing.

Re: building pugs under Fedora 9 doesn't work

2008-06-03 Thread Ryan Richter
On Tue, Jun 03, 2008 at 12:03:00PM +0200, Moritz Lenz wrote: My last successful build was r18093 with GHC 6.6.1. Maybe we should just die in Makefile.PL until somebody finds a fix. Maybe we should just revert the pugs source to that rev. Haven't the modifications since then basically just

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

2008-06-11 Thread Ryan Richter
On Wed, Jun 11, 2008 at 02:09:41PM -0700, [EMAIL PROTECTED] wrote: +Note that these differ: + +$min ..^ $max$ min .. $max-1 +$min .. ^$max# $min .. (0..$max-1) The punctuation looks a little funny on the first line. Also, are $min ..^ $max and $min .. $max-1 really the same

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

2008-06-11 Thread Ryan Richter
On Wed, Jun 11, 2008 at 04:49:18PM -0700, [EMAIL PROTECTED] wrote: -$min ..^ $max$ min .. $max-1 -$min .. ^$max# $min .. (0..$max-1) +0 ..^ 10 # 0 .. 9 +0 .. ^10 # 0 .. (0..9) Ah, I should have been more specific - I meant that, since ~~ treats Ranges as continuous

Re: Rakudo test miscellanea

2008-06-26 Thread Ryan Richter
On Thu, Jun 26, 2008 at 09:55:09AM -0700, Larry Wall wrote: We could go as far as to guarantee that Nums do rational arithmetic out to a certain point, but probably what the financial insitutions want is special fixed-point types that assume a divisor anyway. Would any financial institution

Re: multi return values

2008-11-21 Thread Ryan Richter
On Fri, Nov 21, 2008 at 08:16:21PM +0100, Moritz Lenz wrote: Andy Colson wrote: (The thing that's still wrong with your code is that you need a whitespace after the 'my', otherwise my(...) should be parsed as a function call). Also this, I think: return($a, $b); -ryan