Re: Junction Values

2005-02-18 Thread Damian Conway
Rod Adams wrote: All I want now is for autothreading to be explicit. It already *is*. The only way that: is_prime($x) can ever autothread is if $x holds a junction. But that can now only happen if there's an explicit C in scope where $x was assigned to (or the explicit use of some other m

Re: Junction Values

2005-02-18 Thread Brent 'Dax' Royal-Gordon
Rod Adams <[EMAIL PROTECTED]> wrote: > Suppose funky_test is a derivative of C< printf >. Only this printf let's > you feed it a junction for the format, and it will sort through them and see > which one matches best depending on actual number of parameters, parameter > types, etc. Ordinarily, thi

Re: Junction Values

2005-02-18 Thread Rod Adams
Brent 'Dax' Royal-Gordon wrote: Rod Adams <[EMAIL PROTECTED]> wrote: if $x == 3|4|5|6 {...} would thread over infix:<==> without any funkiness, since we'll assume operators are well written, and can take junctions as parameters, same as: if is_prime(3|4|5|6) {...} Would pass the j

Re: Junction Values

2005-02-18 Thread Rod Adams
Brent 'Dax' Royal-Gordon wrote: Rod Adams <[EMAIL PROTECTED]> wrote: Luke Palmer wrote: 2..sqrt($x) What the hell does that mean? Do you get a junction of lists out? Or does sqrt die because it's not expecting a junction? What on earth does C< for (2..sqrt(3|5)) {...} > mean in

Re: Junction Values

2005-02-18 Thread Brent 'Dax' Royal-Gordon
Rod Adams <[EMAIL PROTECTED]> wrote: > Luke Palmer wrote: > >2..sqrt($x) > > > >What the hell does that mean? Do you get a junction of lists out? Or > >does sqrt die because it's not expecting a junction? > > > What on earth does C< for (2..sqrt(3|5)) {...} > mean in the current > state of j

Re: Junction Values

2005-02-18 Thread Brent 'Dax' Royal-Gordon
Rod Adams <[EMAIL PROTECTED]> wrote: > if $x == 3|4|5|6 {...} > > would thread over infix:<==> without any funkiness, since we'll assume > operators are well written, and can take junctions as parameters, same as: > > if is_prime(3|4|5|6) {...} > > Would pass the junction to is_

Re: Junction Values

2005-02-18 Thread Rod Adams
Craig DeForest wrote: Hmmm... It seems that this way does lie madness -- there's a fundamental ambiguity between autothreading happening inside or outside the declared loop, and there's no "least surprising" way to implement it. Certainly inside the loop is the easiest and most natural to imple

Re: Junction Values

2005-02-18 Thread Craig DeForest
Hmmm... It seems that this way does lie madness -- there's a fundamental ambiguity between autothreading happening inside or outside the declared loop, and there's no "least surprising" way to implement it. Certainly inside the loop is the easiest and most natural to implement, but that acts s

Re: Junction Values

2005-02-18 Thread Rod Adams
Ashley Winters wrote: On Fri, 18 Feb 2005 12:47:51 -0700, Luke Palmer <[EMAIL PROTECTED]> wrote: Run through your mind how this would be done with a junction in $x. Particularly focus on: 2..sqrt($x) What the hell does that mean? Do you get a junction of lists out? Or does sqrt die because

Re: Junction Values

2005-02-18 Thread Ashley Winters
On Fri, 18 Feb 2005 14:35:53 -0800, Ashley Winters <[EMAIL PROTECTED]> wrote: > 1 .. sqrt(10) -> LazyList of (1..3) > 1 .. sqrt(10|20) -> Junction of any(1,2,3, 1,2,3,4) > > LazyList does Iterator, but Junction does not. You'd have to use (1 .. > sqrt(3|6)).values to iterate through the possible v

Re: Junction Values

2005-02-18 Thread Ashley Winters
On Fri, 18 Feb 2005 23:12:40 +0100, Eirik Berg Hanssen <[EMAIL PROTECTED]> wrote: > Ashley Winters <[EMAIL PROTECTED]> writes: > > > On Fri, 18 Feb 2005 12:47:51 -0700, Luke Palmer <[EMAIL PROTECTED]> wrote: > >> Run through your mind how this would be done with a junction in $x. > >> Particularly

Re: Junction Values

2005-02-18 Thread Rod Adams
Jonathan Scott Duff wrote: On Fri, Feb 18, 2005 at 12:42:31PM -0600, Rod Adams wrote: No, but nor does it have a concept quite like a variable. Which significantly weakens the "mapping naturally to human linguistic structures" argument, IMO. Why exactly? It's just the variable-na

Re: Junction Values

2005-02-18 Thread Eirik Berg Hanssen
Ashley Winters <[EMAIL PROTECTED]> writes: > On Fri, 18 Feb 2005 12:47:51 -0700, Luke Palmer <[EMAIL PROTECTED]> wrote: >> Run through your mind how this would be done with a junction in $x. >> Particularly focus on: >> >> 2..sqrt($x) >> >> What the hell does that mean? Do you get a junctio

Re: Junction Values

2005-02-18 Thread Ashley Winters
On Fri, 18 Feb 2005 12:47:51 -0700, Luke Palmer <[EMAIL PROTECTED]> wrote: > Run through your mind how this would be done with a junction in $x. > Particularly focus on: > > 2..sqrt($x) > > What the hell does that mean? Do you get a junction of lists out? Or > does sqrt die because it's not

Re: Junction Values

2005-02-18 Thread Rod Adams
Luke Palmer wrote: Rod Adams writes: Junctions are intended to be used mainly within conditionals and other statements; If the set of these "other statements" is limited, consider creating a Junction class (which needs a "use Junction;" to activate), which overloads the various comparison

Re: Junction Values

2005-02-18 Thread Jonathan Scott Duff
On Fri, Feb 18, 2005 at 12:42:31PM -0600, Rod Adams wrote: > > > >No, but nor does it have a concept quite like a variable. > > > Which significantly weakens the "mapping naturally to human linguistic > structures" argument, IMO. Why exactly? It's just the variable-nature of variables that isn'

Re: Fun with junctions (was Sets vs Junctions)

2005-02-18 Thread Damian Conway
Thomas Sandlaß wrote: class Source[Language ::To] is Str { multi sub *coerce:as (Any $data, To ::Lang) { return Lang.serialize($data) } } What is the return type of &*coerce:as? Sorry, I was too lazy (well, I'd claim I was thinking at a much higher level, but i

Re: TAP Version (was: RE: Test comments)

2005-02-18 Thread Geoffrey Young
> Hm, that does seem valuable. Should all test modules report their > versions by default, though? well, my thought was that it was more important to list the source of the comparison operators the user uses (like is() or eq_array()) than it was the internal stuff that, say, interfaces with Test

Re: Test::AnnounceVersion (was: TAP Version (was: RE: Test comments))

2005-02-18 Thread James E Keenan
Fergal Daly wrote: I was thinking of knocking together Test::AnnounceVersion. use Test::AnnounceVersion qw(A::List Of::Modules); which results in # using version 1.5 of A::List # using version 0.1 of Of::Modules supplying no import args would make it output $VERSION from every package it can find.

Re: Junction Values

2005-02-18 Thread Luke Palmer
Rod Adams writes: > >Junctions are intended to be used mainly within conditionals and other > >statements; > > > If the set of these "other statements" is limited, consider creating a > Junction class (which needs a "use Junction;" to activate), which > overloads the various comparison operators fo

Re: Junction Values

2005-02-18 Thread Rod Adams
Larry Wall wrote: The need for junctions first became evident when we found ourselves filling the ~~ tables with various sorts of weird non-symmetries. ~~ can easily be called the "DWIM compare" operator. It even looks like you're waving your hands, asking for some strange voodoo to happen. It

Re: Junction Values

2005-02-18 Thread Rod Adams
Brent 'Dax' Royal-Gordon wrote: Rod Adams <[EMAIL PROTECTED]> wrote: Larry Wall wrote: Junctions can short circuit when they feel like it, and might in some cases do a better job of picking the evaluation order than a human. I was afraid someone was going to say that. And I now must

Re: TAP Version (was: RE: Test comments)

2005-02-18 Thread Fergal Daly
I was thinking of knocking together Test::AnnounceVersion. use Test::AnnounceVersion qw(A::List Of::Modules); which results in # using version 1.5 of A::List # using version 0.1 of Of::Modules supplying no import args would make it output $VERSION from every package it can find. If you don't w

Re: TAP Version (was: RE: Test comments)

2005-02-18 Thread chromatic
On Fri, 2005-02-18 at 09:25 -0500, Geoffrey Young wrote: > yeah, I'll second this, at least so far as adding a version component to > Test::More goes (which is different than adding a TAP version, which I don't > have an opinion on:). Test.pm currently prints out > > # Using Test.pm version 1.

Re: Fun with junctions (was Sets vs Junctions)

2005-02-18 Thread Thomas Sandlaß
HaloO Damian, you wrote: Actually, I'd have thought that the type coercion mechanism might be a more appropriate way to go here. After all, the serialization of a data structure is merely a coercion to a subtype of Str. Specifically, I imagine a parameterized Source subtype: class Source[Langua

Tests for pugs

2005-02-18 Thread Autrijus Tang
Hi fellow Pugs committers (and would-be committers). This is a friendly message from your self-elected project leader. :) I'm very glad of your help in hacking pugs, particularly in filling out unit tests under t/. As it will likely require some coordination, I think perl6-compiler is the correc

Re: Junction Values

2005-02-18 Thread David Wheeler
On Feb 18, 2005, at 2:04 AM, Brent 'Dax' Royal-Gordon wrote: Junctions are equivalent to the English sentence "Get eggs, bacon, and toast from the store". (In Perl, that'd be something like C<< $store->get("eggs" & "bacon" & "toast") >>.) It's just a bit of orthogonality that allows you to give "

Re: Slurpy nullary vs nonslurpy nullary

2005-02-18 Thread Autrijus Tang
On Fri, Feb 18, 2005 at 08:26:26AM -0800, Larry Wall wrote: > Just as a BTW, that syntax is illegal currently, since those > curlies would be interpreted as hash subscripts. Noted. Which reminds me I need to implement hashes... :) > : It sort of makes sense to me. Please correct me if it's wron

Re: Slurpy nullary vs nonslurpy nullary

2005-02-18 Thread Larry Wall
On Fri, Feb 18, 2005 at 04:25:49PM +0800, Autrijus Tang wrote: : After getting Life and Mandel to run on Pugs yesterday (see : http://svn.perl.org/perl6/pugs/trunk/examples/ ), today I've : made this version of Quicksort to run: : : use v6; : : multi sub quicksort ( ) { () } : : mult

[perl #34178] [PATCH][MSWin32] Add gpm linkage and minor cleanup

2005-02-18 Thread via RT
# New Ticket Created by Ron Blaschke # Please include the string: [perl #34178] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/rt3/Ticket/Display.html?id=34178 > Attached patch - adds correct linkage for gpm Some tests fail, though t\pmc\bigint

Re: TAP Version (was: RE: Test comments)

2005-02-18 Thread Michael G Schwern
On Fri, Feb 18, 2005 at 01:41:17PM +, Mark Stosberg wrote: > > Err, why? Who else is emitting a version string? Or anything? Do we > > start prefixing everything else with TAP? > > I have intentionally put version strings in the output, especially of > of related modules. For example, DBD::

Re: TAP Version (was: RE: Test comments)

2005-02-18 Thread Geoffrey Young
> This is helpful for processing bug reports, so I don't have to make > second trip back to the user to ask: "What version of CGI.pm where you > using?". yeah, I'll second this, at least so far as adding a version component to Test::More goes (which is different than adding a TAP version, which

Re: TAP Version (was: RE: Test comments)

2005-02-18 Thread Mark Stosberg
On 2005-02-18, Michael G Schwern <[EMAIL PROTECTED]> wrote: > On Fri, Feb 18, 2005 at 01:13:05AM +, Mark Stosberg wrote: >> On 2005-02-15, Clayton, Nik <[EMAIL PROTECTED]> wrote: >> > >> >ver 1.1 >> >> If you go this route, I would make it clear whose emitting the version >> string: >> >>

Re: Junction Values

2005-02-18 Thread Brent 'Dax' Royal-Gordon
Rod Adams <[EMAIL PROTECTED]> wrote: > Larry Wall wrote: > >Junctions can short circuit when they feel like it, and might in some > >cases do a better job of picking the evaluation order than a human. > > > > > I was afraid someone was going to say that. And I now must convert my > reservations abo

Slurpy nullary vs nonslurpy nullary

2005-02-18 Thread Autrijus Tang
After getting Life and Mandel to run on Pugs yesterday (see http://svn.perl.org/perl6/pugs/trunk/examples/ ), today I've made this version of Quicksort to run: use v6; multi sub quicksort ( ) { () } multi sub quicksort ( *$x, [EMAIL PROTECTED] ) { my @pre = @xs.grep{ $_ < $x

Re: Unit tests from "Perl 6 Now"?

2005-02-18 Thread Autrijus Tang
On Thu, Feb 17, 2005 at 03:24:30AM -0800, Scott Walters wrote: > > Is it possible for me to include part of them into the Pugs distribution > > as unit tests under the t/ directory, under the Perl license? As Pugs's > > test harness has just been checked in, your code snippets should provide > > a