Re: [perl6/specs] 89cc32: Spec Bag.kxxv

2014-04-15 Thread David Green
On 2014-April-13, at 11:03 pm, Damian Conway wrote: >> Spec Bag.kxxv > It's a clever name...but maybe too clever? > I find it unfortunate that a method that only returns keys has a 'v'in its > name. > Up to now, we've had a more predictable pattern to naming these accessors. It could be called "

Not-so-smart matching (was Re: How to make a new operator.)

2012-03-24 Thread David Green
On 2012-March-21, at 6:38 pm, Daniel Carrera wrote: > The idea of smart-matching a function just doesn't quite fit with my brain. I > can memorize the fact that smart-matching 7 and &foo means evaluating foo(7) > and seeing if the value is true, but I can't say I "understand" it. Maybe it just n

Floating-point equality (was Re: How to make a new operator.)

2012-03-24 Thread David Green
On 2012-March-23, at 12:01 am, Damian Conway wrote: > [...] we ought to allow for the inevitable loss of significant digits within > the two preliminary division ops, and therefore compare the results with an > suitably larger epsilon. > That would not only be computational more justifiable, I su

Re: pattern alternation (was Re: How are ...)

2010-08-05 Thread David Green
On 2010-08-05, at 8:27 am, Aaron Sherman wrote: > On Thu, Aug 5, 2010 at 7:55 AM, Carl Mäsak wrote: >> >> I see this particular thinko a lot, though. Maybe some Perl 6 lint tool or >> another will detect when you have a regex containing ^ at its start, $ at >> the end, | somewhere in the middle

Re: How are unrecognized options to built-in pod block types treated?

2010-08-04 Thread David Green
On 2010-08-04, at 7:43 pm, Darren Duncan wrote: > A parallel solution would be that POD can declare a version, similarly to how > Perl code can declare a Perl version, whose spec it is expected to be > interpreted according to. I thought that was more or less how it worked anyway. You can make

Re: Smart match isn't on Bool

2010-08-03 Thread David Green
On 2010-08-02, at 2:35 pm, TSa (Thomas Sandlaß) wrote: > On Monday, 2. August 2010 20:02:40 Mark J. Reed wrote: >> [...] it's at least surprising. I'd expect (anything ~~ True) to be >> synonymous with ?(anything) > Note also that ($anything ~~ foo()) just throws away $anything. No; only if foo(

Re: series operator issues

2010-07-31 Thread David Green
On 2010-07-23, at 4:25 am, Moritz Lenz wrote: > I'm still not convinced. [that there should be a special index variable] > Yes, it would be convient, but I've yet to see a non-contrived example where > it's actually necessary, and which can't be implemented trivially with other > Perl 6 tools.

Unwanted warnings (was Re: Something wrong with str.reverse)

2010-07-31 Thread David Green
On 2010-06-18, at 10:48 am, Larry Wall wrote: > If you make it the default to not warn, then the people who really need the > warnings will almost never turn them on. If you make it default to warn, > then people will have to turn off the warnings forever. Doesn't the site-policy policy help he

Re: Smart match isn't on Bool

2010-07-31 Thread David Green
On 2010-07-31, at 2:00 pm, TSa (Thomas Sandlaß) wrote: > On Saturday, 31. July 2010 18:56:47 David Green wrote: >> given $who-knows-what { >> when True { say "It's a true thing!" } # ^--oops, this still shouldn't come first! >> when 42 { say

Re: Smart match isn't on Bool

2010-07-31 Thread David Green
On 2010-07-31, at 5:55 pm, Darren Duncan wrote: > I would prefer if given/when was nothing more than an alternate syntax for > if/then that does comparisons. And that breaks out of its enclosing scope. > On the other hand, Perl 6 has multiple equality comparison operators, eqv, > eq, ==, ===,

Re: Smart match isn't on Bool

2010-07-31 Thread David Green
On 2010-07-31, at 11:38 am, Brandon S Allbery KF8NH wrote: > Thank you; *that* is the real point I was trying to make. That, and that > special-casing one particular type is *not* actually helpful; it means I must > remember a special case, when one of the goals of Perl 6 was supposedly to > el

Re: Smart match isn't on Bool

2010-07-31 Thread David Green
On 2010-07-31, at 12:47 pm, Patrick R. Michaud wrote: > On Sat, Jul 31, 2010 at 10:56:47AM -0600, David Green wrote: >> given $something { >> when True { say "That's the truth!" } >> when 42 { say "Good answer!" } >> when "via

Re: Smart match isn't on Bool

2010-07-31 Thread David Green
> On 2010-07-30, at 4:57 pm, Aaron Sherman wrote: >> given False { when True { say "True" } when False { Say "False" } default { >> say "Dairy" } } >> I don't think it's unreasonable to expect the output to be "False". >> However, it actually outputs "True". Why? Well, because it's in the spec >>

Re: Command-line args (weekly contribution to P6)

2010-05-27 Thread David Green
On 2010-05-26, at 8:52 am, Larry Wall wrote: > On Wed, May 26, 2010 at 07:22:36AM -0700, jerry gay wrote: > : On Wed, May 26, 2010 at 00:53, Moritz Lenz wrote: > : > sub MAIN(:name(:$n)) > : > then $n has two names, 'name' and 'n', and we could consider all > one-letter > : > parameter names as s

eqv and comparing buts

2010-05-26 Thread David Green
On 2010-05-26, at 1:53 am, Moritz Lenz wrote: >> The tests might need fixing too, since I'm not sure whether eqv (as used by >> is_deeply) would cover that, or whether it would take a separate test in >> bool context. > > probably the latter. I guess it would have to -- that is, "but" creates a

Re: [perl #72972] [BUG] False ~~ True in Rakudo

2010-02-22 Thread David Green
On 2010-Feb-22, at 2:08 am, Moritz Lenz wrote: At least I'd find it more intuitive if smart-matching against Bool would coerce the the LHS to Bool and then do a comparison, much like smart-matching against strings and numbers work. The downside is that then: given $thing { when some_function

Re: But vs. With

2009-12-04 Thread David Green
On 2009-Dec-3, at 8:42 pm, Jon Lang wrote: "but" _can_ change existing behavior, but doesn't have to. So "with" becomes the safe version of run-time composition, guaranteeing that whatever you mix in won't disturb existing behavior, and "but" becomes the unsafe version that you can fall b

Re: But vs. With

2009-12-03 Thread David Green
Lots of things will have default stringifications, say, that may not always merit the contrary force of "but". Maybe "but" should be needed only when a method has already been mixed in anonymously. Oops, that would wreck the canonical example of "0 but true". Since the Bool(Int) method alr

But vs. With

2009-12-03 Thread David Green
I'm wondering whether we can make use of the contrary sense implied by the word "but", and have it apply specifically to cases where something is being overridden. In cases where there isn't something to override we could use a different word, such as "with". E.g. $x = Tue but "Today"

Re: new enumerations

2009-11-29 Thread David Green
On 2009-Nov-28, at 1:56 pm, pugs-comm...@feather.perl6.nl wrote: +Fri.name# 'Fri' Since enums are like hashes, why not .key instead of .name? (Also might be less confusing should you happen to have an enum where the keys are numbers and the values are names. (Of course, enum Key

Re: lvalue methods

2009-10-20 Thread David Green
On 2009-Oct-20, at 8:04 am, Jon Lang wrote: The above example is of course trivial. A more serious example might be one based off of a coordinate system: role point { has Num $x, Num $y; method angle() is rw( { $.x = .r * cos($_); $.y = .r * sin($_) } ) { return atn($.y/$.x

Re: unusual invocants

2009-10-20 Thread David Green
On 2009-Oct-20, at 7:55 am, Matthew Walton wrote: On Tue, Oct 20, 2009 at 2:32 PM, Mark J. Reed wrote: On Mon, Oct 19, 2009 at 11:47 PM, Jon Lang wrote: Because a method is part of a role, and ought to abide by the same terms by which the role abides. If Logging doesn't do Numeric, it shou

Re: unusual invocants

2009-10-19 Thread David Green
On 2009-Oct-19, at 5:50 pm, Jon Lang wrote: In "Aiasing methods in CPAN roles", David Green wrote: I don't want my special log() method to work only for other types that explicitly do NumLog; I want it to work for any type that directly "does Numeric does Logging".

Re: Aliasing methods in CPAN roles

2009-10-19 Thread David Green
On 2009-Oct-18, at 3:44 pm, Jon Lang wrote: David Green wrote: I would expect that role Logging { method log(Numeric $x:) {...} } means the invocant is really of type Numeric & Logging, without Logging having to do Numeric. On the other hand, I can see that strictly that might not

Re: Aliasing methods in CPAN roles

2009-10-18 Thread David Green
On 2009-Oct-17, at 1:55 am, Jon Lang wrote: This implies that both Logging and Math do Numeric, since the invocant ought to be of a type that the class does. I would expect that role Logging { method log(Numeric $x:) {...} } means the invocant is really of type Numeric & Logging, without

Re: Aliasing methods in CPAN roles

2009-10-16 Thread David Green
On 2009-Oct-16, at 12:54 am, Richard Hainsworth wrote: Is there syntactic sugar for aliasing the conflicting method? Eg. something like does XML :db-write; There needs to be something more than sugar: making a new class or role with different methods will break substitutability. However, w

Re: Freezing role methods

2009-10-14 Thread David Green
On 2009-Oct-14, at 2:00 pm, Jon Lang wrote: David Green wrote: On the other hand, $dogwood.Dog::bark cannot be simplified by leaving out the "Dog::" because then it would be ambiguous. On the gripping hand, if we have a function "train(Dog $d)", then we can safely as

Re: Freezing role methods

2009-10-14 Thread David Green
On 2009-Oct-14, at 8:52 am, Ovid wrote: --- On Wed, 14/10/09, Jon Lang wrote: The initial possibility that springs to mind would be to use longnames to disambiguate between the two options - specifically, by means of the invocant: ...or something to that effect. You'd still have a disambigu

Re: r28727 - docs/Perl6/Spec

2009-10-11 Thread David Green
On 2009-Oct-10, at 11:16 am, pugs-comm...@feather.perl6.nl wrote: +(However, statement control C notices this and passes no argument, +so C<$_> ends up being bound to the outer C<$_> anyway.) If "if" will specially handle this case, why not do likewise for @_ or %_ and avoid this problem:

Re: Overloading Roles

2009-10-07 Thread David Green
On 2009-Oct-5, at 3:41 pm, Jon Lang wrote: Concerning that last one: would it be reasonable to have a Discrete role that provides a .succ method, and then overload the Range role? I think a type needs to be Discrete and Ordered for successors to make sense (e.g. consider a discrete unordere

Re: Parsing data

2009-10-07 Thread David Green
On 2009-Oct-7, at 5:18 pm, Aaron Sherman wrote: This should be powerful enough to match any arbitrarily nested set of iterable objects. I think it will be particularly useful against parse trees (and similar structures such as XML/HTML DOMs) and scanner productions, though users will probably fin

Re: r28597 - docs/Perl6/Spec/S32-setting-library

2009-10-04 Thread David Green
On 2009-Oct-4, at 2:07 pm, Moritz Lenz wrote: Michael Zedeler wrote: It doesn't, because succ should always give the next, smallest possible element given some ordering relation. Where's that definition from? The dictionary. =) It would be confusing to have a "successor" method for som

Re: r28344 - docs/Perl6/Spec

2009-09-22 Thread David Green
On 2009-Sep-21, at 2:57 pm, pugs-comm...@feather.perl6.nl wrote: So the preceding example reduces to: +1, 2, 3 ... +10, 20, 30 ... +100, 200, 300 ... 1000 + +These rules may seem complicated, but they're essentially just replicating +what a human does naturally when you say "and so

Re: [perl #69194] rakudo 2009-08 and when with lists

2009-09-21 Thread David Green
On 2009-Sep-20, at 12:48 am, Larry Wall wrote: Yes, I think it's fair to say that either list context OR a :by turns a Range into a RangeIterator that matches like a list. Hence, this ought to match: (1,3,5) ~~ (1..5 :2by) OK; but I still have to ask why it returns a RangeIterator instead

Re: [perl #69194] rakudo 2009-08 and when with lists

2009-09-19 Thread David Green
On 2009-Sep-19, at 5:53 am, Solomon Foster wrote: On Sat, Sep 19, 2009 at 6:48 AM, Carl Mäsak wrote: David (>>>), It sounds like the split personality of Ranges strikes again. I still think it makes more sense to have one Series-only type and one Range- only type, rather than one Series ty

Re: [perl #69194] rakudo 2009-08 and when with lists

2009-09-19 Thread David Green
On 2009-Sep-18, at 8:44 am, Moritz Lenz wrote: Aaron Sherman wrote: 2,3 constructs a list. 2..3 also constructs a list, unless it's in a given/when condition in which case it's just a range. No. 2..3 is always a range. It's just list context that turns it into a list. That seems confusing.

Re: Synopsis 02: Range objects

2009-08-27 Thread David Green
On 2009-Aug-27, at 3:11 pm, Mark J. Reed wrote: Given how easy chained relational ops make explicit range checking with endpoints, e.g. $a <= $x <= $b I'd be perfectly happy with a Range smartmatching only the elements that you get out of the RangeIterator. Yes -- although sometimes that wo

Re: versioning same-auth forks/branches

2009-08-27 Thread David Green
On 2009-Aug-26, at 3:54 pm, Darren Duncan wrote: The question I have is what to do when a single same authority wants to release multiple forks or branches of the same module, each presumably targeting a different use case, and the version numbers for each fork/branch are not supposed to be

Re: Synopsis 02: Range objects

2009-08-25 Thread David Green
On 2009-Aug-24, at 4:17 pm, Daniel Ruoso wrote: Em Seg, 2009-08-24 às 23:50 +0200, Michael Zedeler escreveu: The most elegant solution would be if the data types themselves indicated their capabilities. One thing I think you missed entirely is the fact that the infix:<..> operator is a multi su

Re: Filename literals

2009-08-19 Thread David Green
On 2009-Aug-19, at 4:38 pm, Mark J. Reed wrote: I don't think $file1.name == $file2.name should talk to the FS, because I think File#name t+r whatever) should return a plain Str. I was thinking === rather than eq might be enough distinction, but you're right, confusion is too likely. Maybe $

Re: Custom object constructors

2009-08-19 Thread David Green
On 2009-Aug-19, at 4:37 pm, Kevan Benson wrote: I'm aware there's a default constructor that allows named parameters to be set, but I think the usefulness of allowing specific constructors that take defined parameters and initialize the object as needed should not be overlooked. E.g. my

Re: Filename literals

2009-08-19 Thread David Green
On 2009-Aug-18, at 7:20 am, Timothy S. Nelson wrote: On Tue, 18 Aug 2009, David Green wrote: Some ways in which different paths can be considered equivalent: Spelling: ... Simplification: ... Resolution: ... Content-wise: ... Ok, my next commit will have "canonpath" (stolen direct

Re: directories of interest, a multiplicity alternative to CWD

2009-08-19 Thread David Green
On 2009-Aug-19, at 2:08 am, Darren Duncan wrote: %DOI{'mycwd'} = %DOI{'fscwd'}; %DOI{'mycwd'} ~= 'subdir'; # later my $fh = IO.open( 'mycwd/myfile.txt' ); For ease of use, we can still have vars like $*CWD, which might be an alias for a doi with a specific name. I've been thinking of som

Re: [perl #64566] @a[1..*] adds trailing undef value

2009-08-19 Thread David Green
On 2009-Aug-19, at 8:07 am, Jon Lang wrote: On Wed, Aug 19, 2009 at 5:37 AM, Jan Ingvoldstad wrote: On Wed, Aug 19, 2009 at 1:54 PM, Moritz Lenz via RT > wrote: It doesn't mention how the postcifcumfix:<[ ]> is supposed to introspect those to find out if the WhateverCode object constructed by

Re: Last IO discussion

2009-08-19 Thread David Green
On 2009-Aug-19, at 5:00 am, Troels Liebe Bentsen wrote: My idea of working with file names would be that we default to locale or filesystem settings, but give the options of working with paths/file names as binary or a specific encoding. As mentioned in the old thread, encoding is only vagu

Re: r90210 - in docs/Perl666/Spec: . S0S-upsetting-library

2009-08-18 Thread David Green
On 2009-Aug-18, at 7:05 am, Mark J. Reed wrote: On Tue, Aug 18, 2009 at 6:59 AM, Carlin Bingham> wrote: 2009/8/18 Timothy S. Nelson : On Tue, 18 Aug 2009, Mark J. Reed wrote: It's not in the revised spec, but I think that, even though we've revived chdir, we should still have it so tha

Re: S26 - The Next Generation

2009-08-18 Thread David Green
On 2009-Aug-18, at 3:29 am, Jan Ingvoldstad wrote: In general, executable documentation is a bad thing. It's been shown to be a bad thing many times over. Well, tons of programs have --help options, which could be considered executable documentation, and it's very useful. Emacs brags about

Re: $*CWD and chdir()

2009-08-18 Thread David Green
On 2009-Aug-18, at 5:48 am, Jan Ingvoldstad wrote: On Tue, Aug 18, 2009 at 1:02 PM, David Green wrote: It doesn't seem that surprising to me, especially after seeing the docs the first time. Are there environments where you can set a variable like $*CWD and it doesn't do some

Default path restrictions

2009-08-18 Thread David Green
On 2009-Aug-18, at 1:24 am, pugs-comm...@feather.perl6.nl wrote: +=head3 Default constraints + +The default p{} only allows "/" as separator and does not allow path elements to contain +characters that won't work on modern Windows and Unix like \ / ? % * : | " > <, +etc. The reason for this

Re: $*CWD and chdir()

2009-08-18 Thread David Green
On 2009-Aug-18, at 4:59 am, Carlin Bingham wrote: 2009/8/18 Timothy S. Nelson : It's not in the revised spec, but I think that, even though we've revived chdir, we should still have it so that changing $*CWD will do a chdir under the hood. While in the spirit of TIMTOWTDI, having a "

Re: Filename literals

2009-08-18 Thread David Green
On 2009-Aug-17, at 8:36 am, Jon Lang wrote: Timothy S. Nelson wrote: Well, my main thought in this context is that the stuff that can be done to the inside of a file can also be done to other streams -- TCP sockets for example (I know, there are differences, but the two are a lot the

$*CWD and chdir()

2009-08-18 Thread David Green
On 2009-Aug-18, at 3:27 am, Timothy S. Nelson wrote: On Tue, 18 Aug 2009, David Green wrote: Maybe setting $*CWD just calls chdir() under the hood? Same implementation, brand new shiny Perl-style interface! That was my intent, but we had some discussions on IRC about the whys and

Re: r28017 - in docs/Perl6/Spec: . S32-setting-library

2009-08-18 Thread David Green
On 2009-Aug-18, at 2:29 am, Carlin Bingham wrote: chdir provides functionality that would be quite convoluted to mimic through manually setting $*CWD, such as changing to a relative directory. Maybe setting $*CWD just calls chdir() under the hood? Same implementation, brand new shiny Perl-st

Re: S26 - The Next Generation

2009-08-17 Thread David Green
On 2009-Aug-17, at 12:27 pm, Moritz Lenz wrote: However it seems we have to pay a price: each act of rendering a Pod file actually means executing the program that's being documented (at least the BEGIN blocks and other stuff that happens at compile time), with all the security risks implied. So

Re: S26 - The Next Generation

2009-08-16 Thread David Green
On 2009-Aug-16, at 2:26 pm, Damian Conway wrote: It's Sunday evening and, as promised, here's the new draft of S26. Yay! (To the contents, that is, not to the posting of it. Well, to the posting too, since otherwise it would have been much harder to read.) Perl that accesses $=POD and/

Re: Filename literals

2009-08-16 Thread David Green
On 2009-Aug-15, at 9:22 am, Jon Lang wrote: IOW, your "outside the file" stuff is whatever can be done without having to open the file, and your "inside the file" is whatever only makes sense once the file has been opened. Correct? If so, could you give some examples of how such a distinction c

Re: Filename literals

2009-08-14 Thread David Green
ithout re-encoding them the "P6 way". Maybe it's more practical to permit only URIs with little to no punctuation to be unquoted, and quote anything else? Not that quoting is such a great hardship anyway On 2009-Aug-14, at 7:41 am, Timothy S. Nelson wrote: And in res

Files and IO and all

2009-08-14 Thread David Green
On 2009-Aug-14, at 4:34 am, David Green wrote: There's a lot of scope for a nice, friendly, high-level IO view; perhaps we need an IO-working group to assemble knowledge about what is and isn't possible with different filesystems and design an interface around it all. I

Re: Filename literals

2009-08-14 Thread David Green
On 2009-Aug-13, at 10:25 am, Hinrik Örn Sigurðsson wrote: I've read a couple of posts about file test operators, where some have suggested making filenames special, either as a subtype of Str or something else entirely. That way Str wouldn't have all these file test methods, which is good because

Re: Embedded comments: two proposed solutions to the comment-whole-lines problem

2009-08-13 Thread David Green
On 2009-Aug-11, at 1:38 pm, raiph mellor wrote: For a quick backgrounder, Larry had talked of reserving backtick for use as a user defined operator [1], Mark had suggested its use as a (tightly bound) comment [2], and James et al had suggested using it to declare units [3]. I'd like to see unit

Re: Rukudo-Star => Rakudo-lite?

2009-08-09 Thread David Green
On 2009-Aug-9, at 6:30 am, Richard Hainsworth wrote: Its just that */star/whatever doesnt convey [to me] the fact that its a sub-set of of Perl6. I like "*"... it has more personality than "lite". (Or even "light".) Though since it's a subset, we could always call it "Rakudo ⊂"! On 2009-

Re: RFC: overriding methods declared by roles (Was: Re: Reusing code: "Everything but the kitchen sink")

2009-07-12 Thread David Green
On 2009-Jul-12, at 12:43 pm, Daniel Ruoso wrote: role R1 { method foo() {...} # degenerates to interface } Just wondering: since merely declaring an interface will be common enough, should we be able to say simply "method foo;" inside a role, and drop the {...}? class Bla does R2 { m

Re: Reusing code: "Everything but the kitchen sink"

2009-07-12 Thread David Green
On 2009-Jul-10, at 4:37 pm, Jon Lang wrote: This is one of the distinctions between role composition and class inheritance. With class inheritance, the full tree of inherited classes is publicly accessible; with role composition, the methods of the combined role are the only ones that are m

Re: YAPC::EU and Perl 6 Roles

2009-07-10 Thread David Green
On 2009-Jul-8, at 1:49 pm, Ovid wrote: That being said, roles also have two competing uses (though they don't conflict as badly). As units of behavior, they provide the functionality your code needs. However, they can also serve as an interface. Maybe there are Interfaces, which are, we

Huffman's Log: svndate r27485

2009-07-10 Thread David Green
On 2009-Jul-8, at 3:41 pm, pugs-comm...@feather.perl6.nl wrote: =item log + our Num multi method log ( Num $x: Num $base = Num::e ) is export Logarithm of base C<$base>, default Natural. Calling with C<$x == 0> is an error. It occurs to me that "log" is a pretty short name for a function I

Re: Reusing code: "Everything but the kitchen sink"

2009-07-10 Thread David Green
On 2009-Jul-7, at 5:28 am, Jonathan Worthington wrote: The spec is right in that you need to write a method in the class that decides what to do. This will look something like: method fuse() { self.Bomb::fuse() } That makes sense for using the combined role on its own, but can we still

Re: renaming or adding some operators

2009-05-30 Thread David Green
On 2009-May-29, at 7:53 pm, Darren Duncan wrote: Thirdly, there are I'm sure a number of other aliases that could be added to other ops, such as ≤ and ≥ for <= and >=, and ≠ for one of the inequality operators, although that last one would probably make more sense if = was the equality test

Re: New CPAN

2009-05-30 Thread David Green
On 2009-May-30, at 12:06 pm, David Green wrote: ...what "Perl6" is today, let alone what it will be tomorrow. Actually, we do kind of know what Perl will look like a decade from now, because P6 is deliberately extensible enough that we may never need a Perl 7. But that simply

Re: New CPAN

2009-05-30 Thread David Green
On 2009-May-30, at 6:56 am, Andrew Whitworth wrote: I'm not saying we *can't* create a general repository for all sorts of nonsense, I'm saying that we *shouldn't*. "Holiday photos" is just a whimsical example. The problem is that it's hard enough keeping up with what "Perl6" is today, let a

Re: deciphering infix:

2009-03-27 Thread David Green
On 2009-Mar-26, at 10:50 pm, Patrick R. Michaud wrote: But what to do with something like C< 3 cmp '3' >, or any infix: where the operands are of differing types? Do we constrain C to only work on similarly-typed operands (in which case my sort above would fail), or am I overlooking somethi

Re: a junction or not

2009-03-17 Thread David Green
On 2009-Mar-17, at 2:16 am, Jon Lang wrote: $choice.perl will return the same thing that the following would: any($choice.eigenstates.«perl) That is, it would return a Junction of Str, not a Str. So the question is how to get something that returns an expression to the effect of: 'any('

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-10 Thread David Green
On 2009-Mar-9, at 3:32 am, Ovid wrote: Since you cache resultsets if they've not changed, you could easily have the XML and YAML roles getting reapplied at runtime multiple times. Could this issue be mitigated with temp variables? { temp $resultset does Role::Serializable::YAML; pr

Re: Masak's S29 list

2009-02-26 Thread David Green
On 2009-Feb-26, at 7:46 pm, Timothy S. Nelson wrote: # Object has .print and .say. [...] My question is, would we be better off having the string conversion routine for arrays worry about the input/output record/field separators, rather than the IO object? The downside I can see is that

Re: min= (from "Rakudo Built-ins Can Now Be Written In Perl 6")

2009-02-24 Thread David Green
Feb 24, 2009 at 11:16 AM, Ruud H.G. van Tol > wrote: David Green wrote: my $foo is limited(100..200); $foo = 5; # really does $foo = 100 Where does that MySQ smell come from? Why not undef (or NaN)? How about Failing instead of any of the above? Silently replac

min= (from "Rakudo Built-ins Can Now Be Written In Perl 6")

2009-02-23 Thread David Green
On 2009-Feb-23, Jonathan Worthington posted to Rakudo.org: Applied a patch from bacek++ to get "min= and "max=" working ("$foo min= 100" will assign 100 to $foo if it's smaller than what is in $foo). Nice -- except I first read that backwards, i.e. even though it follows straight from the

Comparing inexact values (was "Re: Temporal changes")

2009-02-23 Thread David Green
On 2009-Feb-23, at 10:09 am, TSa wrote: I also think that time and numbers in general should be treated in a fuzzy way by smart match. My thought is to have == take a :within adverb, at least for imprecise types like Num, that could be used to specify how close values need to come in order

Re: Temporal revisited

2009-02-22 Thread David Green
On 2009-Feb-20, at 7:17 am, Dave Rolsky wrote: Define really basic math. [...] you could say "all math is done in terms of seconds", but then there's literally no way to "add 1 month". Oh, I meant only adding or subtracting seconds (as mentioned elsewhere); adding a month is certainly advanc

Re: r25445 - docs/Perl6/Spec/S32-setting-library

2009-02-21 Thread David Green
On 2009-Feb-20, at 11:17 am, Larry Wall wrote: Certainly, we'll be depending on the type system to keep these things straight. I'm not suggesting the user use bare Nums as anything other than naive durations for APIs such as sleep(). If we have some units to make suitable objects, we can say

Re: Temporal revisited

2009-02-19 Thread David Green
On 2009-Feb-19, at 11:26 am, Dave Rolsky wrote: What I want to see in Perl 6 is a set of very minimal roles that can be used to provide a simply object from gmtime() and localtime(). These objects should not handle locales, proper Olson timezones, string parsing, user-defined formatting, or

Re: Temporal and purity (was: Re: IO, Trees, and Time/Date)

2009-02-19 Thread David Green
On 2009-Feb-19, at 4:39 pm, Martin Kealey wrote: 2. "Date isa Instant" works sensibly: anywhere that expects an Instant, you can give it a Date. (Assuming we all agree that dates start at midnight, but then we *are* talking specifically Gregorian dates.) I don't like dates just starting at

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-18 Thread David Green
On 2008-Dec-17, at 5:15 pm, Aristotle Pagaltzis wrote: The way Template Toolkit solves this is far better: the loop body gets access to an iterator object which can be queried for the count of iterations so far and whether this is the first or last iteration. Well, I prefer a built-in counter l

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-16 Thread David Green
On 2008-Dec-16, at 6:21 pm, Timothy S. Nelson wrote: Or, instead of having a new block, just add the iterator indicator to the NEXT block, and get rid of ENTER and LEAVE. That way, you'd have this sequence: - FIRST {} - NEXT 0 {} # Replaces ENTER - NEXT 1..* {} # Does NOTF

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-16 Thread David Green
On 2008-Dec-6, at 7:37 am, Aristotle Pagaltzis wrote: Funnily enough, I think you’re onto something here that you didn’t even notice: [...] if we had a NOTFIRST (which would run before ENTER just as FIRST does, but on *every* iteration *except* the first), then we could trivially attain the

Re: What does a Pair numify to?

2008-12-15 Thread David Green
On 2008-Dec-15, at 4:18 pm, Jon Lang wrote: If you've got a list of Pairs, you use a sorting algorithm that's designed for sorting Pairs (which probably sorts by key first, then uses the values to break ties). Agreed. If you've got a list that has a mixture of Pairs and non-Pairs, I think

Re: r24325 - docs/Perl6/Spec

2008-12-15 Thread David Green
On 2008-Dec-14, at 11:21 am, Moritz Lenz wrote: Uri Guttman wrote: how is sort ordering specified? Currently it is not specified, it defaults to infix:. If you can suggest a non-confusing way to specify both a transformation closure and a comparison method, please go ahead. how does it k

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-05 Thread David Green
On 2008-Dec-5, at 7:43 am, David Green wrote: Now the condition is in the middle and is syntactically separate. (It's still not up front, but if the first block is really long, you can always... add a comment!) Well, you don't need a comment -- why not allow the condition to co

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-05 Thread David Green
On 2008-Dec-4, at 9:09 am, Aristotle Pagaltzis wrote: And while it does seems like a closure trait, that seems somewhat problematic in that the order of evaluation is weird when compared to other closure traits, which I suppose is what led you to declare the “coy” solution as the most natura

Re: why infix::(Int, Int --> Rat)

2008-12-05 Thread David Green
On 2008-Dec-4, at 3:08 pm, Mark J. Reed wrote: Using "div" instead of "/" should make it pretty clear that you're disposing of the remainder. I misremembered div vs. idiv, but how standard is it? I know "div" commonly means int division, but not always. On the one hand, some things you j

Equality of values and types (was Re: how to write literals of some Perl 6 types?)

2008-12-05 Thread David Green
On 2008-Dec-4, at 4:41 pm, Leon Timmermans wrote: On Thu, Dec 4, 2008 at 6:34 PM, TSa <[EMAIL PROTECTED]> wrote: And how about 'Num 1.0 === Complex(1,0) === Int 1'? IMHO the spec on === is quite clear: "two values are never equivalent unless they are of exactly the same type." I guess the

Re: why infix::(Int, Int --> Rat)

2008-12-04 Thread David Green
On 2008-Dec-4, at 9:42 am, TSa wrote: I remember the state of affairs being that [div] returns an Int Something more explicit like "idiv" was suggested for integral division. Personally, I'm happy not to have anything special provided for it, on the grounds that having to say, e.g. "floor(

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

2008-12-03 Thread David Green
On 2008-Dec-3, at 10:18 am, TSa wrote: Darren Duncan wrote: Strong typing in Perl means that Perl is conveniently and reliably keeping track of this user-intended interpretation of the data, so it is easy for any piece of code to act on it in a reasonable way. Strong typing lets user code

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-03 Thread David Green
On 2008-Dec-3, at 12:38 pm, Mark J. Reed wrote: Overall, the goal is to ensure that by the end of the loop the program is in the state of having just called doSomething(), whether the loop runs or not - while also ensuring that the program is in that state at the top of each loop iteration.

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

2008-12-02 Thread David Green
On 2008-Dec-2, at 12:33 pm, Geoffrey Broadwell wrote: On Tue, 2008-12-02 at 08:50 +0100, Carl Mäsak wrote: Darren (>): How does one write anonymous value literals of those types? Why is the latter method [conversion] insufficient for your needs? Efficiency reasons, among others. Surely the

Re: Signatures and matching (was "Re: XPath grammars (Was: Re: globs and trees in Perl6)")

2008-10-25 Thread David Green
On 2008-Oct-22, at 10:03 am, TSa wrote: David Green wrote: One thing I would like signatures to be able to do, though, is assign parameters by type. Much like a rule can look for identifiable objects like a or , it would be very useful to look for parameters by their type or class rather

Signatures and matching (was "Re: XPath grammars (Was: Re: globs and trees in Perl6)")

2008-10-21 Thread David Green
On 2008-Oct-2, at 6:15 pm, Timothy S. Nelson wrote: The guys on IRC convinced me that the way to go might be something like a grammar, but that does trees and tree transformations instead of a text input stream. See the IRC log for details :). [...] note to treematching folks: it is envisag

Re: Why no "is ro"? (Re: Subroutine parameter with trait and default.)

2008-09-24 Thread David Green
On 2008-Sep-23, at 5:27 pm, Michael G Schwern wrote: David Green wrote: Happily, brevity often aids clarity. The rest of the time, it should be up to one's editor; any editor worth its salt ought to easily auto-complete "ro" into "readonly". Eeep! The "your

Re: Split with negative limits, and other weirdnesses

2008-09-23 Thread David Green
On 2008-Sep-23, at 8:38 am, TSa wrote: Moritz Lenz wrote: In Perl 5 a negative limit means "unlimited", which we don't have to do because we have the Whatever star. I like the notion of negative numbers as the other end of infinity. I think positive values and zero make sense. But I don't

Re: Why no "is ro"? (Re: Subroutine parameter with trait and default.)

2008-09-23 Thread David Green
On 2008-Sep-23, at 2:32 pm, Michael G Schwern wrote: My other thought is that since parameters are read-only by default it's not thought you'd have to write it much so clarity wins out over brevity, the flip side of Huffamn encoding. But that doesn't work out so good for normal variable de

Re: Multiple Return Values - details fleshed out

2008-08-12 Thread David Green
On 2008-Aug-9, John M. Dlugosz wrote to clarify and extrapolate from what is written in the Synopses: Third, list assignment will handle assignment to a literal pair by accessing the names of the items inside the Capture. So list assignment beh

Re: assignable mutators (S06/Lvalue subroutines)

2008-06-06 Thread David Green
On 2008-Jun-2, at 3:30 pm, Jon Lang wrote: sub foo($value?) is rw($value) { ... } Or something to that general effect. The parameter in question must be optional and cannot have a default value, so that a test of whether or not the parameter is actually there can be used to determine whe

  1   2   >