Re: [perl6/specs] 40163b: reverse associativity on R ops

2015-03-30 Thread Martin D Kealey
Reversing the associativity makes sense, but having equal precedence for operators with differing associativity sounds -- as you say -- like madness. Even having non-associative mixed with either-sided-associative sounds like a problem. In general, perhaps we should forbid equal precedence with

Re: Grammars and biological data formats

2014-08-16 Thread Martin D Kealey
Hmmm, what about just implementing mmap-as-string? Then, assuming the parsing process is somewhat stream-like, the OS will take care of swapping in chunks as you need them. You don't even need anything special to support backtracking -- it's just a memory address, after all. -Martin On Thu, 14

Re: [perl6/specs] 5277fe: Add expmod and is-prime as built-ins in Int

2012-09-20 Thread Martin D Kealey
On Wed, 19 Sep 2012, GitHub wrote: Log Message: --- Add expmod and is-prime as built-ins in Int +Returns True if C$x is known to be a prime, or is likely to be a +prime based on a probabilistic Miller-Rabin test. (The optional +argument tells how many times to iterate the

Re: How to make a new operator.

2012-03-22 Thread Martin D Kealey
On Thu, 22 Mar 2012, Carl Mäsak wrote: Jonathan Lang (), Daniel ():    1, 2, 4 ... 100 # same as 1,2,4,8,16,32,64 That last one doesn't work on Rakudo :-( And it never will. Note that 100 is not a power of 2, and that the goal needs to match exactly. This is because smartmatching is

Re: Setting private attributes during object build

2012-02-02 Thread Martin D Kealey
Damian: The whole point of having BUILD() is to separate allocation concerns from initialization concerns. On Thu, 2 Feb 2012, yary wrote: And that's not so good, because it forces BUILD to be used for initialization, and precludes initializing private attributes anywhere else, like a

Re: [perl6/specs] ff11f1: define %%; clarify that % is not quantmod

2011-09-28 Thread Martin D Kealey
Out of curiosity, I followed this and read through Str. When I got to the section on sprintf, I found a few things I think need attention. 1. There isn't any description what the flags do, in particular 'v', which seems to be a P6 enhancement. 2. Not mentioned are 'hh' (native char), 'j'

Re: Encapsulating the contents of container types

2011-09-10 Thread Martin D Kealey
On Fri, 9 Sep 2011, Carl Mäsak wrote: Patrick Michaud said something (I think AFK) that seems essential to me: the non-rw-ness of these objects isn't a trait of *the object itself*, it's a trait of *the context in which the object is used*. In one sense that is true, but if that's the only

Re: exponentiation of Duration's

2010-11-18 Thread Martin D Kealey
On Wed, 17 Nov 2010, Richard Hainsworth wrote: Once a number has been generated, viz., by obtaining a duration, that number can be manipulated however necessary. The interpretation of the number is a matter for the programmer, not the language designer. All true. However I'd argue that you

Re: Tweaking junctions

2010-10-29 Thread Martin D Kealey
On Thu, 28 Oct 2010, Damian Conway wrote: The apparent paradox ... is due to the assumption (employed in the second interpretation) that is identical to !=. Certainly that is true for simple scalar numbers, but not always for vector types such as tuples, sets, bags, complex numbers...or

Re: Tweaking junctions

2010-10-27 Thread Martin D Kealey
I have to admit to feeling uneasy about the whole action-at-a-distance effect that junctions are capable of producing. They sit around pretending to be a scalar, only to pop up and wreak havoc with ones expectations of linearity when you're not expecting it. That unexpected-action-at-a-distance

Re: Smart match isn't on Bool

2010-08-03 Thread Martin D Kealey
On the one hand, I've had 25 years of being annoyed about the idiom if foo() == True ... So I'd be delighted if P6 were to treat that case as a fatal compile-time error. And given that == are != are just funny ways of writing !xor and xor, that prohibition could reasonably be extended

Re: Suggested magic for a .. b

2010-08-01 Thread Martin D Kealey
On Wed, 28 Jul 2010, Darren Duncan wrote: I think that a general solution here is to accept that there may be more than one valid way to sort some types, strings especially, and so operators/routines that do sorting should be customizable in some way so users can pick the behaviour they want.

Re: A common and useful thing that doesn't appear to be easy in Perl 6

2010-04-07 Thread Martin D Kealey
On Wed, 7 Apr 2010, yary wrote: 2010/4/6 Larry Wall la...@wall.org:    Set(Read | Write)   # bogus, R|W is really 3 sets, R, W, and RW!    Set(Read Write)   # okay, can only represent RW Set(A | B) doesn't seem so bogus to me, if what you want is the power set Hmm, surely a power-set

Re: You never have privacy from your children in Perl 6

2010-03-29 Thread Martin D Kealey
On Mar 27, 2010, at 15:43 , Darren Duncan wrote: For example, say you want to define a graph of some kind, and for elegance you have a separate container and node and side classes, On Sat, 27 Mar 2010, Brandon S. Allbery KF8NH wrote: This sounds like a hackaround for an incomplete

Re: numerics, roles, and naming

2010-03-16 Thread Martin D Kealey
On Sun, 14 Mar 2010, Jon Lang wrote: Ruud H.G. van Tol wrote: Did you consider discrete? I think that Discrete could work quite well as the role that encapsulates the ways in which Integer and Gauss are alike. It may even be genralizable beyond that, although there might be some discord

Re: numerics, roles, and naming

2010-03-16 Thread Martin D Kealey
On Mon, 15 Mar 2010, Mark J. Reed wrote: Anything that can be made into a list is discrete. Not quite, since you can create lists whose members belong to continuous sets, e.g. real numbers. Anything that naturally forms a list, maybe. A discrete non-finite set is isomorphic to the set of

Re: r29113 - docs/Perl6/Spec

2009-11-17 Thread Martin D Kealey
On Tue, 17 Nov 2009, pugs-comm...@feather.perl6.nl wrote: +++ docs/Perl6/Spec/S02-bits.pod 2009-11-17 18:37:41 UTC (rev 29113) @@ -2735,10 +2735,11 @@ =item * -Complex literals are similarly indicated by writing an addition of +Complex literals are similarly indicated by writing an

Re: unusual invocants

2009-10-24 Thread Martin D Kealey
On Wed, 21 Oct 2009, Ben Morrow wrote: The most important detail here is that the *class* gets to pick which imported methods need to be wrapped. [but] What this doesn't fix is that some other code (outside the class) will be expecting C::x to have T1::x semantics, and some will be expecting

Re: $*CWD and chdir()

2009-08-20 Thread Martin D Kealey
On Wed, 19 Aug 2009, Timothy S. Nelson wrote: ..but Perl is more magic than bash :). Seriously, I can see both sides of the argument, and I'm leaning towards the $*CWD = chdir idea (as an option if people want to use it), but I realise that a lot of people are leaning the other way. So

Re: XOR does not work that way.

2009-07-03 Thread Martin D Kealey
On Thu, 2 Jul 2009, TSa wrote: Martin D Kealey wrote: This solves both the human expectation (Would you like wine or beer or juice? Beer and juice please Sorry...) and the associativity problem: (a ^^ b) ^^ (c ^^ d) == a ^^ (b ^^ (c ^^ d)). I don't understand how the associativity

Re: XOR does not work that way.

2009-06-24 Thread Martin D Kealey
On Wed, Jun 24, 2009 at 10:35, John Macdonald wrote: Which means that short-circuiting is not right here - it must go through the entire list to determine whether there are zero true selections, find the first of exactly one true selections, or die if there are more than one true selections.

Re: Why pass by reference?

2009-06-19 Thread Martin D Kealey
Matthew Walton wrote: If a user of your API contrives to make it change while you're running, that's their own foot they've just shot, because they can look at the signature and know the semantics of the parameter passing being used and know that if they change the value externally

Re: Why pass by reference?

2009-06-19 Thread Martin D Kealey
On Fri, 19 Jun 2009, Martin D Kealey wrote: To that end I would propose that: - parameters should be read-only AND invariant by default, and - that invariance should be enforced passing a deep immutable clone (*5) in place of any object that isn't already immutable. Sorry, typo

Re: [Fwd: Re: junctions and conditionals]

2009-04-02 Thread Martin D Kealey
On Wed, 1 Apr 2009, Richard Hainsworth wrote: A closer examination of Martin's message indicates that he tends to think that hitting a junction ought to thread the entire program throughout the rest of the lifespan of said junction Yes -- and well put, thank-you. The trick is that since

Re: simultaneous conditions in junctions

2009-04-02 Thread Martin D Kealey
On Wed, 1 Apr 2009, John Macdonald wrote: If I understand correctly, (which is by no means assured) a function call with a junction as an argument generally acts as if it were autothreaded. So: $x = any(1,2,3); $y = f($x); should work like: $y = any( f(1), f(2),

Re: Junction Algebra

2009-03-30 Thread Martin D Kealey
On Mon, 30 Mar 2009, Jon Lang wrote: Here's another useful one: any($x) eqv all($x) eqv one($x) eqv $x but: none($x) !eqv $x That is, applying any, all, or one to a one-item list produces the equivalent to a single item. For an empty list: any() eqv all() eqv (). But what

Re: .map/.reduce with larger arity

2009-03-10 Thread Martin D Kealey
On Mon, 9 Mar 2009, Larry Wall wrote: the only difference between Cfor and Cmap is that you can only use Cfor at the start of a statement. But we're more liberal about where statements are expected in Perl 6, so you can say things like: my @results = do for @list - $x {...}; my

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

2009-02-26 Thread Martin D Kealey
On Thu, 26 Feb 2009, Jon Lang wrote: asin is not the inverse function of sin, although it's probably as close as you can get. And even there, some sort of compiler optimization could potentially be done, replacing the composition of asin and sin (both of which have the potential to intensify

Re: r25490 - docs/Perl6/Spec

2009-02-26 Thread Martin D Kealey
On Thu, 26 Feb 2009, Martin D Kealey wrote: On Wed, 25 Feb 2009, Timothy S. Nelson wrote: I'm in favour of retaining the $[ functionality, but lets give it some name like $*INDEX_BEGINNING or something like that, so that it's quite long for people to type :). Surely the interpretation

Re: r25490 - docs/Perl6/Spec

2009-02-25 Thread Martin D Kealey
On Wed, 25 Feb 2009, Timothy S. Nelson wrote: I'm in favour of retaining the $[ functionality, but lets give it some name like $*INDEX_BEGINNING or something like that, so that it's quite long for people to type :). Surely the interpretation of the index should be up to each array-type?

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

2009-02-24 Thread Martin D Kealey
On Tue, 24 Feb 2009, Jon Lang wrote: $y ± 5 # same as ($y - 5) | ($y + 5) $y within 5 # same as ($y - 5) .. ($y + 5) I suspect that we're running against Huffman here, given the likely usage -- ranges *should* be used at pretty much every floating point equality test, whereas

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

2009-02-24 Thread Martin D Kealey
On Wed, 25 Feb 2009, I wrote: $y + ±5 # same as ($y - 5) | ($y + 5) (also same as $y - ±5) $y ± 5# same as ($y - 5) .. ($y + 5) A further question: should such ranges be [closed], (open) or [half-open)? I would argue for half-open because then exactly one of a set of consecutive

Re: Signals question for S16: IPC / IO / Signals

2009-02-23 Thread Martin D Kealey
On Mon, 23 Feb 2009, Timothy S. Nelson wrote: I have a quick question here. S16 claims to be about IPC, IO, and Signals. So far, it's mostly about IO. My question is, is it intended that IPC and/or signals be part of the core, or should they be converted to addons like Form.pm?

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

2009-02-22 Thread Martin D Kealey
On Fri, 20 Feb 2009, Dave Rolsky wrote: Renamed Temporal::Instant to Temporal::DateTime Hmm. We had some mailing list discussion about this, and agreed on Instant. I'd like to see your reasons in favour of DateTime. Because DateTime makes sense and is a clear description of what the

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

2009-02-22 Thread Martin D Kealey
On Mon, 23 Feb 2009, Timothy S. Nelson wrote: Renamed Temporal::Instant to Temporal::DateTime Hmm. We had some mailing list discussion about this, and agreed on Instant. I'd like to see your reasons in favour of DateTime. Because DateTime makes sense and is a clear description

Re: IO, Trees, and Time/Date

2009-02-18 Thread Martin D Kealey
On Wed, 18 Feb 2009, Timothy S. Nelson wrote: I'll try and design an API that does what DateTime does, but: 1. Uses more variables, of which I expect the getters and setters to be overridden. Please let's NOT have setters on time objects. They're a source of subtle bugs in such client code

Re: Detecting side-effects in Perl 6 (Was: Re: infectious traits and pure functions)

2009-02-17 Thread Martin D Kealey
On Tue, 17 Feb 2009, TSa wrote: I fully agree that immutability is not a property of types in a signature. But a signature should have a purity lock :(Int $i is pure) that snapshots an object state [...] Note that this purity lock doesn't lock the outer object. It is only affecting the inner

Re: infectious traits and pure functions

2009-02-16 Thread Martin D Kealey
On Fri, 13 Feb 2009, Jon Lang wrote: In reading about functional programming, I ran across the concept of the pure function - i.e., a function that doesn't produce side effects. [...] It occurred to me that this business of marking functions as pure could be done in perl by means of traits

Re: infectious traits and pure functions

2009-02-16 Thread Martin D Kealey
On Mon, 16 Feb 2009, Jon Lang wrote: if there's any doubt about the matter (e.g., conclusively proving or disproving purity would be NP-complete or a halting problem), then Deciding whether you have a halting problem IS a halting problem... :-) -Martin

Re: RFD: Built-in testing

2009-01-28 Thread Martin D Kealey
On Wed, 21 Jan 2009, Damian Conway wrote: Maybe something in all caps. For what it's worth, :OK can be typed with one hand while the other holds down the shift key. :) Typical right-hander fascism! On the other hands we have :QA ... which also so happens to be an apposite abbreviation. :-)

Re: S16: chown, chmod

2008-12-01 Thread Martin D Kealey
On Tue, 25 Nov 2008, Dave Whipp wrote: 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

Re: [perl #60044] [BUG?] rethrow just throwing?

2008-10-28 Thread Martin D Kealey
On Fri, 24 Oct 2008, Allison Randal wrote: Will Coleda wrote: Allison Randal wrote: ...you expect 'rethrow' to keep the stack trace of the original 'die'? Yes. The way to do this is to add stack trace information to the Exception's 'stacktrace' attribute when the exception is first

Re: Recommended Perl 6 best practices?

2008-09-30 Thread Martin D Kealey
On Tue, 30 Sep 2008, Patrick R. Michaud wrote: Just for pedantic clarity, what C $directive ne 'VAR' 'LOOP' 'IF' really gives is all( $directive ne 'VAR', $directive ne 'LOOP', $directive ne 'IF' ) In other words, the result of the expression is an all() Junction. In boolean context

Re: [perl #40058] Disambiguate usage of class PMCs from class name lookup (pdd15, pdd06, pdd19)

2006-08-06 Thread Martin D Kealey
On Thu, 3 Aug 2006, Chip Salzenberg wrote: KNOWN FUTURE DEVELOPMENTS It's already decided that we're moving class PMCs into the normal namespace tree. This change will eliminate many uses of the class-lookup opcodes, but not all: There's a two-level search will still be required, where the

Re: Input / Output encoding filters.

2006-02-21 Thread Martin D Kealey
I'm a bit slow coming back to this, sorry. It seems that seek is used in two ways: * returning to some previously identified point (including the start or end of the file) * moving a given number of characters you want to move relative to a known location Clearly you can

Re: About multithreading

2005-10-01 Thread Martin D Kealey
Leo wrote: http://www.gotw.ca/publications/concurrency-ddj.htm The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software Herb Sutter On Tue, 20 Sep 2005, Jonathan Worthington replied: Yup, and it's encouraging to see Perl 6 is heading in a good direction on concurrency

Re: parrot and refcounting semantics

2005-04-28 Thread Martin D Kealey
On Thu, 28 Apr 2005, Robin Redeker wrote: I don't think circular references are used that much. Circular references are useful any time you need to be able to iterate over a collection, and also have to identify which collection a given object is in. This may even be implicit from other

Re: parrot and refcounting semantics

2005-04-28 Thread Martin D Kealey
On Thu, 28 Apr 2005, Luke Palmer wrote: Or, with the block hooks that I keep claiming makes timely destruction almost never needed, it is: { my $s = new CoolClass; # ... do stuff that may throw ... LEAVE { destroy $s } } This destroys properly and even

Re: Parrot bytecode reentrancy

2005-04-17 Thread Martin D Kealey
On Fri, 15 Apr 2005, Nigel Sandever wrote: I struck me a while back that there is a contradiction in idea of a shared, 'my' variable. I want to say lexical, but a var declared with 'our' is in some sense lexical. Shared-between-threads and shared-between-scopes are orthogonal properties;

L-valueness of Arrays vs. Lists

2003-02-22 Thread Martin D Kealey
On Tue, 11 Feb 2003, Michael Lazzaro wrote: What is the utility of the perl5 behavior: \($a,$b,$c) meaning (\$a, \$b, \$c) Do people really do that? ... Can someone give an example of an actual, proper, use? Yes, I've used it like this: for (\($a,$b,$c)) { $$_++;

Re: Arrays, lists, referencing

2003-02-22 Thread Martin D Kealey
I would like to chip in in favour of the list is value, array is container side of the argument. However I think that needs clarifying. A reference is a value; the thing it refers to is a container. An anonymous container is a container with no references from any symbol table. It can lose its

RE: Unifying invocant and topic naming syntax

2002-11-21 Thread Martin D Kealey
On Thu, 2002-11-21 at 20:11, Brent Dax wrote: Are you suggesting this? if($error) { use visible 'croak'; require Carp; import Carp: 'croak'; croak($error); } No - that would be pointless as well as error-prone. My idea

Re: String concatentation operator

2002-11-20 Thread Martin D Kealey
On Mon, 2002-11-18 at 18:10, Dave Whipp wrote: Why do we need to use preemptive threads? If Parrot is a VM, then surely the threading can be implemented at its level, or even higher. And what about *lower*? Like down among the CPUs? I want Perl to run 128 times faster on a 128 CPU machine...

RE: Unifying invocant and topic naming syntax

2002-11-20 Thread Martin D Kealey
On Wed, 2002-11-20 at 15:01, Brent Dax wrote: We need that capability if we're going to have lexically-scoped exports: Whilst it would be useful for pragmatic modules to access anything and everything in the current compilation scope, I submit that access to dynamic scope should (in general) be

Re: Numeric Literals (Summary 2)

2002-11-20 Thread Martin D Kealey
On Tue, 2002-11-19 at 08:28, Michael Lazzaro wrote: - floating point becomes allowed in explicit radix (and 0b,0c,0x) How can one have floating point if E is a valid digit? 0x1.0e1 # 1.054931640625 or 16 ? Has any consideration been given to using letters other than a~f in the second

Re: Numeric Literals (Summary)

2002-11-20 Thread Martin D Kealey
On Sat, 2002-11-16 at 07:37, Michael Lazzaro wrote: Due to ambiguities, the proposal to allow floating point in bases other than 10 is therefore squished. If anyone still wants it, we can ask the design team to provide a final ruling. Why are we so hung up on spelling floating-point

Re: Numeric Literals (Summary)

2002-11-20 Thread Martin D Kealey
On Thu, 2002-11-21 at 09:54, Luke Palmer wrote: I've always wanted to meet The Devil. :) You're welcome :-) Honestly, I can't tell by looking at that what those are supposed to mean. And I'm not putting any numbers that ugly into my Perl soup. Perl 6 is trying to Idecrease obfuscation. I

Re: String concatentation operator

2002-11-20 Thread Martin D Kealey
On Thu, 2002-11-21 at 06:57, Mark Biggar wrote: Martin D Kealey wrote: I want Perl to run 128 times faster on a 128 CPU machine... now I know that's not entirely realistic, but it should be able to run at least say 60 times faster. Amdahl's law applies here: no amount of paralellism

[OT] linguistics and cultural bias?

2002-10-30 Thread Martin D Kealey
On Tue, 29 Oct 2002, Larry Wall wrote: Logically entangle nouns *are* more basic than grade school. Kids are even sophisticated enough to disambiguate xor from or by context, despite the fact that English has no xor operator: Which do you want? A popsicle or a Mickey Mouse hat?

Re: [RFC] Perl6 HyperOperator List

2002-10-30 Thread Martin D Kealey
On Tue, 29 Oct 2002, Larry Wall wrote: Maybe we should just say that you can put it anywhere that makes sense, and let the perl parser sort out the sheep from the goats. The basic rule is that for any op, [op] is also expected in the same place. It would be nice to have a fully generalized

Re: perl6 operator precedence table

2002-10-30 Thread Martin D Kealey
On Fri, 25 Oct 2002, I wrote: why not simply extend pattern-matching in a similar way to substr, making it an L-value, so that one gets $str ~ /[aeiou]+/ = vowels($) or $str ~ /\d/ {hyper-symbol}= (0) x {size-of-LHS-array}; On Thu, 24 Oct 2002, Larry Wall replied: Problem

Re: perl6 operator precedence table

2002-10-25 Thread Martin D Kealey
On Thu, 24 Oct 2002, Larry Wall wrote: It's possible the syntax for substitution should be wrapped around the syntax for matching, whatever that turns out to be. That strikes me as promising... Going back to Perl5 for a moment, we have substr($str,$start,$len) = $newstr why not simply

Re: 64-bit ints and non-capable hardware

2002-10-23 Thread Martin D Kealey
On Wed, 23 Oct 2002, Rhys Weatherley wrote: Martin D Kealey wrote: [Frank Farance's paper] specification based extended integer range [at] http://wwwold.dkuug.dk/JTC1/SC22/WG14/docs/c9x/extended-integers/. Very interesting proposal. I wish they had adopted it. Would have saved me a lot

Re: 64-bit ints and non-capable hardware

2002-10-22 Thread Martin D Kealey
Dan Sugalski [EMAIL PROTECTED] wrote: Okay, I'm about ready to just bite the bullet and declare that INTVALs have to be 64 bit integers. Does anyone know of a platform that has neither native nor emulated 64 bit integers? (One we're likely to run on, rather) I'm fairly new to Parrot, but

Re: [perl #18044] Assembler doesn't return a useful exit status

2002-10-22 Thread Martin D Kealey
On Mon, 21 Oct 2002, Clinton Pierce wrote: * With bad arguments, the assembler returns 1 to the OS. Peachy. Please can we have... #include sysexits.h exit(EX_USAGE); // 64 on most platforms * Upon failure, the assembler returns the status 0 to the OS and writes some bytecode. No