hyperoperators and multi-dimensional datastructures

2005-05-19 Thread Anthony Heading
Is there a way to target hyperoperators at different axes of a multi-dimensional array? This is an attractive feature of various APL-like languages, viz. e.g. in J: a =. 2 5 $ i. 7 - a simple 2-by-5 array a 0 1 2 3 4 - like this 5 6 0 1 2 +/"1 a - sum reduc

Re: reduce metaoperator

2005-05-19 Thread Edward Cherlin
On Sat, May 07, 2005 at 01>00>08PM -0700, Larry Wall wrote: > On the other hand, since we've distinguished hyperops on > infixes from hyperops on unaries, maybe an infix hyperop in > unary position just does the thing to itself: > > @squares = Â*Â @list; > > which gives us a sum-of-squares tha

Re: reduce metaoperator on an empty list

2005-05-19 Thread Michele Dondi
On Wed, 18 May 2005, Matt Fowles wrote: All~ What does the reduce metaoperator do with an empty list? Interesting. Mathematically an empty sum is zero and an empty product is one. Maybe each operator {c,s}hould have an associated method returning its neutral element for [] to use it on empty list

Re: reduce metaoperator on an empty list

2005-05-19 Thread Michele Dondi
On Wed, 18 May 2005, Rob Kinyon wrote: 1) undef (which may or may not contain an exception), or 2) some unit/identity value that is a trait of the operator, depending on whether or not people think (2) is actually a good idea. I would think that the Principle of Least Surprise points to (1), I don'

Complex Arithmetic

2005-05-19 Thread Edward Cherlin
There was a discussion of the principal value of square root on this list some time back, making the point that for positive real numbers the positive square root is the value of the standard function. In the complex plane it is desirable to define the principal value at every point so as to pr

Re: [perl #35855] Problem with Perl 5.6.1

2005-05-19 Thread Leopold Toetsch
François" PERRAD <[EMAIL PROTECTED]> wrote: > I notice that building with Perl 5.6.1 (on Win32 with Perl 5.6.1 > ActiveState-build 635 and MinGW) causes problem. A different Perl works? > $ parrot > Assertion failed: (int)io->image->bufused >= 0, file src/pmc_freeze.c, line > 478 > abnormal pr

Re: r8118: MSWin32 Test Results

2005-05-19 Thread Leopold Toetsch
Ron Blaschke <[EMAIL PROTECTED]> wrote: > Below are the test results of > Windows XP SP2 > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 > for 80x86 > Activestate Python 2.4.1 Build 245 > Activestate Perl 5.8.6 Build 811 [ all dynclasses - ok linker problem ]

Re: [perl #35305] [PATCH] skip threads 'detatch' test on win32

2005-05-19 Thread Leopold Toetsch
Vladimir Lipsky <[EMAIL PROTECTED]> wrote: > 1) Why the heck Easy: it's not in the MANIFEST. Why: patches scattered between inline and attached and the MANIFEST part missing ... it's easy to overlook. > -# ifdef _MCS_VER1 > +# ifdef _MCS_VER Thanks, applied - hope that's really the whole thin

Re: reduce metaoperator on an empty list

2005-05-19 Thread Edward Cherlin
On Wednesday 18 May 2005 17:57, Matt Fowles wrote: > All~ > > What does the reduce metaoperator do with an empty list? Here is the last answer from Ken Iverson, who invented reduce in the 1950s, and died recently. file:///usr/share/j504/system/extras/help/dictionary/intro28.htm Identity Functions

Re: reduce metaoperator on an empty list

2005-05-19 Thread TSa (Thomas Sandlaß)
Michele Dondi wrote: On Wed, 18 May 2005, Rob Kinyon wrote: 1) undef (which may or may not contain an exception), or 2) some unit/identity value that is a trait of the operator, I think that the unit/identity/neutral value is a trait of the operator *and* the type of the values which are expected f

Syntax for specifying role parameters

2005-05-19 Thread Ingo Blechschmidt
Hi, I wondered if it would be useful/good/nice if the syntax for specifying role parameters would be the same as the standard subroutine signature syntax (minus the colon, which separates the parameters which do account to the long name of the role from the ones which don't). E.g.: rol

Re: ./method

2005-05-19 Thread Martin Kuehl
On 5/15/05, Juerd <[EMAIL PROTECTED]> wrote: > A few days ago, when typing ./pugs,... You can guess the rest :) > > I suggest > > ./method > > to mean $?SELF.method, and > > ../method > > to mean $?SELF.SUPER::method, or however that's normally written. > > This syntax doesn't clash w

Re: Syntax for specifying role parameters

2005-05-19 Thread TSa (Thomas Sandlaß)
HaloO Ingo, you wrote: I wondered if it would be useful/good/nice if the syntax for specifying role parameters would be the same as the standard subroutine signature syntax (minus the colon, which separates the parameters which do account to the long name of the role from the ones which don't).

Re: [perl #35305] [PATCH] skip threads 'detatch' test on win32

2005-05-19 Thread jerry gay
much better! one failing test now... with my inline patch to remove the skip block around test 6. On 5/19/05, Leopold Toetsch <[EMAIL PROTECTED]> wrote: > Vladimir Lipsky <[EMAIL PROTECTED]> wrote: > > > 1) Why the heck > > Easy: it's not in the MANIFEST. Why: patches scattered between inline >

Re: Syntax for specifying role parameters

2005-05-19 Thread Ingo Blechschmidt
Hi, "TSa (Thomas SandlaÃ)" wrote: > you wrote: >> I wondered if it would be useful/good/nice if the syntax for >> specifying role parameters would be the same as the standard >> subroutine signature syntax (minus the colon, which >> separates the parameters which do account to the long name >> of

Re: reduce metaoperator on an empty list

2005-05-19 Thread C. Scott Ananian
On Wed, 18 May 2005, Rob Kinyon wrote: On 5/18/05, Stuart Cook <[EMAIL PROTECTED]> wrote: To summarise what I think everyone is saying, []-reducing an empty list yields either: 1) undef (which may or may not contain an exception), or 2) some unit/identity value that is a trait of the operator, depe

Re: Parrot as an extension language

2005-05-19 Thread Colin Paul Adams
> "Autrijus" == Autrijus Tang <[EMAIL PROTECTED]> writes: Autrijus> You may wish to use Parrot_call_sub's "SS" form, where Autrijus> you pass in a string and get back a string. Something Autrijus> like this: Autrijus> my $interp = Parrot_new(undef); Autrijus> # .

[S29] uniq

2005-05-19 Thread Ingo Blechschmidt
Hi, three quick questions: Is it intentional that there's no uniq in the current S29[1] draft? See [2] for Damian saying that uniq is probably in. I wondered what uniq's default comparator should be, =:=? Should it be possible to give an own comparator block, similar as with grep? E.g. uniq ;

Re: [S29] uniq

2005-05-19 Thread Rod Adams
Ingo Blechschmidt wrote: Hi, three quick questions: Since Aaron is still getting up to speed, I'll take a stab at these. Is it intentional that there's no uniq in the current S29[1] draft? See [2] for Damian saying that uniq is probably in. Just hasn't been entered. I wondered what uniq's def

Re: Parrot as an extension language

2005-05-19 Thread Jeff Horwitz
On 19 May 2005, Colin Paul Adams wrote: [snip] > I'm having a problem with this. > For Parrot_find_global, I'm specifying global.h as one of the header > files which must be read to generate definitions from. > But this is failing, apparently because PMC isn't defined. > > So I tried to find wher

Re: Syntax for specifying role parameters

2005-05-19 Thread TSa (Thomas Sandlaß)
Ingo Blechschmidt wrote: I meant: The colon should still act as the delimiter between the params which account to the long name of the role and those which don't, but otherwise the syntax should be the same as the standard subroutine signature syntax, allowing optional params, etc. I don't think th

Re: [S29] uniq

2005-05-19 Thread Ingo Blechschmidt
Hi, Rod Adams wrote: >>I wondered what uniq's default comparator should be, =:=? > I'd have gone with ~~ Even better. :) --Ingo -- Linux, the choice of a GNU | Row, row, row your bits, gently down the generation on a dual AMD | stream... Athlon!|

Re: Parrot as an extension language

2005-05-19 Thread Colin Paul Adams
> "Jeff" == Jeff Horwitz <[EMAIL PROTECTED]> writes: >> What headers do I need to read for the parrot_find_global call? Jeff> Parrot_PMC is the public type, and behind the scenes it's Jeff> defined as PMC *. Jeff> all you should need to include is embed.h, extend.h and for

Re: [perl #35305] [PATCH] skip threads 'detatch' test on win32

2005-05-19 Thread Vladimir Lipsky
jerry gay <[EMAIL PROTECTED]> wrote: much better! one failing test now... D:\usr\local\parrot-HEAD\trunk>perl t/harness t/pmc/threads.t t/pmc/threadsok 3/11# Failed test (t/pmc/threads.t at line 163) # got: 'start 1 # in thread # done # Can't spawn ".\parrot.exe "D:\usr\local\pa

Re: [perl #35305] [PATCH] skip threads 'detatch' test on win32

2005-05-19 Thread Leopold Toetsch
Jerry Gay <[EMAIL PROTECTED]> wrote: > here's the patch to unskip test 6: Thanks, applied. leo

Re: ./method

2005-05-19 Thread Carl Franks
On 5/19/05, Martin Kuehl <[EMAIL PROTECTED]> wrote: > I have tried, but I can't make myself like it. I'm afraid I have to agree. When I saw it used in code after this discussion (I think it must have been somewhere in pugs t/ or ext/) my reaction was "yuck". (for what it's worth) Carl

Re: Parrot as an extension language

2005-05-19 Thread Colin Paul Adams
> "Jeff" == Jeff Horwitz <[EMAIL PROTECTED]> writes: Jeff> all you should need to include is embed.h, extend.h and for Jeff> now, resources.h. i'm actually working on fleshing these Jeff> files out to be more consistent wrt the public API. I'm getting real close now. But I'm hav

Re: Complex Arithmetic

2005-05-19 Thread Luke Palmer
On 5/19/05, Edward Cherlin <[EMAIL PROTECTED]> wrote: > It turns out that the domain and range and the location of the > cut lines have to be worked out separately for different > functions. Mathematical practice is not entirely consistent in > making these decisions, but in programming, there seem

Re: hyperoperators and multi-dimensional datastructures

2005-05-19 Thread Luke Palmer
On 5/18/05, Anthony Heading <[EMAIL PROTECTED]> wrote: > Is there a way to target hyperoperators at different axes of a > multi-dimensional array? This is an attractive feature of > various APL-like languages, viz. e.g. in J: > > a =. 2 5 $ i. 7 - a simple 2-by-5 array > a > 0 1 2 3

Re: Parrot as an extension language

2005-05-19 Thread Colin Paul Adams
> "Colin" == Colin Paul Adams <[EMAIL PROTECTED]> writes: > "Jeff" == Jeff Horwitz <[EMAIL PROTECTED]> writes: Colin> Can't make 'UTF-8' charset strings Colin> Despite what the documentation says: Colin> encoding Colin> This specifies the encoding used to encode the cha

Re: Syntax for specifying role parameters

2005-05-19 Thread TSa (Thomas Sandlaß)
Miroslav Silovic wrote: Uhm, but C++ templates are subject to (compile-time) MMD, once you specialise them. In other words, role Something[Int $num] {...} role Something[String $num] {...} Hmm, C++ has no free floating templates. They always template a class/struct or a function. The Perl6 equiva

s/.../{ $junction }/

2005-05-19 Thread Ingo Blechschmidt
Hi, while writing a preliminary p6explain, I wondered if the following should work: my $text = "aBc"; $text ~~ s/B/{ "C"|"D" }/; say $text.values; # aCc aDc This would be extremely handy for p6explain, as I'm currently parsing a datafile which looks like... + Standard mathematical inf

Re: Syntax for specifying role parameters

2005-05-19 Thread Miroslav Silovic
[EMAIL PROTECTED] wrote: I don't think that a role has a long and a short name. This is because they aren't subject to MMD. I think of them more as beeing expanded like C++ templates even though the actual mechanism will be much more sophisticated. Actually I think of them as F-bounds as well ;) Uh

[perl #35888] [PATCH] r8122: internal_ to real_exceptions for bigint

2005-05-19 Thread via RT
# New Ticket Created by jerry gay # Please include the string: [perl #35888] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/rt3/Ticket/Display.html?id=35888 > the attached patch converts internal_exceptions to real_exceptions in bigint.pmc. also, th

Re: [S29] uniq

2005-05-19 Thread Mark Overmeer
* Ingo Blechschmidt ([EMAIL PROTECTED]) [050519 16:52]: > Should it be possible to give an own comparator block, similar as with > grep? E.g. > uniq ; # > > uniq:{ abs $^a == abs $^b } 42, 23, -23, 23, 42 > # 42, 23, 42 'uniq' differs from 'sort' because there is no

Re: [S29] uniq

2005-05-19 Thread Ingo Blechschmidt
Hi, Mark Overmeer wrote: > * Ingo Blechschmidt ([EMAIL PROTECTED]) [050519 16:52]: >> Should it be possible to give an own comparator block, similar as >> with grep? E.g. >> uniq ; # >> >> uniq:{ abs $^a == abs $^b } 42, 23, -23, 23, 42 >> # 42, 23, 42 > > 'uniq' d

Re: r8118: MSWin32 Test Results

2005-05-19 Thread Ron Blaschke
Leopold Toetsch wrote: > Ron Blaschke <[EMAIL PROTECTED]> wrote: >> t\op\spawnw.t 5 1280 65 83.33% 2-6 > exit status? Quite likely, yes. I'd gladly provide a patch, if someone would decide The Right Thing To Do. That is, what should Parrot_Run_OS_Command return? Somethi

Re: [PATCH] More t/p6rules tests

2005-05-19 Thread Patrick R. Michaud
On Wed, May 18, 2005 at 03:50:07PM -0400, Dino Morelli wrote: > I moved the \N test out of t/p6rules/cclass.t and made a new file for > escape tests: escape.t, currently containing tests for \s \S \w \W \d \D > \n \N > > Patch file for MANIFEST and cclass.t, and new file escape.t attached. I've b

Re: [S29] uniq

2005-05-19 Thread Adriano Ferreira
quoting Damian's original mail[1]: > uniq - remove duplicates without reordering ^^ Would not that mean the original order of the first ocurrence is preserved? This is what Ruby Array#uniq does: [4,1,2,4,2,3,5].uniq => [ 4, 1, 2, 3, 5] The b

Re: [S29] uniq

2005-05-19 Thread Adriano Ferreira
The former implementation can be shortened: sub uniq { my %h; return grep { ! $h{$_}++ } @_; } But realize that none of the proposed solutions (which are based on hashes for computing the return) is amenable to the extension Ingo called for with comparator blocks. Adriano.

Re: (1,(2,3),4)[2]

2005-05-19 Thread TSa (Thomas Sandlaß)
Juerd wrote: Parens and square brackets are very different things. I know. The parens relevant here are the ones for precedence overrides. And Comma is pretty low, so it almost always needs parens around it to form lists. In particular it is below = and friends. The above is more commonly written

Re: [S29] uniq

2005-05-19 Thread Ingo Blechschmidt
Hi, Adriano Ferreira wrote: > quoting Damian's original mail[1]: >> uniq - remove duplicates without reordering > ^^ > > Would not that mean the original order of the first ocurrence is > preserved? This is what Ruby Array#uniq does: > > [4,1

Argument Type Checking

2005-05-19 Thread Joshua Gatcomb
All: I was hoping the following would give me an outright error sub foo (Int $bar) { say $bar; } foo('hello'); I seem to recall, probably incorrectly, that one of the differences with int, Int, and no type declaration at all is that one would happily autoconvert for you, 1 would autoconvert b

Re: Parrot as an extension language

2005-05-19 Thread Leopold Toetsch
Colin Paul Adams wrote: Parrot_new_string and I'm passing "UTF-8" as the encoding name. I get back: Can't make 'UTF-8' charset strings ^^^ Despite what the documentation says: encoding Yeah. I'm sorry to say that: you are just hitting a part of Parrot labeled "under (re)co

Re: hyperoperators and multi-dimensional datastructures

2005-05-19 Thread Uri Guttman
> "LP" == Luke Palmer <[EMAIL PROTECTED]> writes: LP> On 5/18/05, Anthony Heading <[EMAIL PROTECTED]> wrote: >> Is there a way to target hyperoperators at different axes of a >> multi-dimensional array? This is an attractive feature of >> various APL-like languages, viz. e.g. in J:

Re: [S29] uniq

2005-05-19 Thread Juerd
Ingo Blechschmidt skribis 2005-05-19 21:07 (+0200): > I read this as that uniq should behave like Unix's uniq(1), i.e. > removing only successive duplicates, e.g.: > uniq [3,3,3,4,3] => [3,4,3] # what I meant > uniq [3,3,3,4,3] => [3,4] # what you meant Which leads to lots of |so

Re: [perl #35305] [PATCH] skip threads 'detatch' test on win32

2005-05-19 Thread Leopold Toetsch
Vladimir Lipsky <[EMAIL PROTECTED]> wrote: >> "D:\usr\local\parrot-HEAD\trunk\t\pmc\threads_4.pasm"' failed with >> exit code 255 > Parrot_really_destroy needs to be fixed $verbose++ please, thanks leo

Re: [S29] uniq

2005-05-19 Thread Adriano Ferreira
On 5/19/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: > I read this as that uniq should behave like Unix's uniq(1), i.e. > removing only successive duplicates, e.g.: > uniq [3,3,3,4,3] => [3,4,3] # what I meant > uniq [3,3,3,4,3] => [3,4] # what you meant That has been discussed

How do I... create a new meta operator?

2005-05-19 Thread Ingo Blechschmidt
Hi, quoting A12: > infix_postfix_meta_operator:<=> $x += 2; > postfix_prefix_meta_operator:{'Â'} @array Â++ > prefix_postfix_meta_operator:{'Â'} -Â @magnitudes > infix_circumfix_meta_operator:{'Â','Â'} @a Â+Â @b so will the following work? # Silly example sub in

How do I... invoke a method reference

2005-05-19 Thread Ingo Blechschmidt
Hi, class Foo { method bar() { 42 } method baz() { &bar } } my $ref = Foo.baz; $ref(); # Don't think this will work # (Error: No invocant specified or somesuch) $ref(Foo.new); # But will this work? How do I specify multiple invocants (when dealing wit

Re: (1,(2,3),4)[2]

2005-05-19 Thread Juerd
"TSa (Thomas Sandlaß)" skribis 2005-05-19 21:06 (+0200): > >The above is more commonly written as > > > >my @b = ([1,2,[3,4]); > Assuming you meant @b = ([1,2,[3,4]]) what do the parens accomplish > here? Thanks for the correction. That is indeed what I meant. The parens do absolutely nothin

Re: How do I... invoke a method reference

2005-05-19 Thread Juerd
Ingo Blechschmidt skribis 2005-05-19 22:45 (+0200): > class Foo { > method bar() { 42 } > method baz() { &bar } > } > my $ref = Foo.baz; My guess: Foo.$ref $object.$ref Just like in Perl 5. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_ju

Re: [S29] uniq

2005-05-19 Thread Damian Conway
Ingo Blechschmidt wrote: Is it intentional that there's no uniq in the current S29[1] draft? See [2] for Damian saying that uniq is probably in. It still probably is. I wondered what uniq's default comparator should be, =:=? &infix:<~~> Should it be possible to give an own comparator block, simil

Re: [S29] uniq

2005-05-19 Thread Ingo Blechschmidt
Hi, Damian Conway wrote: > BTW, I am *sorely* tempted to suggest the following implementation > instead: [...] > which would produce: > > uniq ; # > > uniq { lc } ; # 'a'|'A', 'b', > 'C'|'c', 'd' > > uniq { abs $^value } 42, 23, -23,

Re: How do I... invoke a method reference

2005-05-19 Thread C. Scott Ananian
On Thu, 19 May 2005, Juerd wrote: Ingo Blechschmidt skribis 2005-05-19 22:45 (+0200): class Foo { method bar() { 42 } method baz() { &bar } } my $ref = Foo.baz; My guess: Foo.$ref $object.$ref Just like in Perl 5. I think Ingo was trying to explicitly specify the normally-implic

Re: [S29] uniq

2005-05-19 Thread Rod Adams
Damian Conway wrote: BTW, I am *sorely* tempted to suggest the following implementation instead: which would produce: uniq ; # uniq { lc } ; # 'a'|'A', 'b', 'C'|'c', 'd' uniq { abs $^value } 42, 23, -23, 23, 42;# 42, 23|-23 But I'd

turning Test::More on or off at runtime?

2005-05-19 Thread Vonnahme, Nathan
Hi, I've been using Test::More and others for a few weeks now and trying to code and test at the same time and it's great! Thank you everyone for the modules, docs and articles. I am working with a bunch of scripts that need to run from cron, so they redirect STDOUT and STDERR to files. They a

Re: Inline::Pugs landed to Pugs tree

2005-05-19 Thread Brian Ingerson
On 19/05/05 04:52 +0800, Autrijus Tang wrote: > An one-hour hack of mine proved fruitful. This is Perl 5 script, > calling into Perl 6 functions defined inline: > > #!/usr/bin/perl > use Inline Pugs => ' > sub postfix: { [*] 1..$_ } > sub sum_factorial { [+] 0..$_! } > '

Re: turning Test::More on or off at runtime?

2005-05-19 Thread Michael G Schwern
On Thu, May 19, 2005 at 02:42:18PM -0800, Vonnahme, Nathan wrote: > So I guess the problem is, Test::More produces output when I use() it, > but in some cases I'd like to not use() it, but I don't know whether I > want it until runtime and by then it's already been use()d... I suspect you're doing

Re: r8118: MSWin32 Test Results

2005-05-19 Thread Ron Blaschke
Ron Blaschke wrote: > Leopold Toetsch wrote: >> Ron Blaschke <[EMAIL PROTECTED]> wrote: >>> t\pmc\bigint.t1 256221 4.55% 22 >> What's up with that one? > Maybe my fault. The program segfaults at C in > C. Memory gets allocated by a non-debug version of GMP, > and deall

RE: turning Test::More on or off at runtime?

2005-05-19 Thread Vonnahme, Nathan
> From: Michael G Schwern [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 19, 2005 3:06 PM > On Thu, May 19, 2005 at 02:42:18PM -0800, Vonnahme, Nathan wrote: > > So I guess the problem is, Test::More produces output when I use() it, > > but in some cases I'd like to not use() it, but I don't kn

Re: [S29] uniq

2005-05-19 Thread Luke Palmer
On 5/19/05, Damian Conway <[EMAIL PROTECTED]> wrote: > Ingo Blechschmidt wrote: > > I wondered what uniq's default comparator should be, =:=? > > &infix:<~~> Woah there. ~~ is a good comparator and all, but it's not the right one here. ~~ compares an object and a pattern to see if they match.

Re: How do I... create a new meta operator?

2005-05-19 Thread Luke Palmer
On 5/19/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: > Hi, > > quoting A12: > > infix_postfix_meta_operator:<=> $x += 2; > > postfix_prefix_meta_operator:{'»'} @array »++ > > prefix_postfix_meta_operator:{'«'} -« @magnitudes > > infix_circumfix_meta_operator:{'»','«

Re: reduce metaoperator on an empty list

2005-05-19 Thread Sam Vilain
Edward Cherlin wrote: Here is the last answer from Ken Iverson, who invented reduce in the 1950s, and died recently. file:///usr/share/j504/system/extras/help/dictionary/intro28.htm [snip] Thanks for bringing in a little history to the discussion. Those links are all local to your system; do yo

Re: Argument Type Checking

2005-05-19 Thread Luke Palmer
On 5/19/05, Joshua Gatcomb <[EMAIL PROTECTED]> wrote: > All: > I was hoping the following would give me an outright error > > sub foo (Int $bar) { > say $bar; > } > foo('hello'); Fortunately you are right. > I seem to recall, probably incorrectly, that one of the differences > with int, Int,

Re: reduce metaoperator on an empty list

2005-05-19 Thread Sam Vilain
Stuart Cook wrote: In Haskell, there is a distinction between foldl and foldl1 (similar remarks apply to foldr/foldr1[1]): The former (foldl) requires you to give an explicit 'left unit'[2], which is implicitly added to the left of the list being reduced. This means that folding an empty list will

Re: Complex Arithmetic

2005-05-19 Thread Sam Vilain
Edward Cherlin wrote: There was a discussion of the principal value of square root on this list some time back, making the point that for positive [...] It turns out that the domain and range and the location of the cut lines have to be worked out separately for different functions. Mathemat

Re: [S29] uniq

2005-05-19 Thread Damian Conway
Luke wrote: I wondered what uniq's default comparator should be, =:=? &infix:<~~> Woah there. ~~ is a good comparator and all, but it's not the right one here. ~~ compares an object and a pattern to see if they match. That makes it the right choice for when and grep. But we're trying to remov

Re: [S29] uniq

2005-05-19 Thread Sam Vilain
Mark Overmeer wrote: 'uniq' differs from 'sort' because there is no order relationship between the elements. A quick algorithm for finding the unique elements in perl5 is sub uniq(@) { my %h = map { ($_ => 1) } @elements; keys %h; } ...and an even quicker one is: use Set::Object;

Re: reduce metaoperator on an empty list

2005-05-19 Thread Andrew Rodland
On Thursday 19 May 2005 10:51 pm, Sam Vilain wrote: > Edward Cherlin wrote: > > Here is the last answer from Ken Iverson, who invented reduce in > > the 1950s, and died recently. > > file:///usr/share/j504/system/extras/help/dictionary/intro28.htm > >[snip] > > Thanks for bringing in a little h

Re: Parrot as an extension language

2005-05-19 Thread Colin Paul Adams
> "Leopold" == Leopold Toetsch <[EMAIL PROTECTED]> writes: Leopold> Yeah. I'm sorry to say that: you are just hitting a part Leopold> of Parrot labeled "under (re)construction" and the docs Leopold> aren't all up to date. >> So does that mean I'm limited to singlebyte string

Junctive and Higher order Types

2005-05-19 Thread Sam Vilain
Hi all, While trying to convert Haskell statements like this to Perl 6: data Cxt = CxtVoid -- ^ Context that isn't expecting any values | CxtItem !Type -- ^ Context expecting a value of the specified type | CxtSlurpy !Type -- ^ Context expecting multiple values of the

Re: r8118: MSWin32 Test Results

2005-05-19 Thread Leopold Toetsch
Ron Blaschke wrote: Ron Blaschke wrote: t\pmc\bigint.t1 256221 4.55% 22 The problem seems to be caused by the C in F. Well, not the actual cause, but that's where we fail. mpz_get_str() returned a string that was very likely allocated by a different "default allocation