Re: n-dim matrices

2000-08-31 Thread David L. Nicol
Christian Soeller wrote: No, at least 18. One more piece of semantics that would be appreciated is optional omission of trailing dimensions in slices, e.g. for a 3-dim @a: @a[0:1] == @a[0:1;] == @a[0:1;;] Christian this would be the * in my proposal made in mail w/ subject "a

Re: a syntax derived from constant-time hash-based n-dim matrices in perl 5

2000-08-31 Thread David L. Nicol
Nathan Wiger wrote: "David L. Nicol" wrote: @a["$i $j $k","$a $y $z"] # two points in DN n-dim syntax One problem that immediately jumps out at me is how to do this: @a[[@x], [@y]]; That is, dynamically get your indices. The above seems ok when you know them in

Re: n-dim matrices

2000-08-31 Thread Jeremy Howard
Christian Soeller wrote: No, at least 18. One more piece of semantics that would be appreciated is optional omission of trailing dimensions in slices, e.g. for a 3-dim @a: @a[0:1] == @a[0:1;] == @a[0:1;;] I'd rather see the ';' be required, but the '(0..)' not be required, so you could

Re: RFC 177 (v1) A Natural Syntax Extension For Chained References

2000-08-31 Thread Buddha Buck
At 05:35 PM 8/31/00 +, David L. Nicol wrote: Buddha Buck wrote: The array syntax would also be useful in multi-dimensional arrays. That is if multi-dimensional arrays are implemented as lists-of-lists, which they might not be. Even if they aren't implemented as lol, they may

Re: Designing Perl 6 data crunching (was Re: n-dim matrices)

2000-08-31 Thread Jeremy Howard
Christian Soeller wrote: There might still be a need for something for those people who need FFTs and work on really large blocks of data. The hope would be that a perl6 PDL would fill such a gap and be more perlish than it is now. But again concrete syntax ideas are needed along with a clear

The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Bart Lateur
Likely this should be an RFC. I'm too lazy to write it in that format right now, but I want to send this thing out before it slips my mind again. Somebody else may pick it up, if he or she wants it. If not, I'll eventually may have to do it myself. The articial distinction between do

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Peter Scott
At 11:38 AM 8/31/00 +0200, Bart Lateur wrote: The articial distinction between do BLOCK while condition; and EXPR while condition; should go, because the former is nothing but a subcase of the latter. Currently, the former executes the do BLOCK at least once, while the

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Nathan Torkington
I want last, next, etc. to magically work where I want them to: do { last if /booger/; ... } while ( ... ); Nat

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Tom Christiansen
I want last, next, etc. to magically work where I want them to: do { last if /booger/; ... } while ( ... ); Special cased for postfix modifiers, or generalized? If so, what's the return value? $x = TERM OP do { BLOCK } OP TERM; Actually, these are all pretty similar in

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Bart Lateur
On Thu, 31 Aug 2000 11:21:26 -0600, Tom Christiansen wrote: One could argue that do{} should take return so it might have a value, but this will definitely annoy the C programmers. So what. "Annoying" would be to have a situation that is *less* powerful in Perl than in C, not *more*. Oh, and

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Christopher J. Madsen
Tom Christiansen writes: One could argue that do{} should take return so it might have a value, but this will definitely annoy the C programmers. So what. So what is that it *already* annoys us, which is *why* we would like to last out of a do. Perhaps you should be able to last

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Jonathan Scott Duff
On Thu, Aug 31, 2000 at 01:26:26PM -0500, Christopher J. Madsen wrote: I too would like to see last, next, redo work with do loops. *Only* do loops or do blocks in general? And what should they do? do { ... last; ... }; # exit the block immediately do { ... next;

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Peter Scott
At 11:21 AM 8/31/00 -0600, Tom Christiansen wrote: I want last, next, etc. to magically work where I want them to: I too want last to work in do loops. do { last if /booger/; ... } while ( ... ); Special cased for postfix modifiers, or generalized? If so, what's the return

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Christopher J. Madsen
Peter Scott writes: I dunno, maybe a last in a do block whose value is used by something should be a syntax error. We're talking about code like $x += do { $y = get_num; last if $y == 99; $y } while defined $y; right? *Shudder* Yes, but we're also talking about code like

Re: RFC 178 (v1) Lightweight Threads

2000-08-31 Thread Steven W McDougall
The more interesting case is this: #!/my/path/to/perl sub foo_generator { my $a = shift; sub { print $a++ } } my $foo = foo_generator(1); $foo-(); Thread-new($foo); Is $a shared between threads or not? $a is shared between threads. The anonymous subroutine is a

Re: The distinction between do BLOCK while COND and EXPR while COND should go

2000-08-31 Thread Tom Christiansen
Tom Christiansen writes: However, I really don't want to see 'return' become a kind of 'last' for do{}. How would I return from a subroutine from within a do loop? You already can't do that (as it were) from within an eval. Yes, but 'eval' has the semantics "run this code but don't let

RFC 185 (v1) Thread Programming Model

2000-08-31 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Thread Programming Model =head1 VERSION Maintainer: Steven McDougall [EMAIL PROTECTED] Date: 31 Aug 2000 Mailing List: [EMAIL PROTECTED] Version: 1 Number: 185 Status: Developing =head1

Re: RFC 185 (v1) Thread Programming Model

2000-08-31 Thread Michael Maraist
use Thread; $thread = new Thread \func , @args; $thread = new Thread sub { ... }, @args; async { ... }; $result = join $thread; $thread = this Thread; @threads = all Thread; $thread1 == $thread2 and ... yield(); critical { ... }; # one thread at

Re: RFC 185 (v1) Thread Programming Model

2000-08-31 Thread James Mastros
$thread = new Thread \func , @args; $thread = new Thread sub { ... }, @args; async { ... }; $result = join $thread; critical { ... }; # one thread at a time in this block =item Casync BLOCK Executes BLOCK in a separate thread. Syntactically, Casync BLOCK works

Re: RFC 120 (v2) Implicit counter in for statements, possibly$#.

2000-08-31 Thread David L. Nicol
Chaim Frenkel wrote: This is making the index variable into an a wrapper object. No it isn't. Or at least it doesn't have to. Often there is a need to find the key an object was found in a container. More often in hashes than in arrays. And I think this discussion belongs in -data.

RFC 181 (v1) Formats out of core / New format syntax

2000-08-31 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Formats out of core / New format syntax =head1 VERSION Maintainer: Nathan Wiger [EMAIL PROTECTED] Date: 30 Aug 2000 Mailing List: [EMAIL PROTECTED] Version: 1 Number: 181 Status:

Re: RFC 39 (v3) Perl should have a print operator

2000-08-31 Thread Tom Christiansen
Perl supplies an operator for line input - angle brackets. This is no analogous operator for output. I propose "inverse angle brackets": "Print this line.\n"; Perl already *has* a print operator: "print". :-) The problem with what you have there is that it hides the act of output within

Re: RFC 181 (v1) Formats out of core / New format syntax

2000-08-31 Thread Philip Newton
On 31 Aug 2000, Perl6 RFC Librarian wrote: my format $FILE_FORMAT = @: @ $name, $ssn . Then this is even less different and scary. Get rid of that Cmy and it's Perl 5. s/that Cmy/that Cmy and the dollar sign/; Cheers, Philip -- Philip Newton [EMAIL PROTECTED]

Re: RFC 110 (v3) counting matches

2000-08-31 Thread Mark-Jason Dominus
(mystery: how can filling in $ be a lot slower than filling in $1?) It isn't. It's the same. $1 might even be more expensive than $. It appears that many people don't understand the problem with $. I will try to explain. Maintaining the information required by $1 or $ slows down the

Re: RFC 110 (v3) counting matches

2000-08-31 Thread Joe McMahon
Jonathan Scott Duff wrote: How about something like this? $re = qr/(\d\d)-(\d\d)-(\d\d)/g; $re-onmatch_callback(push @list, makedate(^0,^1,^2)); $string =~ $re; It's not bad, but it loses one thing that I was trying to keep from the SNOBOL model. If you have (again,

Re: RFC 72 (v2) The regexp engine should go backward as well as forward.

2000-08-31 Thread Mike Mulligan
From: "Peter Heslin" [EMAIL PROTECTED] Sent: Thursday, August 31, 2000 10:51 PM I would propose that your version of the syntax might also function in the middle of a regexp: /GHI(?`=DEF)JKL(?`=^ABC)MNO/ would match the start of the alphabet (fixed-length example used for simplicity). That's

Re: RFC 132 (v3) Subroutines should be able to return an lvalue

2000-08-31 Thread Nathan Wiger
Johan Vromans wrote: You can do that easily: sub param { my ($self, @rest) = @_; $self-{aval} = @rest if @rest; # See note lreturn $self-{aval}; } I've been thinking about this for a couple days. The only problem I see is that this doesn't allow me to do this:

Re: RFC 132 (v3) Subroutines should be able to return an lvalue

2000-08-31 Thread Damian Conway
I've been thinking about this for a couple days. The only problem I see is that this doesn't allow me to do this: $oldpath = $tree-path('L','R') = 'R'; @document = ($title, $junk, $r-xml_extract) = STDIN; I would still have to use some yeechy combination with

Re: {....} if condidion

2000-08-31 Thread Nathan Wiger
You don't want do have a postfix { ... } if condition. It's evil I don't see how this is any worse than a postfix while() do { asd; asdf; asdf; asf; asdf; asdf; sad; fasdfa; sdf; asdf; asdf;

Re: {....} if condidion

2000-08-31 Thread Tom Christiansen
You don't want do have a postfix { ... } if condition. It's evil I don't see how this is any worse than a postfix while() Look closer: do { ... } while does not require the reader to scan down to find out the condition *BEFORE* the loop is entered. With an if, it does. Because it hides

Re: RFC 179 (v1) More functions from set theory to manipulate arrays

2000-08-31 Thread Tom Christiansen
Which kind of "difference"?

Re: the C JIT

2000-08-31 Thread David Corbin
"David L. Nicol" wrote: Dan Sugalski wrote: I do want to have a set of C/XS/whatever sources as part of the test suite as well--right now perl's test suite only tests the language, and I think we should also test the HLL interface we present, as it's just as important in some ways.

Re: {....} if condidion

2000-08-31 Thread Decklin Foster
Tom Christiansen writes: Look closer: do { ... } while does not require the reader to scan down to find out the condition *BEFORE* the loop is entered. With an if, it does. I believe what he's saying is that do { ... } requires the reader to scan down far enough to see if there is a while

Re: Proposal: use Perl5

2000-08-31 Thread Jerrad Pierce
Since everyone seems intent on breaking backward compatibility I don't think this is at all true, but I also don't think the overall you seem to have ignored the paranthetical clause idea of a Perl5 module is necessarily a bad one. However, my hope would be that we do Perl 6 smoothly enough and

Re: {....} if condidion

2000-08-31 Thread Nathan Wiger
We already have a trailing if statement, so this argument is edgy, at best. Your brain/eye can look one statement. It's evil and wrong to make it look infinite statements forward. How can you pretend those are the same? Well, I think trailing statements already have only limited

Re: Proposal: use Perl5

2000-08-31 Thread Nathan Wiger
Jerrad Pierce wrote: That would be my hope too, but as I mentioned, it is seeming somewhat unlikely. I don't think so. There's lots of proposals out there right now, but only a very few actually break backwards compatibility. Plus, Larry's not going to make Perl 6 look like, as Tom would say,

Re: RFC 179 (v1) More functions from set theory to manipulate arrays

2000-08-31 Thread Michael Maraist
More functions from set theory to manipulate arrays I'd like to use these functions in this way : @c = union (@a, @b); # wich is different from @c = (@a, @b) because union do not duplicate same elements @c = intersection (@a, @b); @c = diff(@a, @b); Elements of this are found in

Re: RFC 139 (v1) Allow Calling Any Function With A Syntax Like s///

2000-08-31 Thread Nathan Wiger
John Porter wrote: Not familiar with indirect object notation? Insulting non-argument. I'm not replying to it. Who was it that suggested changing the m// operator to the match() function, and the s/// operator to the subst() function? That would be me. I suppose I could have proposed

Re: the C JIT

2000-08-31 Thread Sam Tregar
On Thu, 31 Aug 2000, David L. Nicol wrote: Perl looks, and AFAIK has always looked, like "C plus lune noise" to many people. I think Perl looks like "C plus moon noise" to former C programmers. I imagine some people see it and think "Csh plus Awk noise". Perl is a lot more than

RE: the C JIT

2000-08-31 Thread David Olbersen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 A Perl frontend to GCC would make my life wonderful. Who would I talk to about that? I'm not about to pretend that I have any idea how to do that. - --Dave - - -Original Message- - - From: Sam Tregar [mailto:[EMAIL PROTECTED]] - - Sent:

Re: Proposal: chop() dropped

2000-08-31 Thread Nathan Torkington
Eric Roode writes: Useful functions all, no doubt. But I would lobby heavily for a new set of names -- ones that can be remembered! Quick -- which trims leading spaces, champ, chump, or chimp? My favourite: chafe(). Nat

Re: RFC 110 (v3) counting matches

2000-08-31 Thread Steve Fink
[redirected to perl6-language] Tom Christiansen wrote: Note the difference between my $var = func(); and my($var) = func(); Those are completely different in that they call func() in scalar and list contexts. Why? Because of hte presence or absence of (), of course.

Re: Proposal: chop() dropped

2000-08-31 Thread Dan Zetterstrom
On Thu, 31 Aug 2000 19:59:31 +0200, you wrotc: tr/\w//dlt # Trim all leading trailing whitespace from $_ Eh, scratch that. Too much caffeine i guess. tr/\n\r\t //dlt; # Trim some whitespace. -DZ -- Tell me your dreams and I will crush them.

Re: Proposal: chop() dropped

2000-08-31 Thread Jonathan Scott Duff
On Thu, Aug 31, 2000 at 07:59:31PM +0200, Dan Zetterstrom wrote: Why not use the "function" we already got, tr? Something like: tr///l # Translate only _l_eading characters matching. tr///t # Translate only _t_railing characters matching. With "Only leading" I mean translate

Re: Proposal: chop() dropped

2000-08-31 Thread Tom Christiansen
tr///l # Translate only _l_eading characters matching. tr///t # Translate only _t_railing characters matching. With "Only leading" I mean translate from start/end until you find a character not matching. Then you can do nifty things such as: tr/\w//dlt # Trim all leading trailing

Re: Proposal: chop() dropped

2000-08-31 Thread Tom Christiansen
How would you do: # Writer insists on blank line between paragraphs, first line indented. # Publisher insists on one paragraph/line, first word ALL CAPS. Step 1: Fire the lame publisher. I'm serious. It's amazing what people tolerate. Some things aren't worth the pane. { local $/ = "";

Re: Proposal: chop() dropped

2000-08-31 Thread Eric Roode
TomC wrote: In general, getting folks to write s/^\s+//s; s/\s+$//s; # XXX: \z is a *good* think. Why? Removing leading/trailing whitespace is a tremendously frequently- performed task. Perl gives you -l on the command line to strip newlines on input and add them on output, simply

Re: Ideas that need RFCs?

2000-08-31 Thread Ken Fox
Dan Sugalski wrote: I expect we'd want to have some sort of heavy-duty regex optimizer, then, to detect common prefixes and subexpressions and suchlike things, otherwise we end up with a rather monstrous alternation sequence... We need a regex merge function too -- then we could write macros

Re: RFC 139 (v1) Allow Calling Any Function With A Syntax Like s///

2000-08-31 Thread John Porter
Nathan Wiger wrote: Well, it just stacks arguments on the end, even with open-ended prototypes: @a =~ my_user_sub($arg); # @a = my_user_sub($arg, @a) What it means is, you can't prototype the thingy that could be expected on the LHS of the =~, when function is open-ended, because in

Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar)

2000-08-31 Thread Bart Lateur
On Fri, 1 Sep 2000 07:27:24 +1100 (EST), Damian Conway wrote: And has anyone pointed out that Clist is just: sub list {@_} Um no. I would expect it to be sub list { @_[0..$#_] } It's too early in the morning. The subtlety here escapes me. It's the

Re: Proposal: chop() dropped

2000-08-31 Thread Bart Lateur
On Thu, 31 Aug 2000 13:36:10 -0600, Tom Christiansen wrote: I'm not arguing in favor of the tr/// hack specifically, but gosh, wouldn't it be nice if there were a thwack() builtin that stripped leading and trailing spaces? No. People should learn intrinsic mechanisms with which they can

Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar)

2000-08-31 Thread Peter Scott
At 11:46 PM 8/31/00 +0200, Bart Lateur wrote: On Fri, 1 Sep 2000 07:27:24 +1100 (EST), Damian Conway wrote: And has anyone pointed out that Clist is just: sub list {@_} Um no. I would expect it to be sub list { @_[0..$#_] } It's too early in the morning.

Re: the C JIT

2000-08-31 Thread David L. Nicol
Sam Tregar wrote: On Thu, 31 Aug 2000, David L. Nicol wrote: run-time efficiency C doesn't get run-time efficiency from its syntax, so we can't really expect to get anything here. It gets it from its compilation architecture. If you want to build a Perl frontend for GCC I think

Re: the C JIT

2000-08-31 Thread Nathan Wiger
"David L. Nicol" wrote: my dog $spot; to dog spot; If we only allow this where enough info is available to allocate dog-sized pieces of memory directly, Perl can blaze through the code that deals with dogs. I don't see what barewords gain us here. Who says that my

RFC 184 (v1) Perl should support an interactive mode.

2000-08-31 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Perl should support an interactive mode. =head1 VERSION Maintainer: Ariel Scolnicov [EMAIL PROTECTED] Date: 31 Aug 2000 Mailing List: [EMAIL PROTECTED] Version: 1 Number: 184 Status: Developing

Re: the C JIT

2000-08-31 Thread Sam Tregar
On Thu, 31 Aug 2000, David L. Nicol wrote: We're talking about making a faster Perl. C's syntax requires enough clarity to compile to something quick. it is a very short hop from my dog $spot; to dog spot; What about the second version would result in faster execution? Do

Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar)

2000-08-31 Thread Damian Conway
This is the kind of thing that keeps Perl instructors in business... And Perl out of businesses :-( More than anything I think the inability to write Csub list DWIMishly argues that we need it built-in. But we also need a *very* careful design of the semantics. Damian

Re: RFC 184 (v1) Perl should support an interactive mode.

2000-08-31 Thread Michael Maraist
I'll be brief because windows just crashed on me. First, the current debugger allows multi-lines if you use "\" at the end of the line ( a la C ). Second, lexically scoped variables will dissapear on subsequent debugger lines since their scope is wrapped in an eval. For the most part, the

Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar)

2000-08-31 Thread Tom Christiansen
This is the kind of thing that keeps Perl instructors in business... And Perl out of businesses :-( More than anything I think the inability to write Csub list DWIMishly argues that we need it built-in. But we also need a *very* careful design of the semantics. I'd like to see from this

RFC 179 (v1) More functions from set theory to manipulate arrays

2000-08-31 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE More functions from set theory to manipulate arrays =head1 VERSION Maintainer: Gael Pegliasco [EMAIL PROTECTED] Date: 30 August 2000 Mailing List: [EMAIL PROTECTED] Version: 1 Number: 179 =head1

Re: RFC 177 (v1) A Natural Syntax Extension For Chained References

2000-08-31 Thread David L. Nicol
Perl6 RFC Librarian wrote: arsenal. The constructs are: $ref-[[LIST]] $ref-{{LIST}} The proposed respective meanings: $ref-[$elem[0]]-[$elem[1]}-[...]-[$elem[-1]] $ref-{$elem[0]}-{$elem[1]}-{...}-{$elem[-1]} why not just use single braces for

Re: RFC 177 (v1) A Natural Syntax Extension For Chained References

2000-08-31 Thread Buddha Buck
At 05:35 PM 8/31/00 +, David L. Nicol wrote: Buddha Buck wrote: The array syntax would also be useful in multi-dimensional arrays. That is if multi-dimensional arrays are implemented as lists-of-lists, which they might not be. Even if they aren't implemented as lol, they may

Re: RFC 177 (v1) A Natural Syntax Extension For ChainedReferences

2000-08-31 Thread David L. Nicol
Peter Scott wrote: Having the indices in one place saves a lot of characters. Compare $r-{{qw(a b c d e f g h)}} versus $r-{a}-{b}-{c}-{d}-{e}-{f}-{g}-{h} But I would compare it to $r-{a}{b}{c}{d}{e}{f}{g}{h} which is only one character longer than

Re: RFC 177 (v1) A Natural Syntax Extension For Chained References

2000-08-31 Thread Jeremy Howard
Buddha Buck wrote: At 05:35 PM 8/31/00 +, David L. Nicol wrote: Buddha Buck wrote: The array syntax would also be useful in multi-dimensional arrays. That is if multi-dimensional arrays are implemented as lists-of-lists, which they might not be. Even if they aren't