Re: %_ - is it available for use?

2003-08-02 Thread Michael G Schwern
On Sat, Aug 02, 2003 at 08:16:19PM -0700, Larry Wall wrote: > On Sat, Aug 02, 2003 at 04:33:19PM -0700, Michael G Schwern wrote: > : I'm not making an argument against %_, just noting that *_ is used > : opportunisticly and you will break a few programs. > > Not necessarily. If Perl 6 were to us

Re: Macro arguments themselves

2003-08-02 Thread Luke Palmer
> Larry Wall wrote: > [snip] > > Nope. $x and $p are syntax trees. > > > > Macros are passed syntax trees as arguments, but return coderefs? > > That's... odd. > > I would expect that a macro would be expected to *return* a syntax > tree... which could then undergo (more) macro-expansion. Ke

hq9+ update

2003-08-02 Thread David H. Adler
Thanks to schwern, a couple of glitches in my interpreter have (I think) been fixed. updated version now replacing old version at http://www.thetasigma.com/parrot/hq9p.pasm dha -- David H. Adler - <[EMAIL PROTECTED]> - http://www.panix.com/~dha/ "Perl Porters, Inc. today announced the release o

Re: Macro question

2003-08-02 Thread Larry Wall
On Sat, Aug 02, 2003 at 10:29:05PM -0500, Abhijit A. Mahabal wrote: : This is a rather silly question: : : The code: : macro foo() { return {my $x = 7} } : foo; : print $x; : : is equivalent to which of the following? : : {my $x = 7} : print $x; : : or : : m

Re: grep EXPR, LIST

2003-08-02 Thread Larry Wall
On Sat, Aug 02, 2003 at 09:53:07PM -0600, John Williams wrote: : Perl5 map and grep allow the first argument to be an expression which is : passed to the function instead of being evaluated. (Sort of a bare block.) : What does the signature for this look like? Is it done with "is parsed" : tricks,

grep EXPR, LIST

2003-08-02 Thread John Williams
Perl5 map and grep allow the first argument to be an expression which is passed to the function instead of being evaluated. (Sort of a bare block.) What does the signature for this look like? Is it done with "is parsed" tricks, or will perl6 require the "map BLOCK LIST" syntax? I was recently bit

Re: Macro arguments themselves

2003-08-02 Thread Benjamin Goldberg
Larry Wall wrote: [snip] > Nope. $x and $p are syntax trees. Macros are passed syntax trees as arguments, but return coderefs? That's... odd. I would expect that a macro would be expected to *return* a syntax tree... which could then undergo (more) macro-expansion. Sortof like how in lisp, a

Re: E6 (sort of): All levels of complex data structs marked ro?

2003-08-02 Thread Larry Wall
On Sat, Aug 02, 2003 at 07:10:46PM -0600, Luke Palmer wrote: : Yeah, I think so. It might be that the first C<@array[0] = : "something"> is actually valid, and the only things that would be : invalid would be calling mutating methods on the array itself (like : C). Maybe not even that restrictiv

Macro question

2003-08-02 Thread Abhijit A. Mahabal
This is a rather silly question: The code: macro foo() { return {my $x = 7} } foo; print $x; is equivalent to which of the following? {my $x = 7} print $x; or my $x = 7; print $x; Thanx, abhi.

rx.ops

2003-08-02 Thread Benjamin Goldberg
Since I don't see anything to save/restore the instack on subroutine calls, I am wondering what happens if a regex has a (?{ CODE }), and that CODE calls a regex. Are we garunteed that after a regex completes (either succeeds or fails) that the intstack is in the same state it started? If not (a

Re: %_ - is it available for use?

2003-08-02 Thread Larry Wall
On Sat, Aug 02, 2003 at 04:33:19PM -0700, Michael G Schwern wrote: : I'm not making an argument against %_, just noting that *_ is used : opportunisticly and you will break a few programs. Not necessarily. If Perl 6 were to use %_ as parameter name, it would be lexically scoped, and hide any pac

Re: string.c questions

2003-08-02 Thread Luke Palmer
Benjamin Golberg writes: > Actually, these are mostly questions about the string_str_index > function. Uh oh... > I've some questions about bufstart, strstart, bufused, strlen and > encoding->characters? > > In string_str_index_multibyte, the lastmatch variable is calculated as: > > const v

Re: %_ - is it available for use?

2003-08-02 Thread Michael G Schwern
On Sun, Aug 03, 2003 at 01:37:16AM +0200, Abigail wrote: > I am fond of doing > > local %_ = @_; > > as one of the first statements of a subroutine. That, or > > my %args = @_; > > I like the latter because it uses a lexical variable, but I like the > former because %_ fits with @_ and

string.c questions

2003-08-02 Thread Benjamin Goldberg
Actually, these are mostly questions about the string_str_index function. I've some questions about bufstart, strstart, bufused, strlen and encoding->characters? I *think* that ->characters is a fuction which gets passed a pointer to the start of a buffer, and the number of bytes in the buffer,

Re: E6 (sort of): All levels of complex data structs marked ro?

2003-08-02 Thread Luke Palmer
> As I understand it, the comments in the following two subs are correct. > > sub foo (@array) { > my $x = @array[0]; # ok, allowed to read > @array[0] = "something"; # compile fails because '@array is ro' > } > > sub bar (@array_2d) { > my $x = @array[0]

Re: %_ - is it available for use?

2003-08-02 Thread Michael G Schwern
> Damian Conway <[EMAIL PROTECTED]> writes: > >Hence, making C<%_> mean something different in core Perl 5 might possibly be > >"forwards incompatible". Representing the Backwards Compatiblity Police, I've had co-workers use %_ as the globalist of all global hashes. %_ transends all packages and

Re: %_ - is it available for use?

2003-08-02 Thread Nick Ing-Simmons
Damian Conway <[EMAIL PROTECTED]> writes: > > From a Perl 6 perspective, it seems likely that C<%_> will be the name >commonly used for the "slurpy hash" of a subroutine. Just as C<@_> will often >be the name used for the "slurpy array". See Exegesis 6 for more details. > >Indeed, when it comes t

Re: [perl #23203] [PATCH] move languages/scheme to continuation passing style.

2003-08-02 Thread Sean O'Rourke
"Jürgen" "Bömmels" (via RT) <[EMAIL PROTECTED]> writes: > # New Ticket Created by Jürgen Bömmels > # Please include the string: [perl #23203] > # in the subject line of all future correspondence about this issue. > # http://rt.perl.org/rt2/Ticket/Display.html?id=23203 > > > > Hello, > > this p

E6 (sort of): All levels of complex data structs marked ro?

2003-08-02 Thread Rick Delaney
As I understand it, the comments in the following two subs are correct. sub foo (@array) { my $x = @array[0]; # ok, allowed to read @array[0] = "something"; # compile fails because '@array is ro' } sub bar (@array_2d) { my $x = @array[0]; # ok, allo

Re: Macro arguments themselves

2003-08-02 Thread Larry Wall
On Sat, Aug 02, 2003 at 01:18:01PM -0600, Luke Palmer wrote: : While we seem to be on the subject of hashing out macro semantics, : here's a question I've had awhile. : : What do macros do about being passed variables? : : Let's say I make a C macro: : : macro square ($x) { : { $x *

Macro arguments themselves

2003-08-02 Thread Luke Palmer
While we seem to be on the subject of hashing out macro semantics, here's a question I've had awhile. What do macros do about being passed variables? Let's say I make a C macro: macro square ($x) { { $x * $x } } And then I have code. my $var = 10; print square $var; Do

Re: Blurring the line between assertions and tests

2003-08-02 Thread Ovid
--- chromatic <[EMAIL PROTECTED]> wrote: > On Friday, August 1, 2003, at 05:03 PM, Michael G Schwern wrote: > > > Ooooh! I just had a great idea. Use "TEST { ... }" instead of "TEST: > > { ... }" > > in Test::AtRuntime. > > Could these instead be subroutine attributes? I can see a lot of > ad

subs.pod

2003-08-02 Thread Vladimir Lipskiy
I cited this out of subs.pod: "Parrot comes with different subroutine and alike classes which implement CPS (Continuation Passing Style) and PCC (Parrot Calling Conventions) F." I don't get this. Could anybody rephrase it for me? Later: =head2 Items in the Subs Context Subtype Controlstack

Re: Blurring the line between assertions and tests

2003-08-02 Thread chromatic
On Friday, August 1, 2003, at 05:03 PM, Michael G Schwern wrote: Ooooh! I just had a great idea. Use "TEST { ... }" instead of "TEST: { ... }" in Test::AtRuntime. If the user has Filter::Simple, use that to strip out the TEST blocks. Otherwise, its a function call to TEST() passing in a cod

Re: macros and is parsed

2003-08-02 Thread Larry Wall
On Sat, Aug 02, 2003 at 08:40:26AM -0700, Austin Hastings wrote: : You're both right. Well, actually, I think Damian misspoke slightly. I only aim for 95% accuracy in the Apocalypses (or I'd never get them done). So I think it's pretty spectacular if Damian gets to 99.44% accuracy in the Exegese

embedding API

2003-08-02 Thread Jeff Horwitz
i'm beginning to explore the concept of embedding parrot so i can eventually add Perl 6 support to extproc_perl (embeds perl in oracle). i was talking with dan at OSCON a few weeks ago about accessing data from an embedded parrot interpreter, and i know he is probably moving it up in his priority l

Re: Blurring the line between assertions and tests

2003-08-02 Thread Adrian Howard
On Saturday, August 2, 2003, at 01:03 am, Michael G Schwern wrote: Class::Contract has always bothered me as way too much Kool-Aid to drink in one sitting. I completely agree. Having the ability to apply pre/post/invariant functionality to normal Perl classes has been on my to do list for years

Re: macros and is parsed

2003-08-02 Thread Austin Hastings
--- "Abhijit A. Mahabal" <[EMAIL PROTECTED]> wrote: > In E6 Damien writes about macros: > > "As soon as it has parsed that subroutine call (including its > argument > list) it will detect that the subroutine &request is actually a > macro, so > it will immidiately call &request with the specified

macros and is parsed

2003-08-02 Thread Abhijit A. Mahabal
In E6 Damien writes about macros: "As soon as it has parsed that subroutine call (including its argument list) it will detect that the subroutine &request is actually a macro, so it will immidiately call &request with the specified arguments". If macroness is found *after* parsing the arguments,

[perl #23203] [PATCH] move languages/scheme to continuation passing style.

2003-08-02 Thread Jürgen
# New Ticket Created by Jürgen Bömmels # Please include the string: [perl #23203] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt2/Ticket/Display.html?id=23203 > Hello, this patch lies in my tree for month now, finally I got around to finish it up

Re: I scare me.

2003-08-02 Thread Michael G Schwern
On Sat, Aug 02, 2003 at 10:35:56AM +0100, Nicholas Clark wrote: > On Sat, Aug 02, 2003 at 01:49:05AM -0400, David H. Adler wrote: > > I'm sure it needs a few tweaks, but I've managed to write a hq9+ > > interpreter in pasm. > > > Any thoughts on this? > > + isn't a portable file name character is

Re: I scare me.

2003-08-02 Thread Nicholas Clark
On Sat, Aug 02, 2003 at 01:49:05AM -0400, David H. Adler wrote: > I'm sure it needs a few tweaks, but I've managed to write a hq9+ > interpreter in pasm. > Any thoughts on this? + isn't a portable file name character is it? So although Unix (and CVS) will be quite happy, it would not be a great i

Re: [perl #23186] [PATCH] adding "yield" semantics to IMCC

2003-08-02 Thread Leopold Toetsch
Kenneth Graves wrote: From: Leopold Toetsch <[EMAIL PROTECTED]> [ optimized register allocation ] Is there a stub of this functionality in the code somewhere? (Or some notes about how it might be approached?) No, not yet. Currently local variables (and parameters if a sub calls another sub)

IMCC: incompatible changes

2003-08-02 Thread Leopold Toetsch
The following changes regarding the PIR assembler inside parrot/imcc will be done in the next weeks: 1) All code outside of compilation units will be ignored 2) This also implies that nested subroutines are not supported anymore. I did implement both features and I have to admit, that this was an

[ANNONCE] Test::AtRuntime 0.02

2003-08-02 Thread Michael G Schwern
http://www.pobox.com/~schwern/src/Test-AtRuntime-0.02.tar.gz or a CPAN near you. Still a few small bugs and missing features, but the important things work. See the TODO and CAVEATS for details. Now works with 5.6.0! NAME Test::AtRuntime - Put tests in your code and run them as yo

Re: Blurring the line between assertions and tests

2003-08-02 Thread Michael G Schwern
On Fri, Aug 01, 2003 at 11:02:19PM -, Rafael Garcia-Suarez wrote: > Michael G Schwern wrote in perl.qa : > > The only part missing is the ability to shut the tests off once you've > > released it to production. > > You could perhaps use the assertion feature of perl >= 5.9.0 > (assertion.pm an

Re: Blurring the line between assertions and tests

2003-08-02 Thread Michael G Schwern
On Sat, Aug 02, 2003 at 12:09:22AM +0100, Adrian Howard wrote: > - Rather than running tests at live time, I'm more often doing the > opposite. I have assertions that I only want to switch on at testing > time since that is when I'm exercising things that might break. > > - This sort of