Re: Exegesis 7: Overflow Fields

2004-02-28 Thread Luke Palmer
Mark A. Biggar writes: Larry Wall wrote: On Sat, Feb 28, 2004 at 11:59:15AM -0800, Gregor N. Purdy wrote: : Smylers -- : : So, what I'm looking for is more explicit phrasing around immediately : above. In the example, the column range for the overflow field is : exactly the same as that

Re: Thinking about Accessors

2004-02-27 Thread Luke Palmer
John Williams writes: I want to get from here method bar_attr(?$val) is accessor { $.bar_attr = $val if exists $val; return $.bar_attr; } to here method bar_attr() is rw { return my $x is Proxy ( for = $.bar_attr, FETCH = {

Re: How do I recognize an array element access?

2004-02-22 Thread Luke Palmer
Austin Hastings writes: Suppose I want to say: sub sublist(@a, $start, $cnt) { return @a[$start] +next --$cnt; } where +next is a binary macro that takes as its lhs an array element access, and its rhs a number, and returns a list of the array element followed by the next RHS

Re: The Sort Problem: a definitive ruling

2004-02-20 Thread Luke Palmer
Smylers writes: Luke Palmer writes: Uri Guttman writes: DC == Damian Conway [EMAIL PROTECTED] writes: DC @sorted = sort {-M}={$^b cmp $^a} @unsorted; but there is no comma before @unsorted. is that correct? Yes. Commas may be ommitted on either side of a block

Re: The Sort Problem: a definitive ruling

2004-02-20 Thread Luke Palmer
Smylers writes: Joe Gottman writes: sort {$_.key} (1= 'a', 10 = 'b', 2 ='c'); There is nothing in the signature of the key-extractor to suggest that all the keys are numbers, but as it turns out they all are. Are they? I'd been presuming that pair keys would always be strings

Re: The Sort Problem: a definitive ruling

2004-02-20 Thread Luke Palmer
Smylers writes: Luke Palmer writes: After this statement: $x = '345'; C$x is a number. Oh. I'd been assuming that quote marks indicated strings, and that, while a string containing only digits could obviously be treated as a number (as in Perl 5), it wouldn't be one

Re: The Sort Problem: a definitive ruling

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

Re: The Sort Problem: a definitive ruling

2004-02-19 Thread Luke Palmer
Uri Guttman writes: DC == Damian Conway [EMAIL PROTECTED] writes: DC # Modtimewise numerically ascending... DC @sorted = sort {-M $^a = -M $^b} @unsorted; DC # Fuzz-ifically... DC sub fuzzy_cmp($x, $y) returns Int; DC @sorted = sort fuzzy_cmp, @unsorted;

Re: The Sort Problem: a definitive ruling

2004-02-19 Thread Luke Palmer
Luke Palmer writes: Yes. Commas may be ommitted on either side of a block when used as an argument. I would argue that they only be omitted on the right side, so that this is unambiguous: if some_function { ... } { ... } Which might be parsed as either

Re: The Sort Problem

2004-02-16 Thread Luke Palmer
Damian Conway writes: type KeyExtractor ::= Code(Any) returns Any; type Comparator ::= Code(Any, Any) returns Int; type Criterion::= KeyExtractor | Comparator Pair(KeyExtractor, Comparator) ; type Criteria ::=

Re: The Sort Problem

2004-02-16 Thread Luke Palmer
Uri Guttman writes: LP == Luke Palmer [EMAIL PROTECTED] writes: LP Uri Guttman writes: because that would be the default comparison and the extracted key value would be stringified unless some other marker is used. most sorts are on strings so this would be a useful huffman

Re: The Sort Problem

2004-02-15 Thread Luke Palmer
Uri Guttman writes: because that would be the default comparison and the extracted key value would be stringified unless some other marker is used. most sorts are on strings so this would be a useful huffman and removal of a redundancy. While I like where most of this is going, I beg to differ

Re: The Sort Problem

2004-02-12 Thread Luke Palmer
Aaron Crane writes: Luke Palmer wrote: Any other ideas? How about something like this, modulo any errors in my Perl 6 syntax? sub sort(?cmp = infix:cmp, +$key, +$desc, [EMAIL PROTECTED]) { ... } I think that allows all of these: # P5: @sorted = sort @unsorted; @sorted = sort

Re: The Sort Problem

2004-02-12 Thread Luke Palmer
Aaron Crane writes: I have one other idea, but I can't decide if I like it: @unsorted == sort rinfix:cmp == @sorted; That is, rinfix: (or some other name) is like infix:, but gives you a function that reverses its arguments before actually running the operator. Perhaps it could even be

Re: dynamic arguments (was: The Sort Problem)

2004-02-12 Thread Luke Palmer
Jonathan Lang writes: How about including something similar to ==, but which binds the elements of the list to the various positional parameters? For instance: @sorted = sort {infix:= args map {$_.foo('bar').compute}, $^a, $^b } @unsorted; Where @x = $a, $b, $c;

Re: The Sort Problem (was: well, The Sort Problem)

2004-02-12 Thread Luke Palmer
Jonathan Lang writes: We already have that. It's spelled: routine [EMAIL PROTECTED]; Or routine * == @x; Then you've got your solution: @sorted = sort {infix:= * map {$_.foo('bar').compute}, $^a, $^b } @unsorted; or @sorted = sort {($^a, $^b)

The Sort Problem

2004-02-11 Thread Luke Palmer
I've been thinking about this problem which comes up in my code a lot: @sorted = sort { $^a.foo('bar').compute = $^b.foo('bar').compute } @unsorted; Often the expressions on each side are even longer than that. But one thing remains: both sides are exactly the same,

Re: The Sort Problem

2004-02-11 Thread Luke Palmer
Uri Guttman writes: GNP == Gregor N Purdy [EMAIL PROTECTED] writes: GNP (But, the GRT doesn't apply to sorting general objects, and the GNP example has @unsorted containing objects on which we run GNP .foo('bar').compute.) there are no restrictions on what the GRT (or ST) can sort.

Re: Compiler writing tools

2004-02-03 Thread Luke Palmer
Larry Wall writes: On Mon, Feb 02, 2004 at 02:09:33AM -0700, Luke Palmer wrote: : method if_statement::code($rc) { # $rc is the regcounter : self.item[0].code($rc.next('condition')) : ~ unless $rc{condition}, $rc{Lfalse}\n : ~ self.item[1].code($rc.next

Compiler writing tools

2004-02-02 Thread Luke Palmer
I've been writing a lot of compiler recently, and figuring as how Perl 6 is aiming to replace yacc, I think I'll share some of my positive and negative experiences. Perhaps Perl 6 can adjust itself to help me out a bit. :-) =over =item * RegCounter I have a class called RegCounter which is

Re: Semantics of vector operations

2004-02-02 Thread Luke Palmer
Alex Burr writes: --- Andy Wardley [EMAIL PROTECTED] wrote: Adding unicode operators to Perl will just reinforce its reputation as a line noise language. Perl6, the language with *real* runes. Come to think of it, some of the ogham runes would look more incharacter as a

Re: Semantics of vector operations

2004-01-31 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Gordon Henriksen [mailto:[EMAIL PROTECTED] Austin Hastings wrote: OTOH, Robin's concern for how to code when you're stuck with 7 bit ascii on the boot console of a Sun box remains valid, and *I* sure would rather have a

Re: Semantics of vector operations

2004-01-31 Thread Luke Palmer
I wrote: But I think that literal and are quite nice alternatives for and [1], and if the only think that's holding us back is the bitshift operators, we should kill them -- turn them into functions or something. Cshl and Cshr aren't so bad, are they? Or named operators. As in:

Re: calling functions/class methods

2004-01-30 Thread Luke Palmer
Ph. Marek writes: Hello everybody, first of all please forgive me if I'm using the wrong words - I'm not up to date about the (current) meanings of methods, functions, etc. I read the article http://www.cuj.com/documents/s=8042/cuj0002meyers/ There is stated (short version -

Re: Semantics of vector operations

2004-01-30 Thread Luke Palmer
Scott Walters writes: On 0, Rod Adams [EMAIL PROTECTED] wrote: Also, isn't it a pain to type all these characters when they are not on your keyboard? As a predominately Win2k/XP user in the US, I see all these glyphs just fine,but having to remember Alt+0171 for a is going to get

Re: Semantics of vector operations

2004-01-30 Thread Luke Palmer
Luke Palmer writes: Scott Walters writes: This would lend itself a P5 backport that did overload on its argument, too. If it found that the thing on the right hand side was also overloaded into the same class, it is could use a single iterator on both sides, otherwise it would treat

Re: OO inheritance in a hacker style

2004-01-30 Thread Luke Palmer
Austin Hastings writes: Hmm. The text and examples so far have been about methods and this seems to be about multi-methods. Correct me if I'm wrong ... You're wrong. Consider my example, where via single inheritance we reach a layered list of methods, each of which replaces the previous

Re: Semantics of vector operations

2004-01-30 Thread Luke Palmer
Jonathan Lang writes: Luke Palmer wrote: Scott Walters writes: Would it be possible to subclass things on the fly, returning a specialized object representing the argument that knew how to vectorize when asked to add? Aren't add, subtract, multiply, and so on, implemented

Re: OO inheritance in a hacker style

2004-01-28 Thread Luke Palmer
Dmitry Dorofeev writes: Hi all. Sorry if this idea|question has been discussed or has name which i don't know about. I am not very good at OO but I tried at least 2 times to develop with it though :-) Last time it was Java. The problem is that when i going to use some 'standard' class or

Re: Semantics of vector operations

2004-01-23 Thread Luke Palmer
Larry Wall writes: On Thu, Jan 22, 2004 at 07:03:26PM -0700, Luke Palmer wrote: : Larry Wall writes: : On the other hand, we've renamed all the : other bitwise operators, so maybe we should rename these too: : : +bitwise left shift : +bitwise right

Re: Semantics of vector operations

2004-01-22 Thread Luke Palmer
Austin Hastings writes: How do you handle operator precedence/associativity? That is, $a + $b + $c If you're going to vectorize, and combine, then you'll want to group. I think making the vectorizer a grouper as well kills two birds with one stone. $a + $b + $c vs. $a +

Re: Semantics of vector operations (Damian)

2004-01-22 Thread Luke Palmer
Austin Hastings writes: Sortof. I think Larry was implying that rand returned an infinite list of random numbers in list context. If not, then what he said was wrong, because it would be sick to say that: (1,2,3,4,5) + foo() Calls foo() 5 times. Why would it be sick, and

Re: Semantics of vector operations (Damian)

2004-01-22 Thread Luke Palmer
Luke Palmer writes: (1,2,3,4,5) + foo() # Maybe the same as above? What does infix:+(@list,$scalar) do? Well, what does a list return in scalar context? In the presence of the C comma, it returns 5 for the last thing evaluated. In its absence, it returns 5 for the length

Re: Semantics of vector operations

2004-01-22 Thread Luke Palmer
Larry Wall writes: On Thu, Jan 22, 2004 at 08:08:13PM -0500, Joe Gottman wrote: :I just realized a potential flaw here. Consider the code : $a = 1; : :Will this right-shift the value of $a one bit and assign the result to $a : (the current meaning)? Or will it assign the

Re: Semantics of vector operations

2004-01-21 Thread Luke Palmer
Warning: spacey, tangential semi-argument ahead. Larry Wall writes: On Tue, Jan 20, 2004 at 01:54:33AM -0700, Luke Palmer wrote: : A thought occurred to me. What should this return: : : [1,2,3] + [4,5,6] : : At first glance, one might say [5,7,9]. But is that really the best : way

Re: run-once code

2004-01-14 Thread Luke Palmer
Jonathan Scott Duff writes: On Tue, Jan 13, 2004 at 10:16:48PM -0700, Luke Palmer wrote: So, let's say you have something like: $x = 100_000; my $seen; while $x -- 0 { Don't do that! I had to look at this twice before I decided that perl6 didn't get a new operator

Re: run-once code

2004-01-14 Thread Luke Palmer
David Storrs writes: On Wed, Jan 14, 2004 at 11:57:05AM +, Richard Nuttall wrote: How about $test = sub { if ( some_expensive_lookup_function() = $MAX_RECORDS ) mark_that_we_have_reached_max_records(); $test = sub{}; }; Then call $test()

Re: run-once code

2004-01-13 Thread Luke Palmer
David Storrs writes: Given this code: if ( some_expensive_lookup_function() = $MAX_RECORDS ) { mark_that_we_have_reached_max_records(); return; } After I enter that block once, I never want to evaluate the condition again--I want the code to completely

Re: Archive tarball?

2004-01-08 Thread Luke Palmer
michael.firestone writes: Is there somewhere I can get the entire perl6-language archive in a tarball? I personally don't know, but there could be somewhere. I am trying to work on turning the Apocalypses into story cards at http://p6stories.kwiki.org. It would be helpful to me if I

Re: Roles and Mix-ins?

2004-01-06 Thread Luke Palmer
Joe Gottman writes: - Original Message - From: Luke Palmer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 4:51 AM Subject: [perl] Re: Roles and Mix-ins? David Storrs writes: On Sat, Dec 13, 2003 at 11:12:31AM -0800, Larry Wall wrote: On Sat

Re: Nature of traits

2003-12-21 Thread Luke Palmer
Jonathan Lang writes: I've just been rereading the recent discussions, and I noticed something that I missed the first time: Larry Wall wrote: Traits are not definitional but rather operationally defined in the worst way. That's why traits are renegade roles. They don't play by the

Re: but true

2003-12-19 Thread Luke Palmer
Abhijit A. Mahabal writes: On Fri, 19 Dec 2003, Larry Wall wrote: On Fri, Dec 19, 2003 at 10:23:45AM -0800, Austin Hastings wrote: : Of course, when I do: : : my $x = 0 but (true|false); : : then what happens? That's the problem with making them methods. Any such operational

Re: Object Order of Precedence (Was: Vocabulary)

2003-12-19 Thread Luke Palmer
Larry Wall writes: But if you say something like: class DangerousPet does Pet does Predator { multi method feed ($x) {...} } then DangerousPet::feed is called only when multimethod dispatch would have thrown an exception. Alternately, multi's will probably have some way

Re: This week's summary

2003-12-16 Thread Luke Palmer
Piers Cawley writes: The Perl 6 Summarizer [EMAIL PROTECTED] writes: Vocabulary If you're even vaguely interested in the workings of Perl 6's object system, you need to read the referenced post. Luke Palmer, worrying about people using Object related vocabulary

Re: Object Order of Precedence (Was: Vocabulary)

2003-12-16 Thread Luke Palmer
Jonathan Lang writes: Larry Wall wrote: Well, nothing much really supercedes the class. Even traits have to be requested by the class, and if you have an entirely different metaclass, it's probably declared with a different keyword than Cclass. (But sure, multiple traits will have to

Re: Vocabulary

2003-12-16 Thread Luke Palmer
Michael Lazzaro writes: On Sunday, December 14, 2003, at 06:14 PM, Larry Wall wrote: But the agreement could be implied by silence. If, by the time the entire program is parsed, nobody has said they want to extend an interface, then the interface can be considered closed. In other words,

Re: Vocabulary

2003-12-16 Thread Luke Palmer
Chip Salzenberg writes: According to Jonathan Scott Duff: Those classes that are closed can be opened at run-time and the user pays the penalty then when they try to modify the class [...] The optimization that can be reversed is not the true optimization. While poetic and concise, I

Re: Vocabulary

2003-12-16 Thread Luke Palmer
Michael Lazzaro writes: I agree, it is frequently the case that the question of speed is made critical by people who most assuredly do not need it. But they still decide that way, and I have found that asserting to them that speed is not important has been... well, less than effective. I

Re: Roles and Mix-ins?

2003-12-13 Thread Luke Palmer
Chris Shawmail (E-mail) writes: I'm still digesting the vocabulary thread, but while I do, let me ask a question that's probably crystal clear to everyone else. Do roles act as a form of mix-in, as Ruby modules may, and Objective-C protocols do? Would the following two snippets be at all

Vocabulary

2003-12-12 Thread Luke Palmer
So I'm seeing a lot of inconsistent OO-vocabulary around here, and it makes things pretty hard to understand. So here's how Perl 6 is using said inconsistent terms, AFAIK: - attribute A concrete data member of a class. Used with Chas. - property An out-of-band sticky note

Re: enums and bitenums

2003-12-11 Thread Luke Palmer
Larry Wall writes: Anyway, this all implies that use of a role as a method name defaults to returning whether the type in question matches the subtype. That is, when you say $foo.true it's asking whether the Boolean property fulfills the true constraint. When you say $bar.red

Re: Properties -- distributive, predeclared, post-applied....??

2003-12-05 Thread Luke Palmer
Jonathan Scott Duff writes: On Thu, Dec 04, 2003 at 05:57:52PM -0700, Luke Palmer wrote: Hodges, Paul writes: I'd *like* to be able to predeclare a trait or property to be distributed across any values placed in this array, but only this array. For example, it would be nice if I could

Re: Properties -- distributive, predeclared, post-applied....??

2003-12-04 Thread Luke Palmer
Hodges, Paul writes: How about use Baz; # assume object type my property foo; my @bar of Baz is false but foo; # maybe not what you meant? Definitely not what you meant. Fortunately, the compiler will teach you a thing or two about it: Cfalse is not a trait. But indeed foo would

Re: Properties -- distributive, predeclared, post-applied....??

2003-12-04 Thread Luke Palmer
Paul Hodges writes: Luke Palmer: Something likely more like: my role property_wrap[Property [EMAIL PROTECTED] { method STORE($newval) { SUPER::STORE($newval but [EMAIL PROTECTED]) } } @bar but= property_wrap[false, foo]; ...square brackets? ...roles can have

Re: OP [was: Re: Properties]

2003-12-02 Thread Luke Palmer
Michael Lazzaro writes: On Monday, December 1, 2003, at 01:05 PM, Hodges, Paul wrote: Didn't know is would do that. Good to know! And in my meager defense, I did reference MikeL's operator synopsis as of 3/25/03, which said ^[op] might be a synonym for or (Sorry, no fancy chars here.

Re: OP [was: Re: Properties]

2003-12-02 Thread Luke Palmer
Luke Palmer writes: And as far as I know, and are exactly equivalent to and in all cases. By which I mean and , of course. :-/ (mutt is kind of a pain in this area) Luke

Re: Properties

2003-12-01 Thread Luke Palmer
Hodges, Paul writes: I assume you're setting the the value, so I think I understand it, but how about sub setvals ($o, [EMAIL PROTECTED]) { $o but= $_; $o.$_ = true; } Though I'm still iffy about that $o.$_ business. I think $_(true) is better.

Re: Properties

2003-11-29 Thread Luke Palmer
Paul Hodges writes: Larry Wall writes: Perl 5 didn't allow exportation of lexicals because typeglobs only dealt with package variables, not lexical variables. In Perl 6 we'll be able to alias both lexicals and package variables. That implies that a lexically scoped name can be exported,

Properties

2003-11-27 Thread Luke Palmer
Here's a series of questions/confirmation requests about how properties work (but specifically run-time properties, not traits): Use Cbut to assign a property to a Ivalue: $a = $b but foo; # $a has property foo, $b does not Properties are just out-of-band methods: if $x.foo {

Re: Control flow variables

2003-11-25 Thread Luke Palmer
Piers Cawley writes: Simon Cozens [EMAIL PROTECTED] writes: But it isn't, and I don't know why it isn't, and so we end up spending loads of time discussing things that can be punted out to modules. Designing Perl 6 is hard enough; let's not try to fill CP6AN at the same time. But the

Re: The C Comma

2003-11-25 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Adam Turoff [mailto:[EMAIL PROTECTED] On Tue, Nov 25, 2003 at 01:03:19PM +1100, Damian Conway wrote: Schwern observed: Perhaps this is yet another argument for insisting on: while do {$n++; $foo $bar}

Re: 'catch' statement modifier

2003-11-24 Thread Luke Palmer
Damian Conway writes: Hmm. I think I may have missed Luke's point. Which was (presumably): what if C$opus.write_to_file($file); validly returns Cundef? In which case I think we just fall back to: try{$opus.write_to_file($file); CATCH {die Couldn't write to $file: $!}}

Re: Parsing macros (was: Control flow variables)

2003-11-20 Thread Luke Palmer
Jonathan Lang writes: Larry Wall wrote: So far we've only allowed is parsed on the macro itself, not on individual arguments. Still, that's an interesting idea. Forgive me if this has already been addressed, but this could have some useful applications: So far, everything I've read

Re: s/// in string context should return the string

2003-11-20 Thread Luke Palmer
Smylers writes: Piers Cawley writes: Stphane Payrard [EMAIL PROTECTED] writes: s/// in string context should return the string after substituion. Surely it should return the string after substitution, but with an appropriate 'but true' or 'but false' property depending on

Re: Control flow variables

2003-11-20 Thread Luke Palmer
Jonathan Scott Duff writes: On Wed, Nov 19, 2003 at 12:49:21PM -0800, Larry Wall wrote: Sorry, I wasn't being very clear. It wouldn't be logically attached to the outside of the for, but to the inside of the confer, or whatever: @foo = gather { for @a - $x { pick $x if

Re: Control flow variables

2003-11-19 Thread Luke Palmer
Piers Cawley writes: All of which means you can wrap it up in a macro and prove Simon's point about what's syntax and what's CP6AN: macro unless_all( Block test is parsed /perl.expression/, Block consequence, [EMAIL PROTECTED] ) { my $guard = Object.new;

Re: Control flow variables

2003-11-19 Thread Luke Palmer
Gordon Henriksen writes: Larry Wall wrote: On Tue, Nov 18, 2003 at 06:28:59PM -0500, Gordon Henriksen wrote: my @b = for @a - $_ { ... } That will be a syntax error. Generators are too mind-stretching to inflict on novices [...] I making the point that

Re: syntax: multi vs. method

2003-11-18 Thread Luke Palmer
Jonathan Lang writes: My apologies for the break in the chain of responses; I lost your reply before I could reply to it, and had to retrieve it from the list archives. Luke Palmer wrote: Well, multi is no longer a declarator in its own right, but rather a modifier. Synopsis Exegesis

Control flow variables

2003-11-18 Thread Luke Palmer
I was reading the most recent article on perl.com, and a code segment reminded me of something I see rather often in code that I don't like. Here's the code, Perl6ized: ... ; my $is_ok = 1; for 0..6 - $t { if abs(@new[$t] - @new[$t+1]) 3 { $is_ok = 0;

Re: Control flow variables

2003-11-18 Thread Luke Palmer
Simon Cozens writes: [EMAIL PROTECTED] (Luke Palmer) writes: I was reading the most recent article on perl.com, and a code segment reminded me of something I see rather often in code that I don't like. The code in question got me thinking too; I wanted to find a cleaner way to write

Re: Control flow variables

2003-11-18 Thread Luke Palmer
Austin Hastings writes: Luke Palmer wrote: I was reading the most recent article on perl.com, and a code segment reminded me of something I see rather often in code that I don't like. Here's the code, Perl6ized: ... ; my $is_ok = 1; for 0..6 - $t { if abs

Re: Control flow variables

2003-11-18 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Michael Lazzaro [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 2:06 PM To: [EMAIL PROTECTED] Subject: Re: Control flow variables On Tuesday, November 18, 2003, at 06:38 AM, Simon Cozens wrote: Given that

Re: Control flow variables

2003-11-18 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Michael Lazzaro [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 2:06 PM To: [EMAIL PROTECTED] Subject: Re: Control flow variables On Tuesday, November 18, 2003, at 06:38 AM, Simon Cozens wrote: Given that

Re: Control flow variables

2003-11-18 Thread Luke Palmer
Austin Hastings writes: From: Luke Palmer [mailto:[EMAIL PROTECTED] Austin Hastings writes: From: Michael Lazzaro [mailto:[EMAIL PROTECTED] Would that then imply that sub blah { ... # 1 return if $a;# 2

Re: syntax: multi vs. method

2003-11-18 Thread Luke Palmer
Larry Wall writes: If you write: multi method add( $self: Foo $foo, Bar $bar ); then there are multiple add methods in the current class. Note the invocant is not optional in this case. Also, there's an implied second colon after $bar, indicating the end of the arguments to be

Re: syntax: multi vs. method

2003-11-10 Thread Luke Palmer
Jonathan Lang writes: To make method work as an alternative for multi in every case, the only changes that you'd need to make would be to allow more than one invocant to be explicitly specified in the method syntax, and to allow the positional portion of the parameter list to optionally be

Re: Vector dot Vectoria

2003-11-05 Thread Luke Palmer
Hi Doug, Doug McNutt writes: The first source of discussion was around whether there is any consistent meaning to array operations. The source of this was that some felt that other people may want C* to mean something other than element-wise multiplication by default (e.g. matrix inner

Nested modules

2003-11-02 Thread Luke Palmer
So, we can have :: in names, but that doesn't represent any inherent relationship between the module before the :: and the one after. I think this is an important thing to keep. However, will it be possible to, for example, do: module Foo; module Bar { ... } And refer to the inner

Re: Some questions about currying

2003-10-29 Thread Luke Palmer
Joe Gottman writes: I just reread the section of A6 about currying, and I have several questions about it. 1) Suppose I have a function like the following: sub foo($param, @param) {...} where the parameter names differ only by their sigils. Is it legal for me

Re: Alternately named arguments

2003-10-25 Thread Luke Palmer
David Storrs writes: On Fri, Oct 24, 2003 at 12:57:18AM -0600, Luke Palmer wrote: Presuming you can do: (who = $name, why = $reason) := (why = $because, who = me); (from A6) Does that imply that you can do: sub routine (name = $nombre, date = $fecha

Alternately named arguments

2003-10-24 Thread Luke Palmer
Presuming you can do: (who = $name, why = $reason) := (why = $because, who = me); (from A6) Does that imply that you can do: sub routine (name = $nombre, date = $fecha) {...} Anyway, I just realized that this is finally an elegant way to do multiple, unordered return values:

Re: How to create a function that returns nothing

2003-10-14 Thread Luke Palmer
Joe Gottman writes: How do you declare a function that doesn't return anything? For instance, a C++ swap function might be declared template class X void swap(X x, X y); It would be nice to declare the corresponding Perl6 function as sub swap ($x is rw, $y is rw) returns nothing

Re: More fun with argument passing

2003-10-05 Thread Luke Palmer
Steve Fink writes: Ok, I'm back to argument passing. I'm starting a new thread because I'm lazy and I have to scroll back too far in my mailer to see the old arg passing thread. :-) And yes, most of this message should also be on -languages. Which it now is. Although, there are some

Re: The Block Returns

2003-10-03 Thread Luke Palmer
Austin Hastings writes: -Original Message- From: Luke Palmer [mailto:[EMAIL PROTECTED] But this is already supported, in its most powerful form: wrap block: { call; other_stuff() } Hmm, no. That does a call, which presumes a return, which burns up who-knows-how-many

Re: The Block Returns

2003-10-03 Thread Luke Palmer
Simon Cozens writes: [EMAIL PROTECTED] (Austin Hastings) writes: Frankly, I think I'd rather see: Some nits: macro atexit($code) is parsed(/{ Perl6.line* }/) { Probably just macro atexit($code) is parsed(/Perl6.block/) { $block .= $code; $block _= $code;

The Block Returns

2003-10-02 Thread Luke Palmer
So, I must ask, what does this do: sub foo() { return my $self = { print Block; return $self; } } my $block = foo; print Main; $block(); print End; That is, the block returns from a function that's not currently executing.

Re: The Block Returns

2003-10-02 Thread Luke Palmer
Stefan Lidman writes: So, I must ask, what does this do: sub foo() { return my $self = { print Block; return $self; } } my $block = foo; # = sub {print Block; return $self;} A6: One obvious difference is that the

Re: The Block Returns

2003-10-02 Thread Luke Palmer
Jeff Clites writes: Speaking to the practical side, I have written code that has to disentangle itself from the failure of a complex startup sequence. I'd love to be able to build a dynamic exit sequence. (In fact, being able to do Cblock .= { more_stuff(); };/C is way up on my list...)

Re: Pondering parameterized operators

2003-09-28 Thread Luke Palmer
Simon Cozens writes: [EMAIL PROTECTED] (Luke Palmer) writes: [$lhs, $rhs]\220\215.\235\237compile; What's that in old money? Eep. I thought I had mutt's utf-8 working, but apparently not. Does anyone who knows about these things want to mail me instructions, or something? That'd be nice

Re: Pondering parameterized operators

2003-09-27 Thread Luke Palmer
Cool stuff. In my usual pedantic sort of way, I'll go through the message and fix everything you said. For educational purposes only, of course :-) Eirik Berg Hanssen writes: Luke Palmer [EMAIL PROTECTED] writes: Hmm, since we're requiring no whitespace between a variable and it's

Re: Pondering parameterized operators

2003-09-26 Thread Luke Palmer
Austin Hastings writes: How can I conveniently pass an extra parameter to a historically binary operator? I see a few possibilities. The first, call it like a function: if infix:eqn(Dough, Douglas, n = 4) {...} Or, you could use the adverbial modifier Cwhere (well, not officially yet,

Re: Next Apocalypse

2003-09-15 Thread Luke Palmer
Piers Cawley writes: Luke Palmer [EMAIL PROTECTED] writes: Also, the standard library, however large or small that will be, will definitely be mutable at runtime. There'll be none of that Java you can't subclass String, because we think you shouldn't crap. Great. But will it also

Re: Next Apocalypse

2003-09-15 Thread Luke Palmer
Nicholas Clark writes: On Mon, Sep 15, 2003 at 11:19:22AM -0400, Dan Sugalski wrote: Changing a function from pure to impure, adding an overloaded operator, or changing the core structure of a class can all result in code that needs regeneration. That's no big deal for code you haven't

Constant array or array of constant?

2003-09-13 Thread Luke Palmer
I was reading through E6 again, and noticed something a little troubling: sub part ([EMAIL PROTECTED] is rw) {...} Well, Iof course @_ Cis rw! Otherwise we wouldn't be able to Cshift things off of it. What was actually meant, I presume, is: sub part ([EMAIL PROTECTED] of (Object is

Re: Next Apocalypse

2003-09-13 Thread Luke Palmer
Jonadab the Unsightly One writes: Dan Sugalski [EMAIL PROTECTED] writes: Next Apocalypse is objects, and that'll take time. Objects are *worth* more time than a lot of the other topics. Arguably, they're just as important as subroutines, in a modern language. Speaking of objects...

Re: Macro arguments themselves

2003-09-12 Thread Luke Palmer
Alex Burr writes: In theory you could write one as a perl6 macro, although it would be more convenient if there was someway of obtaining the syntax tree of a previously defined function other than quoting it (unless I've missed that?). There is a large class of cool optimizations possible

Re: Dispatch on context

2003-09-08 Thread Luke Palmer
Piers Cawley writes: So, I was wondering about how to do multidispatch based on the context in which something is called, which leads me to wonder if there's going to be a way of reifying calling context so I could write: method whatever($arg1, $arg2) { my multi whatever ($self,

Re: Junctions Set Theory

2003-09-02 Thread Luke Palmer
Wow, what an old thread... Jonadab the Unsightly One writes: "Abhijit A. Mahabal" [EMAIL PROTECTED] writes: On the other hand, if you wanted to say "true for all except exactly one value, I can't think of a way. Easy. The following two statements are

Re: PerlHash.get_pmc_keyed of non existing key

2003-08-23 Thread Luke Palmer
Gordon Henriksen writes: Taking a thread from Perl 6 Internals. Will Perl 6 support this behavior? $ perl 'EOT' my @ary; my $ref = \$ary[0]; $$ref = value; print '$ary[0] : ', $ary[0], \n; EOT $ary[0] : value

Re: Perl 6's for() signature

2003-08-14 Thread Luke Palmer
Jonadab The Unsightly One wrote: John Siracusa [EMAIL PROTECTED] writes: Did this ever get resolved to anyone's satisfaction? While reading EX6, I found myself wonder exactly what for() would look like in Perl 6 code... A for loop[1] is basically syntax sugar for a while

<    2   3   4   5   6   7   8   9   10   >