Re: backticks

2004-04-14 Thread Dave Whipp
"Jonathan Scott Duff" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Wed, Apr 14, 2004 at 10:31:23PM -0400, Joe Gottman wrote: > >And Perl 6 isn't? I use backticks quite a bit in Perl, and I don't see > > that changing if I upgrade to Perl 6. > > Me too, but I write my backti

Re: placeholder attachment?

2004-04-19 Thread Dave Whipp
"Trey Harris" <[EMAIL PROTECTED]> wrote i > It's easy to just say "don't nest placeholder-using closures," but that > doesn't seem workable in practice since every block is a closure, unless > placeholders are forbidden from all but the most trivial cases. Absurdly > trivial, it seems. How about

Re: A12: Typed undef

2004-04-23 Thread Dave Whipp
"Larry Wall" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Fri, Apr 23, 2004 at 02:50:42PM -0400, Austin Hastings wrote: > : Sure, but "You haven't provided a value yet." doesn't seem very ... > : exceptional. > > The important thing will be "You didn't provide a value at line 4

Re: MethodMaker techniques in Perl 6

2004-04-25 Thread Dave Whipp
"Abhijit A. Mahabal" <[EMAIL PROTECTED]> wrote: > Symbol tables and typeglobs and such belong to A10... and the * has been > stolen... so I'll just speculate in pseudocode. > Blocks-are-subroutines makes life easier, and in pseudocode that can be > just: > *{"Foo::name1"} = -> $a { $a->{name1} }

Re: MethodMaker techniques in Perl 6

2004-04-25 Thread Dave Whipp
Abhijit A. Mahabal wrote: *{"Foo::name1"} = -> $a { $a->{name1} }; If I read A12 correctly, this could be written as: &Foo::$name1 := -> $a {$a.name1}; Could be; that sounds somewhat right, but could you point out where in A12 because a search for := revelaed nothing relevant to me. Sorry, t

signature of a program

2004-05-12 Thread Dave Whipp
"Luke Palmer" <[EMAIL PROTECTED]> wrote > Well, the IO-objects are iterators, and you use <$iter> to iterate. It > makes sense that <> would iterate over $*ARGV by default. When I read this, I instinctively thought to myself: "why does this need to be global?". And that thought progressed to: "wh

Re: Event design sketch

2004-05-12 Thread Dave Whipp
"Dan Sugalski" <[EMAIL PROTECTED]> wrote: > The terminology there's a bit strained, and I think it's in large > part responsible for most of the rest of the confusion. > > They're probably better called Named and Anonymous events, though > that's a bit dodgy in some ways too. Maybe specific and gen

hyper-hyper operators?

2004-05-20 Thread Dave Whipp
Is it possible to "hyper" a hyper operator? For example, given: my @m = ( [1,2], [3,4], [5,6] ); my $a = @m + 1; my $b = @m +« 1; my $c = @m +«« 1; is it true that: ok($a == 4); ok($b »==« [ 3, 3, 3 ]; ok($c »»==«« [ [2,3], [4,5], [6,7] ]; Is there an "infinite depth" hyper oper

Re: FW: Periodic Table of the Operators

2004-05-30 Thread Dave Whipp
It probably depends on what nationality that keyboard is for. If its Japanese, you probably won't have a problem ;-). But for the rest of us, use Vi and Ye (or zip). Dave. "Gabriel Ebner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > Joe Gottman wrote: > >The zip o

Re: The behaviour of iterators

2004-06-15 Thread Dave Whipp
"Dan Sugalski" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >Why not take a page from C++ and call "previous" and "next" C and > >C, and then C to get what it points to. > > Because ++ and -- affect the value not the container. (There are days > when I think "C++ does it like..." i

Re: definitions of truth

2004-06-24 Thread Dave Whipp
"Larry Wall" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > This is Perl 6. Everything is an object, or at least pretends to be one. > Everything has a .boolean method that returns 0 or 1. All conditionals > call the .boolean method, at least in the abstract. My reading of A12 l

Re: The .bytes/.codepoints/.graphemes methods

2004-06-28 Thread Dave Whipp
"Jonadab The Unsightly One" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It would be possible to have right-associative operators (that bind at > least more tightly than comma and possibly very tightly) and convert a > number to one of these objects, so that we can do stuff like th

Re: push with lazy lists

2004-07-12 Thread Dave Whipp
"Ph. Marek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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 numb

Why do users need FileHandles?

2004-07-18 Thread Dave Whipp
I was thinking about the discussions about the "open" function, and of the capabilities of "string"s. Given that we'll have things like $str.bytes, etc. It doesn't seem a stretch to suggest that we could also have $str.lines. Once we have that, and also a level of pervasive laziness (lazy evaluati

Re: Why do users need FileHandles?

2004-07-18 Thread Dave Whipp
"Andrew Shitov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > DW> my $text is TextFile("/tmp/bar"); > DW> $text = "hello"; # writes, truncates > DW> $text ~= ", world\n"; # appends > > DW> $text.print "again\n"; # for old-times sake > > Anyhow we still need $text.flush() or

Re: Why do users need FileHandles?

2004-07-18 Thread Dave Whipp
"Rod Adams" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Uhm, my impression was that most of the "huffmanization" discussion was > centered around declaring a file handle to be read only, write only, > read-write, exclusive, etc. Masking the file handle with what basically > amount

Re: Why do users need FileHandles?

2004-07-19 Thread Dave Whipp
"Rod Adams" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Case 1: > So I wanted to do a read/write scan, so I create my TextFile, start > reading in data, so the file is opened for reading. Then, I come to the > part where I want to update something, so I do a write command. Suddenl

Re: String interpolation

2004-07-21 Thread Dave Whipp
"Brent 'Dax' Royal-Gordon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Amen. Please don't steal unnecessary metacharacters in qq() > strings--although I still think we should keep it, @ causes a lot of > problems. I seem to recall an issue, last week, of whether adverbs can be a

Re: String interpolation

2004-07-21 Thread Dave Whipp
"Chromatic" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Shh, no one's let slip the idea of curried roles yet! I'm not even > certain A12 mentioned parametric roles, let alone first-class roles. And with parametric roles, perhaps we also get C roles? Dave.

Re: Why do users need FileHandles?

2004-07-22 Thread Dave Whipp
"David Storrs" <[EMAIL PROTECTED]> wrote (apparently may days ago): > Race condition: what if something deletes the file between the moment > that perl closes the file and the moment that it re-opens it? Is > there a cross-platform way to do an atomic reopen? I'm not sure if you need to close it

Re: Why do users need FileHandles?

2004-07-22 Thread Dave Whipp
"David Storrs" <[EMAIL PROTECTED]> wrote ># Print file, inefficiently > print $default.readline for 1..$default.lines; print it efficiently: print $default; > # Append a line > $rw .= "an additional line\n"; $rw ~= "\n" unless $rw.chars[-1] eq "\n"; $rw ~= "an additional l

Re: [perl #31138] [TODO] Configure - dependencies fix

2004-08-18 Thread Dave Whipp
"Leopold Toetsch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Rather not. Python is AFAIK not as portable as Perl. But there is a Perl > based make somewhere, the named just escaped my mind. We use Makepp (http://makepp.sourceforge.net/) here. Written in Perl, its particular stre

Re: Synopsis 4 draft 1 -- const block params and placeholders

2004-08-20 Thread Dave Whipp
> Parameters are by default constant within the block. You can > declare a parameter read/write by including the "C" trait. > If you rely on C<$_> as the implicit parameter to a block, then > then C<$_> is considered read/write by default. That is, > the construct: > > for @foo {...} > > is a

Re: Instantiation

2004-08-23 Thread Dave Whipp
"Sean O'Rourke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > my $x = (use Some::Module::That::Defines::A::Class).new("blah"); how about some variation on my $x = Some::Module::That::Defines::A::Class.AUTOLOAD.new("blah"); Dave.

Re: Return with no expression

2004-08-24 Thread Dave Whipp
"Brent 'Dax' Royal-Gordon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Aaron Sherman <[EMAIL PROTECTED]> wrote: > > I've always thought that particular bit of sugar was rather dangerous. > > I'd even prefer a longhand: > > > > $foo either 0 or split(); > > The overloading of

S5: grammar compositions

2004-09-15 Thread Dave Whipp
I was rereading S5, and the example of grammatical inheritance caught my eye: grammar Letter { rule greet :w { [Hi|Hey|Yo] $to:=(\S+?) , $$} ... } grammar FormalLetter is Letter { rule greet :w { Dear $to:=(\S+?) , $$} ... } My first reaction was that we need a bit more factoring

Re: Trig functions for vtables

2003-09-23 Thread Dave Whipp
"Brent Dax" <[EMAIL PROTECTED]> wrote: > # > The result would mean that something like: > # > pmc->vtable->add > # > # > Might become: > # > pmc->vtable->math->add > # > # Seems too expensive to me for the normal math stuff. > > Perhaps, although one dereference doesn't seem to painful to me. Is t

Re: Pondering parameterized operators

2003-09-26 Thread Dave Whipp
"Austin Hastings" <[EMAIL PROTECTED]> wrote > if ("Dough" eqn(4) "Douglas") ... I wonder if the . operator is available here: if "Dough" eq.n(4) "Douglas" { ... } that makes it intuitive how to define new equality "methods". One thing of concern is that we'd need whitespace rules to disambig

Re: Unifying call and return

2003-11-10 Thread Dave Whipp
"Dan Sugalski" <[EMAIL PROTECTED]> wrote > Right now, the only true difference between a sub call and a return, at > least at the assembly level, is that we don't pass back a return > continuation when we're returning If one is coding a co-routine/iterator, then perhaps even this difference might

Anonymous Multi's? [was Re: Control flow variables]

2003-11-20 Thread Dave Whipp
"Larry Wall" <[EMAIL PROTECTED]> wrote: > Also, since multi is orthogonal to naming ... So I'm wondering what the correct syntax is to grab a reference to a group of multi-somethings. Example: multi sub foo(Int $a:) {...}; multi sub foo(String $a:) {...}; my $ref = multi &foo; $ref("hello"); #

Re: Start of thread proposal

2004-01-20 Thread Dave Whipp
"Dan Sugalski" <[EMAIL PROTECTED]> wrote: > =head2 Guarantees Maybe this isn't strictly a threading thing, but are we going to make any guarantees about event orderings? For example, will we guarantee that a sequence of events send from one thread to another will always be received in the order th

Re: Semantics of vector operations

2004-01-23 Thread Dave Whipp
When I see these long squiggles of line noise, I can't help thinking that English might be a better alternative. Using Larry's terminology from a few posts ago, we might think of: @a \C[leach] + \C[reach] @b Not mnemonic in a visual sense, but extendable to all sorts of trigraph contexts. Indee

Re: Semantics of vector operations

2004-01-23 Thread Dave Whipp
"Larry Wall" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > That is, suppose you have: > > macro leach () { return "»" } > macro reach () { return "«" } > > You could unambiguosly write > > leach+reach > > but (assuming spaces not allowed within distributed operators) you

Re: The Sort Problem

2004-02-12 Thread Dave Whipp
Perhaps something like: @sorted = sort { infix:<=> map { scalar $_.foo('bar').compute } @^_ } } @data I'm not entirely sure it's readability is better than yours, though. Dave. "Luke Palmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've been thinking about this problem whi

Re: The Sort Problem: a definitive ruling

2004-02-19 Thread Dave Whipp
"Damian Conway" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > type KeyExtractor ::= Code(Any) returns Any; > # Modtimewise numerically ascending... > @sorted = sort {-M} @unsorted; One thing I've been trying to figure out reading this: what is the signature of pref

Re: Dates and Times

2004-03-03 Thread Dave Whipp
"Dan Sugalski" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Reasonable enough, though there's something to be said for a > completely meaningless (to most people) epoch so folks stop treating > the number as a number with meaning and instead treat it as a black > box thing they can

Re: Mutating methods

2004-03-12 Thread Dave Whipp
"Larry Wall" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Unfortunately we can't just use topicalization to say > > my Cat $tom = .new() > > because most people won't expect simple assignment to break their > current topic. > > So another option is to replace = with somethin

Re: explicit line termination with ";": why?

2007-05-15 Thread Dave Whipp
Jonathan Lang wrote: Close. I'm thinking "added functionality for semicolon alternatives" rather than the "replace the semicolon" stunt that Semi::Semicolons pulls. In particular, as long as there's no ambiguity between prefix: and postfix:, I think that it would be quite useful for postfix: t

Re: = at Start of Line ... solution is simple

2007-06-16 Thread Dave Whipp
Darren Duncan wrote: Given this, there is an obvious (to me) solution for pod blocks in the middle of expressions like: my $foo = $bar; As the example shows, and I believe best practices espouse, you *indent* the code line with a leading =. I'd agree that indentation is good for reada

Re: t/codingstd/perlcritic.t needs to be optional

2007-06-28 Thread Dave Whipp
Andy Lester wrote: Modified since when? It'd have to be against the last update from svn of the file itself. I'm not sure I like the idea of relying on a given VCS. I know Parrot's hosted in Subversion, but what about the Git folks? Perhaps a better approach is to squirrel away an MD5 of

Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Dave Whipp
Steffen Schwigon wrote: Do you think it's possible to extract and collect all the operators and descriptions from the synopses into one common place? The problem with that is that it wouldn't scale to user-defined operators/macros. I think the way to approach it would be to define a POD6 dial

Re: Project Idea: Perl 6 Syntax Explainer

2007-07-10 Thread Dave Whipp
Moritz Lenz wrote: You're probably right about that, but somebody who writes his own macros and operators probably doesn't need such a tool anyway. And should write very good documentation, otherwise he has lost outright. (I was thinking that your tool would provide a mechanism for them to pro

Re: xml and perl 6

2007-11-29 Thread Dave Whipp
cdumont wrote: > By listening to you all, we shouldn't even think to implement file access... I think I'd argue that most file-access features should indeed be considered "non-core". This doesn't mean that we shouldn't think to implement them -- or that they wouldn't be part of almost every Perl-

Re: xml and perl 6

2007-11-29 Thread Dave Whipp
cdumont wrote: > By listening to you all, we shouldn't even think to implement file access... I think I'd argue that most file-access features should indeed be considered "non-core". This doesn't mean that we shouldn't think to implement them -- or that they wouldn't be part of almost every Perl-

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

2007-12-21 Thread Dave Whipp
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...

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

2007-12-21 Thread Dave Whipp
Chas. Owens wrote: 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 w

how much detail can I get from caller.want?

2008-08-29 Thread Dave Whipp
Lets say I want to find the 5th smallest element in an array. I might write: @array.sort.[4]; How does the implementation of the sort function know that I just want to 5th item (and thus choose an appropriate optimization)? Obviously the function could be told that it's caller wants 5 values

perldoc doesn't use $(PERLDOC) in docs/Makefile

2008-09-25 Thread Dave Whipp
I was attempting to build parrot (0.7.1 release), but got a failure in the docs directory because "perldoc" was not in my path. Looking at the Makefile I see that it sets "PERLDOC := /perldoc", but uses "perldoc" in a rule. I think this is due to: parrot-0.7.1/config/gen/makefiles/docs.in:37

Re: S16: chown, chmod

2008-11-21 Thread Dave Whipp
The restriction of chown to the superuser is a property of the OS, not the files. The example from the pod is: use POSIX qw(sysconf _PC_CHOWN_RESTRICTED); my $can_chown_giveaway = not sysconf(_PC_CHOWN_RESTRICTED); Thinking about it, perhaps that means that it's a method on $*OS. The use of fil

Re: S16: chown, chmod

2008-11-21 Thread Dave Whipp
Larry Wall wrote: On Fri, Nov 21, 2008 at 11:46:48AM -0800, dpuu wrote: : before I attempt to change the POD, would this wording be appropriate? It's a good first whack, though we might want to think about making it a little less P5ish/Unixish in changing a list of files, and rely instead of one

Re: S16: chown, chmod

2008-11-25 Thread Dave Whipp
Brandon S. Allbery KF8NH wrote: Still misunderstanding, I think. Yes, it will fail anyway, but in the general case you're checking to see if as a privileged process it is safe to operate on a given file. I'd actually been thinking that one would use the check in the opposite direction: if

Re: how to write literals of some Perl 6 types?

2008-12-06 Thread Dave Whipp
Carl Mäsak wrote: Paul (>): I can't find anything in the existing synopses about Blobs. Probably looking in the wrong place, sorry. Re-reading that, a slightly tangent (though still on topic, I hope) thought come to mind. The definition of the M

Re: Working with files wish list

2008-12-15 Thread Dave Whipp
Leon Timmermans wrote: On Mon, Dec 15, 2008 at 5:43 PM, Richard Hainsworth wrote: a) I am fed up with writing something like open(FP, ">${fname}_out.txt") or die "Cant open ${fname}_out.txt for writing\n"; The complex definition of the filename is only to show that it has to be restated ident

[perl #61692] deep equality and junctions

2008-12-26 Thread Dave Whipp
# New Ticket Created by "Dave Whipp" # Please include the string: [perl #61692] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61692 > It's seems that Rakudo's notion of equality under the "

[perl #61894] lexicals not hoisted into classes

2009-01-01 Thread Dave Whipp
# New Ticket Created by "Dave Whipp" # Please include the string: [perl #61894] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61894 > example: pugs: my $global = 1; class A { method foo { say "foo = $

[perl #61898] defined-or-assign operator not implemented

2009-01-01 Thread Dave Whipp
# New Ticket Created by "Dave Whipp" # Please include the string: [perl #61898] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61898 > rakudo: my $a; $a //= 1 rakudo 34768: OUTPUT«get_iter() no

[perl #61892] list-comprehension assignments with declaration

2009-01-01 Thread Dave Whipp
# New Ticket Created by "Dave Whipp" # Please include the string: [perl #61892] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61892 > (rakudo 34751) I've been trying to figure out how to do a &

[perl #61916] initialization parameters from base classes

2009-01-02 Thread Dave Whipp
# New Ticket Created by "Dave Whipp" # Please include the string: [perl #61916] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61916 > The default "new" method allows values of attributes to be s

[perl #61918] classes don't get a default .perl method

2009-01-02 Thread Dave Whipp
# New Ticket Created by "Dave Whipp" # Please include the string: [perl #61918] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61918 > rakudo: class A { has $.foo }; my A $a .=new( foo => 42

Re: reporting bugs

2009-01-05 Thread Dave Whipp
Patrick R. Michaud wrote: On Sun, Jan 04, 2009 at 05:20:56PM +0300, Richard Hainsworth wrote: I posted an email to per6-all asking about how one should go about reporting bugs. That message has appeared on the list. So again: how can bugs be reported? See the "Reporting bugs" section of REA

rfc: The values of a junction

2009-01-05 Thread Dave Whipp
I spent a fair amount of time with Rakudo over the holiday break (see http://dave.whipp.name/sw/perl6 for the writeup). I was generally impressed with both the language and its implementation. There were, unsurprisingly, a bunch of things missing. Some of these were things that are in the spec

Re: rfc: The values of a junction

2009-01-05 Thread Dave Whipp
That doesn't solve the general problem: my $junc = any -4 .. Inf; my @domain = -Inf .. 4; my @values = @domain |==| $junc; say @values.perl >>> [ -4 .. 4 ] How do you code that using "grep"? From: Daniel Ruoso To: Dav

Re: rfc: The values of a junction

2009-01-05 Thread Dave Whipp
Daniel Ruoso wrote: my $concrete_value = max $junc_value.grep: { $^score < 21 }; In the general case, both the junction and the domain may be infinite: my @domain = -Inf .. 3; my $junc = any -4 .. Inf; my @values = @domain |==| $junc; say @values.perl "[-4..3]" Handling all the variation

[perl #61988] "$.foo" doesn't accept args

2009-01-05 Thread Dave Whipp
# New Ticket Created by "Dave Whipp" # Please include the string: [perl #61988] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61988 > rakudo: class A { method foo { say @_ }; method bar { $.foo(4

[perl #62028] "say" with no args should be an error

2009-01-06 Thread Dave Whipp
# New Ticket Created by "Dave Whipp" # Please include the string: [perl #62028] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62028 > S16 requires that "say" (and "print") when called with

Re: returning one or several values from a routine

2009-01-06 Thread Dave Whipp
Daniel Ruoso wrote: Hmm... I think that takes the discussion to another level, and the question is: "what does a capture returns when coerced to a context it doesn't provide a value for?" I'd like to take one step further, and ask what it is that introduced capture semantics in the first pl

Re: returning one or several values from a routine

2009-01-07 Thread Dave Whipp
Jon Lang wrote: I believe that we already have a signature creation operator, namely ":( @paramlist )". Yes, sorry, I missed that. > ... Regardless, the magic that makes this work would be the ability to assign a flat list of values to a signature. Is this wise? We already have the abilit

Re: [PATCH] Add .trim method

2009-01-12 Thread Dave Whipp
Ovid wrote: $string.trim(:leading<0>); $string.trim(:trailing<0>); Setting leading or trailing to false (they default to true) would result in either leading or trailing whitespace not being trimmed Alternatively, those could be ltrim() and rtrim(). If you need to dynamically de

Re: design of the Prelude (was Re: Rakudo leaving the Parrot nest)

2009-01-20 Thread Dave Whipp
Darren Duncan wrote: 1. What we *should* be doing with the Prelude, like with STD.pm, is write under the assumption that the implementation is also written in Perl 6. We should write the Prelude in as declarative a manner as possible, saying *what* we want to happen rather than how, such as

Re: design of the Prelude (was Re: Rakudo leaving the Parrot nest)

2009-01-22 Thread Dave Whipp
Darren Duncan wrote: Dave Whipp wrote: sub sqrt(Num where { 0 <= $_ <= Real::Max } $x) { (0..$x/2 :by(Real::Epsilon)).min: { abs $x - $^candidate ** 2 } } So do you really mean "as declarative a manner as possible"? Or would you consider this example to go beyond "

Re: RFD: Built-in testing

2009-01-22 Thread Dave Whipp
Moritz Lenz wrote: A few months ago Larry proposed to add some testing facilites to the language itself, because we want to culturally encourage testing, and because the test suite defines the language, so we need to specify the behaviour of our testing facilities anyway. If we're going to reva

Re: RFD: Built-in testing

2009-01-22 Thread Dave Whipp
Moritz Lenz wrote: $x == 1e5 :ok('the :ok makes this is a test'); I can't help feeling that there's an end-weight problem here: The fact that it is a test is the essence of statement. If we're thinking of it as a library, then the MMD way of thinking might be appropriate: we know it'

Re: design of the Prelude (was Re: Rakudo leaving the Parrot nest)

2009-01-23 Thread Dave Whipp
Darren Duncan wrote: I don't quite follow you. Are you saying your version of sqrt is an implicit declaration; maybe I don't understand how that differs from an explicit definition in this case? In any event, right at this moment I can't think of an answer to your question. Go ahead with wh

Re: RFD: Built-in testing

2009-01-23 Thread Dave Whipp
Timothy S. Nelson wrote: method foo() does assume { ... } method bar() does ensure { ... } Is "ensure" equivalent to the "assert" that you describe above? Yes. "does ensure" was meant to be an englishification of "postcondition"; and "does assume" is "precondition". From the perspec

Re: RFD: Built-in testing

2009-01-23 Thread Dave Whipp
Larry Wall wrote: On Fri, Jan 23, 2009 at 08:01:14AM -0800, Dave Whipp wrote: For example, I could conceive of a trait: ok foo, :broken which might downgrade the error to a warning on rakudo, but not on other implementations. On the surface that seems like a good idea, and pugs started

Re: RFD: Built-in testing

2009-01-23 Thread Dave Whipp
Larry Wall wrote: module MyTests { sub group1 { ok foo :name; ## Q - would a label be better? } } >> ## Elsewhere >> MyTests.group1.test_foo is also broken; I guess I don't see offhand what you're trying to do with that. ... We must keep a clean separation between code t

Re: RFD: Built-in testing

2009-01-23 Thread Dave Whipp
jerry gay wrote: i don't understand the drive to have unique test identifiers. we don't have unique identifiers for every code statement, or every bit of documentation. why are tests so important/special/different that each warrants a unique id? that aside, this functionality sounds like it can

[perl #62742] man, max should accept code block that defines ordering

2009-01-25 Thread Dave Whipp
# New Ticket Created by "Dave Whipp" # Please include the string: [perl #62742] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62742 > According to S29, the "min" and "max" methods should

Re: r25200 - docs/Perl6/Spec t/spec

2009-02-05 Thread Dave Whipp
Jon Lang wrote: Pattern to split on (used with -a). Substitutes an expression for the default split function, which is C<{split ' '}>. Accepts unicode strings (as long as Should the default pattern be ' ', or should it be something more like /\s+/? // ?

Re: The use of roles in S16 (Was: Re: r25328 - docs/Perl6/Spec)

2009-02-17 Thread Dave Whipp
Daniel Ruoso wrote: Maybe I'm thinking sideways again, but I haven't thought of "open" as being a method of any IO object, because usually "open" is the thing that gets you an IO Object. I'd expect the plain "open" to be really a sub (maybe a "is export" method in the generic IO role), that doe

Re: Temporal revisited

2009-02-20 Thread Dave Whipp
I'm getting a bit lost following precisely what's being proposed. What I'm sort of feeling is that there are two fundamental immutable types needed: Instants and Durations: multi sub infix:<-> (Instant, Instant --> Duration) multi sub infix:<+> (Instant, Duration --> Instant) multi sub in

Re: Range and continuous intervals

2009-02-28 Thread Dave Whipp
Jon Lang wrote: Keys, OTOH, don't have any such requirement; so continuous keys may very well be doable. If they _are_ doable, you have to ask questions such as "how do I assign values to a continuous interval of keys?" To truly be robust, we ought also answer this question in terms of multidi

Statement modifiers as list comprehension operators

2009-03-02 Thread Dave Whipp
S04 mentions that statement modifiers behave as for perl5 (excpet that you can have both an conditional modifier and a looping modifier on a single statement. Both then it gives this example, with be modifiers being operators within an expression, not as modifiers of a statement. line 260:

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Dave Whipp
Larry Wall wrote: Note however that coercions require parens these days, since types parse as values, not as routine names. $x = Role::Serializable::XML($resultset); $y = Role::Serializable::YAML($resultset); Should "indirect object" syntax work in this context?: $a = Foo: $value;

Sequential bias in S04 (and Perl6 in general)

2008-01-02 Thread Dave Whipp
I was reading Synopsis 4 with regards to multi core programming. It seems to be infused with a bias towards non-parallel models of computation. Concurrently appears to be an add-on feature -- whereas we should have a mindset that explicit sequential constraints are the add-on feature. Two sta

Re: Sequential bias in S04 (and Perl6 in general)

2008-01-03 Thread Dave Whipp
Moritz Lenz wrote: You can achieve that with the "hyper" list-op (see S02). Also note that an optimizer is free to automatically add the "hyper" list op if it can prove that the executed block has no side effects. Yes, there are some places where things are better than others, which is why I

Re: Sequential bias in S04 (and Perl6 in general)

2008-01-04 Thread Dave Whipp
Luke Palmer wrote: forall was about concurrency, not order of evaluation. There is a difference between running in an arbitrary order serially and running in parallel. for %bag { .say; } If the bag had elements "hello", "world", I think printing: helworld lo Would defi

Re: Sequential bias in S04 (and Perl6 in general)

2008-01-04 Thread Dave Whipp
Mark J. Reed wrote: Am I the only one having bad flashbacks to Occam, here? (Transputing Will Change Everything!) My $0.02, FWIW: Concurrency is surprising. Humans don't think that way. And programs aren't written that way - any program represented as a byte stream is inherently sequential i

Re: Sequential bias in S04 (and Perl6 in general)

2008-01-04 Thread Dave Whipp
Larry Wall wrote: It's really, really easy to misdesign a computer language by overemphasizing one particular design dimension to the detriment of others. I agree that adding a parallel "forall" (and similar statements) via a pragma will be easy if the appropriate underlying machinery is ther

Re: Sequential bias in S04 (and Perl6 in general)

2008-01-04 Thread Dave Whipp
Larry Wall wrote: my hope is that we can delegate locking entirely to the innards of the implementation and never mention it at all on the language level. Hmm, sounds to me analogous to hoping that type inference will avoid the need to expose type-annotations at the language level (synchroniz

S02 interpolation of entire hashes

2008-01-07 Thread Dave Whipp
The tests in S02 L appear to assume that an interpolated hash renders its keys in a sorted order. But this property doesn't seem to be stated in the text. Is it true that the keys are always sorted for interpolation? (is it possible, in P6, for hash keys to not be comparable?)

Re: Sequential bias in S04 (and Perl6 in general)

2008-01-11 Thread Dave Whipp
Matthew Walton wrote: I wouldn't agree with that at all. I think of arrays as ordered constructs, so I'd want the default iteration over my array to happen in the order of the indices. I guess that depends on whether you think of the array as a list or as a ram. I know that a group at microso

Can assignment meta-operator be combined with feed operators?

2008-01-11 Thread Dave Whipp
S06 says that we need to say "eager" if (@in === @out). So: @data ==> eager map { $^x + 1 } ==> @data. Is it possible to modify a feed operator using the assignment meta-operator described in S02 and, if so, is the "eager" implict? @data ==>= map { $_ + 1 };

Re: Can assignment meta-operator be combined with feed operators?

2008-01-11 Thread Dave Whipp
Larry Wall wrote: As for assignment-op forms, in the current "STD" grammar, feeds are not currently even considered operators, but statement separators, so there is no possibility of using them in an assignment metaoperator (or any other metaoperator, for that matter). Feeds as a reduction cou

S12 delegation ("handles" trait)

2008-04-18 Thread Dave Whipp
I noted Jonathan Worthington's work implementing the "handles" trait for delegation through attributes, and was a bit surprised to see that it is defined (S12/delegation) to use strings instead of method signatures -- I had thought that perl6 was attempting to be symbolic in places where perl5

Re: given vs for

2008-04-25 Thread Dave Whipp
Mark J. Reed wrote: So eseentially, given (@foo) means the same as Perl5 for ([EMAIL PROTECTED]) Just wondering: should "given @foo {...}" alias to $_, or @_?

Re: given vs for

2008-04-25 Thread Dave Whipp
Smylers wrote: Dave Whipp writes: So eseentially, given (@foo) means the same as Perl5 for ([EMAIL PROTECTED]) Just wondering: should "given @foo {...}" alias to $_, or @_? I'd expect it to alias to C<$_>, on the grounds that everything always aliases to C<$

Re: given vs for

2008-04-25 Thread Dave Whipp
Mark J. Reed wrote: The topic should always be $_ unless explicitly requested differently via the arrow. Now in the case of for, it might be nice if @_ bound to the entire collection being iterated over (if any)... As a perl5-ism: sub foo { say @_; } ... given (@bar) { when ... { &foo }

Re: First look: Advanced Polymorphism whitepaper

2008-05-01 Thread Dave Whipp
Brandon S. Allbery KF8NH wrote: But there *is* some commonality there, to the extent that both are motion. This is the kind of thing that spawned this discussion, in fact: if what matters is motion, there is no reason *not* to substitute one for the other. { draw $gun }: makes a big differ

Re: assignable mutators (S06/Lvalue subroutines)

2008-05-27 Thread Dave Whipp
TSa wrote: TSa wrote: class Length { has Num $.mm is rw = 0; method inch { yield $inch = $.mm * 25.4; self.mm = $inch / 25.4; } } Would you regard that as elegant? That looks functionally incorrect to my eyes: if the caller resumes a

<    1   2   3   4   >