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

2008-04-23 Thread Ph. Marek
On Mittwoch, 23. April 2008, Larry Wall wrote: On Wed, Apr 23, 2008 at 04:03:01PM +0100, Smylers wrote: : The algorithm for increment and decrement on strings sounds really good, : however I'm concerned that dealing with all that has made the common : case of integer decrement a little less

Re: multi method dispatching of optional arguments (further refined)

2006-09-05 Thread Ph. Marek
On Tuesday 05 September 2006 07:52, Trey Harris wrote: I don't think you're dumb; the Synopses just require that you intuit certain things from each other, from examples in other Synopses, and so on in a Perlish sort of way; what you're looking for is not spelled out explicitly. It can be

Re: multi method dispatching of optional arguments (further refined)

2006-09-04 Thread Ph. Marek
On Monday 04 September 2006 16:21, Audrey Tang wrote: 2006/9/4, Ph. Marek [EMAIL PROTECTED]: Excuse me for getting into this thread with only minor knowledge about perl6, but will there be MMD based on the *value* of parameters? Like Haskell has. Why, yes, see the various Unpacking

Re: multi method dispatching of optional arguments (further refined)

2006-09-03 Thread Ph. Marek
On Sunday 03 September 2006 14:25, Mark Stosberg wrote: Luke Palmer wrote: On 9/3/06, Mark Stosberg [EMAIL PROTECTED] wrote: Note that the variant /with/ the parameter can be considered an exact match, but but the variant /without/ it cannot be considered an exact match. Excuse me for

Re: Do chained comparisons short-circuit?

2006-01-18 Thread Ph. Marek
On Thursday 19 January 2006 04:25, Luke Palmer wrote: On 1/19/06, Joe Gottman [EMAIL PROTECTED] wrote: Suppose I have code that looks like this: my ($x, $y, $z) = (1, 2, 3); say sorted backward if ++$x ++$y ++$z; Will $z be incremented even though the

Re: reduce metaoperator on an empty list

2005-06-07 Thread Ph. Marek
On Tuesday 07 June 2005 23:41, Luke Palmer wrote: On 6/7/05, Larry Wall [EMAIL PROTECTED] wrote: Okay, I've made up my mind. The err option is not tenable because it can cloak real exceptions, and having multiple versions of reduce is simply multiplying entities without adding much power.

Re: Zero-day rules implementation status in Pugs

2005-05-10 Thread Ph. Marek
On Monday 09 May 2005 19:36, Autrijus Tang wrote: On Mon, May 09, 2005 at 10:51:53PM +1000, Damian Conway wrote: Autrijus wrote: /me eagerly awaits new revelation from Damian... Be careful what you wish for. Here's draft zero. ;-) ...and here is my status report of the Zero-Day exploit,

S5 and overlap

2004-09-21 Thread Ph. Marek
# With the new :ov (:overlap) modifier, the current rule will match at all possible character positions (including overlapping) and return all matches in a list context, or a disjunction of matches in a scalar context. The first match at any position is returned. $str = abracadabra;

Re: push with lazy lists

2004-07-18 Thread Ph. Marek
On Friday 16 July 2004 18:23, Jonadab the Unsightly One wrote: Please take my words as my understanding, ie. with no connection to mathmatics or number theory or whatever. I'll just say what I believe is practical. [...] I'd believe that infinity can be integer, ie. has no numbers after

Re: push with lazy lists

2004-07-14 Thread Ph. Marek
On Wednesday 14 July 2004 08:39, David Storrs wrote: To repeat Dave and myself - if @x = 1 .. Inf; then rand(@x) should be Inf, and so print $x[rand(@x)]; should give Inf, as the infinite element of @x is Inf. Please take my words as my understanding, ie. with no

Re: push with lazy lists

2004-07-13 Thread Ph. Marek
--- Larry Wall [EMAIL PROTECTED] wrote: The hard part being to pick a random number in [0,Inf) uniformly. :-) Half of all numbers in [0, Inf) are in the range [Inf/2, Inf). Which collapses to the range [Inf, Inf). Returning Inf seems to satisfy the uniform distribution requirement: if you

Re: question regarding rules and bytes vs characters

2004-07-12 Thread Ph. Marek
: Hello everybody, : : I'm about to learn myself perl6 (after using perl5 for some time). I'm also trying to learn perl6 after using perl5 for some time. :-) I wouldn't even try to compare you and me :-) Pretty close. The way it's set up currently, $len is a reference to a variable

Re: push with lazy lists

2004-07-12 Thread Ph. Marek
On Thursday 08 July 2004 05:25, Larry Wall wrote: : say @x[rand]; # how about now? Well, that's always going to ask for @x[0], which isn't a problem. However, if you say rand(@x), it has to calculate the number of elements in @x, which could take a little while... I'd expect to be rand(@x) =

question regarding rules and bytes vs characters

2004-05-31 Thread Ph. Marek
Hello everybody, I'm about to learn myself perl6 (after using perl5 for some time). One of my first questions deals with regexes. I'd like to parse data of the form Len: 15\n (15 bytes data)\n Len: 5\n (5 bytes data)\n \n OtherTag: some value

Re: The Sort Problem

2004-02-13 Thread Ph. Marek
Am Freitag, 13. Februar 2004 01:40 schrieb Larry Wall: On Thu, Feb 12, 2004 at 04:29:58PM -0500, Uri Guttman wrote: : again, confusing. why should the order of a binary operator mean so : much? the order of a sort key is either ascending or descending. that is : what coders want to specify.

Re: The Sort Problem

2004-02-12 Thread Ph. Marek
... so here is a (very rough and probably broken) syntax idea building on that: sort :key { :descend :string .foo('bar').substr( 10, 3) } :key { :int .foo('baz') } :key { :float .foo('amount') } @unsorted ; I see a kind of problem here: If the parts of the key

calling functions/class methods

2004-01-30 Thread Ph. Marek
Hello everybody, first of all please forgive me if I'm using the wrong words - I'm not up to date about the (current) meanings of methods, functions, etc. I read the article http://www.cuj.com/documents/s=8042/cuj0002meyers/ There is stated (short version - read article for details):

Re: Next Apocalypse

2003-09-15 Thread Ph. Marek
Because there are some assertions that can lead the optimizer to make some fundamental assumptions, and if those assumptions get violated or redefined while you're in the middle of executing a function that makes use of those assumptions, well... Changing a function from pure to impure,

Re: regex matching from a position ?

2003-02-12 Thread Ph. Marek
Phil, please see the perlfunc entry for pos and the perlre section on \G. This is what you need. Thanks a lot! I know about pos but thought it was read-only. And \G is relatively new, isn't it? Certainly wasn't existing in '97 when I learned perl :-) And the basics are seldom read again in

regex matching from a position ?

2003-02-11 Thread Ph. Marek
Hello everybody, I've sometimes the task to analyse a string starting from a given position, where this position changes after each iteration. (like index() does) As this is perl there are MTOWTDIIP but I'd like to know the fastest. So I used Benchmark.pm to find that out. (script attached)

hyper/vector operation operator

2002-11-27 Thread Ph. Marek
Hello everyone! First of all - I do not closely follow perl6/parrot development. I read this week on perl6 on www.perl.com but that's it - so if I'm completly off the track, let me know. Regarding the discussions about the hyper operator (eg adding elements of 2 arrays into another array)