Re: exponentiation of Duration's

2010-11-18 Thread Dave Whipp
On 11/17/2010 10:08 PM, Martin D Kealey wrote: Dimensioned numbers as restrictive types are useful, for uncovering bugs, including sometimes latent ones in ported code. Duration is a fairly clear example of a dimensioned quantity, and I think we should think twice about abandoning its dimension

Re: Tweaking junctions

2010-11-01 Thread Dave Whipp
uot;core" functionality that I'll be able to implement something like this as a module. So I don't push it except when someone else starts a thread about the "values of a junction" :). Dave.

Re: Tweaking junctions

2010-10-25 Thread Dave Whipp
Damian Conway wrote: Yes, Ted Z. pointed out to me that, as the name of this construct, "every" has ambiguity and synonym issues. Other possibilities are: select(@values) < one(3..7) those(@values) < one(3..7) whichever(@values) < one(3..7) itemize(@values) < one(3..7) extra

Re: Tweaking junctions

2010-10-25 Thread Dave Whipp
lete implementation of a module implementing them, which runs successfully on the current release of Rakudo*. I append said model for your amusement (and suggestions!). ++ Dave.

Re: Tweaking junctions

2010-10-22 Thread Dave Whipp
Damian Conway wrote: I've been thinking about junctions, and I believe we may need a small tweak to (at least) the jargon in one part of the specification. When this issue has been raised in the past, the response has been that junctions are not really intended to be useful outside of the narr

Re: threads?

2010-10-12 Thread Dave Whipp
Damian Conway wrote: Perhaps we need to think more Perlishly and reframe the entire question. Not: "What threading model do we need?", but: "What kinds of non-sequential programming tasks do we want to make easy...and how would we like to be able to specify those tasks?" The mindset that I u

Re: Pragma to change presentation of numbers in Perl 6.

2010-09-02 Thread Dave Whipp
Matthew wrote: use base 16; my $a = 10; say $a; puts the number 0x10 into $a, and outputs `10'. Here, say $a.fmt('%d') would output `16'. As someone who has implemented, and used, mini-languages with such a feature, I'd say that the confusion that it would cause does significantly outweigh

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread Dave Whipp
Darren Duncan wrote: Dave Whipp wrote: Similarly (0..1).Seq should most likely return Real numbers No it shouldn't, because the endpoints are integers. If you want Real numbers, then say "0.0 .. 1.0" instead. -- Darren Duncan That would be inconsistent. $x ~~ 0..1 means 0

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread Dave Whipp
Aaron Sherman wrote: On Wed, Jul 28, 2010 at 11:34 AM, Dave Whipp wrote: To squint at this slightly, in the context that we already have 0...1e10 as a sequence generator, perhaps the semantics of iterating a range should be unordered -- that is, for 0..10 -> $x { ... } is treated as

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread Dave Whipp
Moritz Lenz wrote: I fear what Perl 6 needs is not to broaden the range of discussion even further, but to narrow it down to the essential points. Personal opinion only. OK, as a completely serious proposal, the semantics of "for 0..10 { ... }" should be for the compiler to complain "sorry, t

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread Dave Whipp
Moritz Lenz wrote: Dave Whipp wrote: for 0..10 -> $x { ... } is treated as for (0...10).pick(*) -> $x { ... } Sorry, I have to ask. Are you serious? Really? Ah, to reply, or not to reply, to rhetorical sarcasm ... In this case, I think I will: Was my specific proposal en

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread Dave Whipp
Michael Zedeler wrote: This is exactly why I keep writing posts about Ranges being defunct as they have been specified now. If we accept the premise that Ranges are supposed to define a kind of linear membership specification between two starting points (as in math), it doesn't make sense that

Re: Parallelism and Concurrency was Re: Ideas fora"Object-Belongs-to-Thread" (nntp: message 4 of 20) threading model (nntp:message 20 of 20 -lastone!-)

2010-05-17 Thread Dave Whipp
ufficient mechanisms (via traits) to define data placement without any new features. And therefore the issue can be ignored until someone actually attempts to implement OpenCL bindings. Dave.

Re: Parallelism and Concurrency was Re: Ideas for a"Object-Belongs-to-Thread" threading model (nntp: message 20 of 20 -lastone!-)

2010-05-17 Thread Dave Whipp
nigelsande...@btconnect.com wrote: There are very few algorithms that actually benefit from using even low hundreds of threads, let alone thousands. The ability of Erlang (and go an IO and many others) to spawn 100,000 threads makes an impressive demo for the uninitiated, but finding practical

Re: Ideas for a "Object-Belongs-to-Thread" threading model

2010-05-12 Thread Dave Whipp
indeed interesting to consider how these map ot vastly difference computation platforms: OpenCl Vs OpenMP Vs Cloud. It deeps a little premature to be defining roles (e.g. RemoteInvocation) without defining the mapping of the core operators to these various models of computation. Dave.

Re: optional rules cluttering parse trees

2010-04-28 Thread Dave Whipp
Moritz Lenz wrote: Am 27.04.2010 06:31, schrieb Stéphane Payrard: When doing an analyse of a sample parse tree, I note that it is cluttered by the reduction of optional subrules to generate a zero length parse subtree. That is, rules with a '?' quantifier matching zero time. Currently the ? q

Re: Proposal for a new Temporal time-measurement paradigm

2010-04-22 Thread Dave Rolsky
endar objects in core makes a lot of sense. For folks who need to get fancier, the day count on the Date class will allow simple conversion between calendars, which they can find on CPAN6, along with modules that do more with the Gregorian calendar.

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

2010-04-20 Thread Dave Rolsky
n the Perl 5 DateTime sweet. Exposing this value explicitly (rata-die-day-count) would be a wise decision, IMO. Also, "day-count", not "daycount" ;) -dave /* http://VegGuide.org http://blog.urth.org

Re: A new era for Temporal

2010-04-20 Thread Dave Rolsky
On Mon, 12 Apr 2010, Moritz Lenz wrote: Am 12.04.2010 03:47, schrieb Dave Rolsky: On Sun, 11 Apr 2010, Moritz Lenz wrote: I've planned to add such a module to the Perl 6 spec, but some comments on #perl6 suggested it should be kept out of core to prevent bloat. Still if the overall op

Re: a more useful srand (was Re: r30369 - docs/Perl6/Spec/S32-setting-library)

2010-04-12 Thread Dave Whipp
Moritz Lenz wrote: 1) A RNG class (don't really care what the name is, for now) 2) An instance of that in $*RAND (which you can temp()) 3) rand() and srand() act on $*RAND 4) It should be easy to create instances of the RNG to use in your own class. The sounds reasonable. The one thing I'd add

a more useful srand (was Re: r30369 - docs/Perl6/Spec/S32-setting-library)

2010-04-12 Thread Dave Whipp
masak wrote: Modified: docs/Perl6/Spec/S32-setting-library/Numeric.pod Log: [S32/Numeric] removed method form of srand Overwhelming consent on #perl6 about this. - multi method srand ( Real $seed: ) multi srand ( Real $seed = default_seed_algorithm()) Seed the generator C uses. C<$seed>

Re: underscores vs hyphens (was Re: A new era for Temporal)

2010-04-11 Thread Dave Rolsky
ple s/_/-/g -dave /* http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) */

Re: expression of seconds (was Re: A new era for Temporal)

2010-04-11 Thread Dave Rolsky
not always control how the DateTime object is constructed. Nonetheless, when they want to know "what is the value for seconds", I think _most_ users will want an integer, not a floating point number. -dave /*

Re: A new era for Temporal

2010-04-11 Thread Dave Rolsky
ec it. I think that having a standard, minimal API for this defined in core as a Date role would be ideal. -dave /* http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) */

Re: A new era for Temporal

2010-04-09 Thread Dave Rolsky
On Thu, 8 Apr 2010, Carl Mäsak wrote: I do want to explicitly credit Dave Rolsky, whose work on the DateTime family of modules on CPAN has informed much of the current spec, sometimes to the point of verbatim copying. Thanks, but I'd hate to see you copy all my mistakes too! One th

Re: Comments on S32/Numeric#Complex

2009-12-17 Thread Dave Whipp
Todd Olson wrote: At 14:54 -0500 2009-12-17, Jon Lang wrote: And really, my whole point is that the implementation details are (conceptually) the only thing that distinguishes Complex::Polar from Complex::Cartesian. All though both e^(i ¼) and e^(i 3 ¼) evaluate to -1 + 0i it is often u

Re: Comments on S32/Numeric#Complex

2009-12-17 Thread Dave Whipp
Doug McNutt wrote: my ($x, $y) = $vector «·« ( [1, 0], [0, 1] ); After a while I became resigned to the fact that dot and cross products were not what was being offered. Instead a product of two vectors was to be simply a component by component multiply that produced another "vector" of the s

Re: Comments on S32/Numeric#Complex

2009-12-17 Thread Dave Whipp
Jon Lang wrote: my ($num, $denom) = $num.^attr; # $num.WHAT == Ratio; my ($mag, $phase) = Complex::Polar($z).^attr; my ($re, $im) = Complex::Cartesian($z).^attr; my ($x, $y) = $vector.^attr »·« ( [1, 0], [0, 1] ); If I'm reading this right, the .^attr is exposing implementation details

Re: Comments on S32/Numeric#Complex

2009-12-17 Thread Dave Whipp
Moritz Lenz wrote: Dave Whipp wrote: [cut] Contrast with Rat which has both separate accessors and the "nude" method (a name that could possibly be improved to avoid adult-content filters) suggestions welcome. Attempting to generalize: what we want is an operator that extracts

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread Dave Whipp
yary wrote: At 00:15 +0100 12/17/09, Moritz Lenz wrote: Not quite, .abs returns one of the polar coordinates (the magnitude), so only a method is missing that returns the angle. Any ideas for a good name? Would a method called "phi" with a unicode synonym "φ" be too obtuse? Anything wrong

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread Dave Whipp
Moritz Lenz wrote: our multi method polar (Complex $nim: --> [ Real $mag where 0..Inf, Real $angle where -π ..^ π ]) is export { ... } If you put this into a signature, it is checked on every call to that method and thus slows down execution. If you want a formalization that's not part of th

Comments on S32/Numeric#Complex

2009-12-16 Thread Dave Whipp
$mag where 0..Inf, Real $angle where -π ..^ π ]) is export { ... } Finally, anyone using complex numbers probably wants a "conjugate" method and/or operator postfix:<*> almost as much as they want unary-minus: $mag = sqrt( $z * $z* ); Dave.

Re: Filename literals

2009-08-18 Thread Dave Whipp
Leon Timmermans wrote: Reading this discussion, I'm getting the feeling that filename literals are increasingly getting magical, something that I don't think is a good development. [...]. I don't want to deal with Windows' strange restrictions on characters when I'm working on Linux. I don't want

Re: YAPC::EU and Perl 6 Roles

2009-07-08 Thread Dave Whipp
Ovid wrote: I'd like to see something like this (or whatever the equivalent Perl 6 syntax would be): class PracticalJoke does Bomb does SomeThingElse { method fuse() but overrides { ... } } The "overrides" tells Perl 6 that we're overriding the fuse() method > from either Bomb or Som

Re: Temporal

2009-05-25 Thread Dave Rolsky
On Sat, 2 May 2009, Timothy S. Nelson wrote: Hi. Can someone (Dave Rolsky?) please tell me why rewriting S32/Temporal in terms of Enum roles would be bad? See the example of Enum day roles here: http://www.rakudo.org/node/39 Because day and month names are hardly universal, and forcing

Re: junctions and conditionals

2009-04-01 Thread Dave Whipp
Mark J. Reed wrote: [I] wrote: So I'd vote for going with simple semantics that are easy to explain -- that is, don't attempt implicit junctional collapse. Provide operators to collapse when needed, but don't attempt to be too clever. While it's easier to find clever programmers than to write

Re: junctions and conditionals

2009-04-01 Thread Dave Whipp
Jon Lang wrote: [proposal that conditional statements should collapse junctions] $x = +1 | -1; if $x > 0 { say "$x is positive." } else { say "$x is negative." } I suspect that both codeblocks would be executed; but within the first block, $x == +1, and within the second codeblock,

Re: simultaneous conditions in junctions

2009-04-01 Thread Dave Whipp
Richard Hainsworth wrote: Thinking about Jon Lang's -1|+1 example in another way, I wondered about simultaneous conditions. Consider $x = any (1,2,5,6) How do we compose a conditional that asks if any of this set of eigenstates are simultaneously both > 2 and < 5? Clearly the desired answer

Re: On Junctions

2009-03-27 Thread Dave Whipp
[I’d been planning to put this suggestion on hold until the spec is sufficiently complete for me to attempt to implement it as a module. But people are discussing this again, so maybe it's not just me. I apologize if I appear to be beating a dead horse...] Jon Lang wrote: Maybe you could hav

Re: On Junctions

2009-03-27 Thread Dave Whipp
Richard Hainsworth wrote: The following arose out of a discussion on #perl6. Junctions are new and different from anything I have encountered, but I cant get rid of the feeling that there needs to be some more flexibility in their use to make them a common programming tool. I strongly agree w

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;

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: 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

Re: Temporal revisited

2009-02-20 Thread Dave Rolsky
always to be written to say 30, 60 or 90 days not 1, 2 or 3 months from now. It is ill-defined, but a good API can make something reasonable out of it. I refer you to DateTime and DateTime::Duration, which provide a reasonable AP

Re: Temporal revisited

2009-02-20 Thread Dave Rolsky
s, this is completely broken. Of course, if you're dealing with TAI only, you're safe for constants up to ONE_WEEK. -dave /* http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) */

Re: Temporal revisited

2009-02-20 Thread Dave Rolsky
On Fri, 20 Feb 2009, Dave Whipp wrote: 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 --> Du

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: r25445 - docs/Perl6/Spec/S32-setting-library

2009-02-20 Thread Dave Rolsky
p://en.wikipedia.org/wiki/Epoch_(reference_date)#Computing I don't care what epoch we standardize on, as long as it's consistent across platforms. -dave /* http://VegGuide.org http://blog.urth.org Your guide to al

Re: Temporal revisited

2009-02-20 Thread Dave Rolsky
On Fri, 20 Feb 2009, Leon Timmermans wrote: On Thu, Feb 19, 2009 at 7:26 PM, Dave Rolsky wrote: After some discussion I made a number of drastic revisions to S32-setting-library/Temporal.pod What I want to see in Perl 6 is a set of very minimal roles that can be used to provide a simply

Re: Temporal revisited

2009-02-20 Thread Dave Rolsky
If the datetime changes, the observance should change, but this is a complicated thing to handle. If the datetime is immutable, then this is a non-issue. -dave /* http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) */

Re: Temporal revisited

2009-02-20 Thread Dave Rolsky
On Fri, 20 Feb 2009, David Green wrote: 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

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

2009-02-20 Thread Dave Rolsky
o time with hidden leap seconds. I sure wish they'd done away with civic leap seconds in 2000 and said we'll put in a leap minute or two on century breaks... That's certainly fine with me, but I think we'd still want some simple objects on top of them, rather than handing p

Re: Temporal changes (was: Re: r25445 - docs/Perl6/Spec/S32-setting-library)

2009-02-20 Thread Dave Rolsky
e merged in as well? I'm sure there could be one constructor as a language built-in, time being a reasonable candidate. But I can also see the value of having two, one for UTC and one for local time. -dave /* http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) */

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

2009-02-19 Thread Dave Rolsky
re, because it makes everything more complicated. If, OTOH, I couldn't make OnCPAN6::DateTime::Incomplete do the DateTime interface, that'd be a good argument for changing the core interface. -dave /* http://VegGuide.org

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

2009-02-19 Thread Dave Rolsky
not doing so makes some things a lot easier (though it makes other things harder ;) -dave /* http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) */

Temporal revisited

2009-02-19 Thread Dave Rolsky
ut of core. I don't really know Perl 6 all that well, so I'd welcome review, in particular of my Perl 6-isms, and also just of the general concepts. -dave /* http://VegGuide.org http://blog.urth.org Your guide to

Re: IO, Trees, and Time/Date

2009-02-18 Thread Dave Rolsky
etc. It wasn't clear to me whether you were proposing putting this yet-to-be-named thing core, of course. -dave /* http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) */

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: 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: 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

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
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
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: 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-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: 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: 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: 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: [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: 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: 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: 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

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: Dave W

rfc: The values of a junction

2009-01-05 Thread Dave Whipp
e at least convinced you that core language support is needed to extract the "values" of a junction; and that a "Junction::eigenvalues" method is not the correct way to achieve this. Dave. ps. The reason for choosing vertical bars, |op|, as the meta-op syntax is partly

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

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: 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: 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-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

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

Re: meta_postfix:<*>

2008-07-15 Thread Dave Whipp
Jon Lang wrote: So you're suggesting that A op* n should map to [op] A xx n I don't think that that mapping works for Thomas' proposal of a repetition count on post-increment operator. I.e. $a ++* 3 is not the same as [++] $a xx 3 (which I think is a syntax error) and also not

Re: Fatal/autodie exception hierarchies for Perl 5

2008-06-04 Thread Dave Whipp
Larry Wall wrote: On Wed, Jun 04, 2008 at 10:42:33AM -0400, Mark J. Reed wrote: : However, I think we are now officially *way* off topic for Perl6... Not really--a Klingon army is a *parallel* processor, and just because one Klingon dies doesn't mean the whole army should suddenly die too. Tradi

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

Re: assignable mutators (S06/Lvalue subroutines)

2008-05-27 Thread Dave Whipp
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 at the time

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: 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: 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: So eseentially, given (@foo) means the same as Perl5 for ([EMAIL PROTECTED]) Just wondering: should "given @foo {...}" alias to $_, or @_?

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: Perl 6 fundraising and related topics.

2008-02-29 Thread Dave Rolsky
On Tue, 26 Feb 2008, Ovid wrote: How else should we be advertising this? These mailing lists might be a good place. Basically, places where the work in question is done also seem like good places to advertise. -dave /*=== VegGuide.Org

Re: Perl 6 fundraising and related topics.

2008-02-22 Thread Dave Rolsky
PF's communications problem. People don't know about the grants, or don't know what is likely to be accepted, don't know when to apply, etc. -dave /*=== VegGuide.Orgwww.BookIRead.com Your guide to all that's veg. My book blog ===*/

Re: Perl 6 fundraising and related topics.

2008-02-22 Thread Dave Rolsky
uctible. Also, if you pay them enough (>= $2k, I believe) you'll have to file a 1099 form because they're now a subcontractor for you ;) Personally, I really think it's important that any money funding Perl work go through TPF.

Re: Perl 6 fundraising and related topics.

2008-02-22 Thread Dave Rolsky
o massive source of income available that would not be a donation, to the best of my knowledge. If there were such a source, forming a subsidiary for-profit corporation would be worthwhile. -dave /*=== VegGuide.Orgwww.BookIRead.com Your guide to all that's veg. My book blog ===*/

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

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: 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

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-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

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
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

  1   2   3   4   5   >