Fwd: zip: stop when and where?

2005-10-04 Thread David Storrs
Both Luke and I missed the fact that my mail and his response went  
only to each other so, with his permission, here it is as a forward.


--Dks


Begin forwarded message:


From: Luke Palmer <[EMAIL PROTECTED]>
Date: October 5, 2005 1:48:54 AM EDT
To: David Storrs <[EMAIL PROTECTED]>
Subject: Re: zip: stop when and where?
Reply-To: Luke Palmer <[EMAIL PROTECTED]>


On 10/4/05, David Storrs <[EMAIL PROTECTED]> wrote:


How about:

@foo = ('a', 'b', 'c');

for @foo ¥ 1..6 :fillin(undef)# a 1 b 2 c 3 undef 4 undef 5  
undef 6

for @foo ¥ 1..6 :fillin('')   # a 1 b 2 c 3 '' 4 '' 5 '' 6
for @foo ¥ 1..6 :fillin(0)# a 1 b 2 c 3 0 4 0 5 0 6
for @foo ¥ 1..6 :fillin(return)   # same as:  return ('a', 1, 'b', 2
'c', 3);

A couple of things bother me about this, though:

- Bad endweight on the adverb.  It looks like you are modifying the
second list, not the ¥ op



That's because you are.  I can't seem to find the document that
describes this, but as far as I recall (and my memory may be fuzzy
here), infix operators with adverbs look roughly like this:

   rule infixop {? }

Where  is, of course, greedy.  So since .. is tighter than Y:

for @foo Y 1..6 :fillin(undef) {...}

Is equivalent to:

for @foo Y (1..6 :fillin(undef)) {...}

And to get it modifying Y you need to do:

for (@foo) Y (1..6) :fillin(undef) {...}

(Parens added around @foo for symmetry).



for @foo ¥ 1..6 :fillin(last) # a 1 b 2 c 3



Uh, I don't think that works.  First off, it would have to be:

for (@foo) Y (1..6) :fillin{ last } {...}

But I don't think that works either, since you want that last to be
associated with the for loop, which it is not lexically inside.
Honestly, I just don't think it's an option, and that :short/:long (or
:min/:max) is a better option.  However, I wonder how you would get
behavior like this:

for (@foo) Y (@bar, undef xx Inf) Y (1...) :short -> $foo, $bar,
$index {...}

Hmm, probably just like that :-)



Could something like this syntax be made to work?

for (@foo ¥:fillin(undef) 1..6) but true  # a but true, 1 but
true...undef but true, 6 but true



I think you've stumbled upon the reason why we made adverbs come after
operators.  The important thing is the zip, not the fact that you're
filling in with undef.

Luke





Re: [perl #34258] [TODO] Here documents for PIR

2005-10-04 Thread Will Coleda

Even better! I jumped the gun! Never Mind! Nothing to see Here!

Thanks again!

On Oct 4, 2005, at 10:15 PM, Will Coleda wrote:

This is *great* and I've already started converting partcl to take  
advantage.


One problem I've discovered:

  operators["<<"] = OPERATOR_SHL

This is probably because:

<*>"<<"{STRINGCONSTANT} {

Is too permissive. Can we perhaps just allow {ID}s ?

Thanks again! This is great! Woo!

On Oct 4, 2005, at 6:03 PM, Jonathan Worthington via RT wrote:



Hi,

After a show of demand for here docs on IRC (and leo's approval),  
I've

now modified to lexer to support them. The syntax for introducing a
heredoc is <<"XXX", and it ends on the line containing (only) XXX.  
For

example:-

$ cat example.pir
.sub _main
$S0 = <<"quotage"
Blah blah
Oh happy days...
I love my pink highlighter pen...
quotage
print $S0
.end
$ parrot example.pir
Blah blah
Oh happy days...
I love my pink highlighter pen...
$

Have fun,

Jonathan











Re: [perl #34258] [TODO] Here documents for PIR

2005-10-04 Thread Will Coleda
This is *great* and I've already started converting partcl to take  
advantage.


One problem I've discovered:

  operators["<<"] = OPERATOR_SHL

This is probably because:

<*>"<<"{STRINGCONSTANT} {

Is too permissive. Can we perhaps just allow {ID}s ?

Thanks again! This is great! Woo!

On Oct 4, 2005, at 6:03 PM, Jonathan Worthington via RT wrote:


Hi,

After a show of demand for here docs on IRC (and leo's approval), I've
now modified to lexer to support them. The syntax for introducing a
heredoc is <<"XXX", and it ends on the line containing (only) XXX. For
example:-

$ cat example.pir
.sub _main
$S0 = <<"quotage"
Blah blah
Oh happy days...
I love my pink highlighter pen...
quotage
print $S0
.end
$ parrot example.pir
Blah blah
Oh happy days...
I love my pink highlighter pen...
$

Have fun,

Jonathan






Re: loadlib and libraries with '.' in the name

2005-10-04 Thread Ask Bjoern Hansen
[EMAIL PROTECTED] (Joshua Juran) writes:

[...]
> > Google for "NCI gtk". There is also a weekly summary entry but the
> > xrl.us shortcut seems to have expired.

If I found the same link you found then it's not the xrl.us shortcut -
http://xrl.us/cw78 - but the Google group link that stopped working.
 
> I was wondering about that.  I Googled for "tinyurl considered
> harmful" and was surprised to find only one message, discussing the
> phishing risks.  I found no mention of the risk of outsourcing a
> bottleneck to a third party who has zero obligation or direct interest
> to continue providing the service.

The use case for the Metamark service was actually to have a "short
links" service for the perl list summaries (and for the perl community
in general) to use that's not "outsourced".  (Metamark is running on a
server a few feet above the servers your mail went through to go out
to the list subscribers).
 
>  From :
> 
> > Do Metamark links expire?
> >
> > The Metamark urls expire after five years or two years after the
> > last usage - whichever comes later. However, if a link is never
[...]
> > Of course, this is subject to change and is no promise but just my
> > intentions as of this writing. If you want guarantees you can make
> > your own service.

> To be quite frank, I'm astonished the practice exists here in the
> first place.  In my opinion it goes directly against the spirit of [...]

Are you talking about expiring links or putting the short links in the
mails that go out?

Apart from the occasional phishing link then we haven't actually
expired any of the metamark urls yet.

I did some random spot checks on old short URLs used in the summaries
and they get used regularly[1] so even if/when we start expiring
unused links in a few years they won't go away.

[1] by humans or bots, I don't know - for your privacy we don't track
more than a daily count.


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


PGE error on failing subrules

2005-10-04 Thread Allison Randal

When I match these rules:

p6rule(" ",  
classname, "attrdef")

p6rule("\( \s* x \s* \)", classname, "parenlist")
p6rule("{ \s* y \s* }", classname, "codeblock")

against this string "(x) { y }", I get the following error:

src/inter_call.c:129: failed assertion `PObj_is_PMC_TEST(sig_pmc)'
Abort trap

When I change the two subrule calls to an inline pattern, the match  
fails (as it should), but doesn't give the error.


p6rule("\( \s* x \s* \)  { \s* y \s* }", classname, "attrdef")

When I add in whitespace between the two subrules, the rule matches  
successfully with no errors:


p6rule(" \s* ",  
classname, "attrdef")


Any thoughts on the cause of the error? I've run across it several  
other times as well, this was just a nice small example. It seems to  
always involve a failed match with calls to subrules.


Allison



Re: zip: stop when and where?

2005-10-04 Thread Luke Palmer
On 10/4/05, Luke Palmer <[EMAIL PROTECTED]> wrote:
> If that ends up being common, we could create a syntax for it, like
> postfix:<...>:
>
> @array...  # same as (@array, undef xx Inf)

No, no, that's a bad idea, because:

@array...# same as @array.elems..Inf

So I think I'm pretty much with Damian on this one.  I don't like the
idea of it discriminating between finite and infinite lists, though. 
What about things like =<>, for which it is never possible to know if
it is infinite?

I don't think people make assumptions about the zip operator.  "Does
it quit on the shortest one or the longest one?" seems like a pretty
common question for a learning Perler to ask.  That means they'll
either write a little test or look it up in the docs, and we don't
need to be so strict about its failure.  I'd like to go with the
minimum.

I was thinking a good name for the adverbs would be :long and :short.

Luke


Re: zip: stop when and where?

2005-10-04 Thread Luke Palmer
On 10/4/05, Juerd <[EMAIL PROTECTED]> wrote:
> What should zip do given 1..3 and 1..6?
>
> (a) 1 1 2 2 3 3 4 5 6
> (b) 1 1 2 2 3 3 undef 4 undef 5 undef 6
> (c) 1 1 2 2 3 3
> (d) fail
>
> I'd want c, mostly because of code like
>
> for @foo Y 0... -> $foo, $i { ... }
>
> Pugs currently does b.

I think (c) is correct, precisely for this reason.  The idiom:

for 0... Y @array -> $index, $elem {...}

Is one we're trying to create.  If it involves a pain like:

for 0... Y @array -> $index, $elem {
$elem // last;
}

Then it's not going to be a popular idiom.

If you want behavior (b), SWIM:

for 0... Y @array, undef xx Inf -> $index, $elem {
...
}

If that ends up being common, we could create a syntax for it, like
postfix:<...>:

@array...  # same as (@array, undef xx Inf)

Luke


I'm sure you all read use.perl but ...

2005-10-04 Thread Leopold Toetsch

... just in case you have missed autrijus's last one [1]:

Happily, leo has become a #perl6 resident; with his help, we regained 
compatibility with Parrot 0.3.0's new calling conventions, and rules 
support via PGE again works. The new calling conventions are much 
saner; chip/leo have done a wonderful job. They are working on named 
parameters, lexical pads and variable-sized register frames for 0.3.1, 
which could be the first Parrot that Pugs can seriously target to.


leo
[1] http://use.perl.org/~autrijus/journal/



Re: zip: stop when and where?

2005-10-04 Thread Damian Conway

Juerd wrote:


What should zip do given 1..3 and 1..6?

(a) 1 1 2 2 3 3 4 5 6
(b) 1 1 2 2 3 3 undef 4 undef 5 undef 6
(c) 1 1 2 2 3 3
(d) fail

I'd want c, mostly because of code like

for @foo Y 0... -> $foo, $i { ... }

Pugs currently does b.


I agree that C should have named options (perhaps :min and :max) that 
allow precise behaviour to be specified.


I suspect that the dwimmiest default would be for C to stop zipping at 
the length of the shortest finite argument. And to fail unless all finite 
arguments are of the same length. Hence:


 @i3 =   1..3   ;
 @a3 = 'a'..'c' ;
 @i6 =   1..6   ;

 zip(@a3, @i3)# 'a', 1, 'b', 2, 'c', 3
 zip(@i3, @i6)# fail
 zip(100..., @a3, @i3)# 100, 'a', 1, 101, 'b', 2, 102, 'c', 3
 zip(100..., @a3, @i6)# fail

Damian



Re: Software Architecture of Parrot

2005-10-04 Thread Leopold Toetsch


On Oct 4, 2005, at 21:44, Klaas-Jan Stol wrote:



Hi,

Currently I'm doing a course 'Software Architecture' for my Master 
Computer Science. For this course, I have to write a paper on some 
subject that has to do with software architecture. Therefore, I 
proposed to write a paper on the architecture of Parrot, and today I 
got approval of this subject from my Professor :-).


Marvellous.

Of course, it may turn out that some information I collect is outdated 
or I misinterpreted it. I hope some of you are willing to proof-read 
it, as it develops, to prevent incorrect information in the paper.


Just drop a link to the paper, or ask, if something isn't really 
obvious.



Kind regards,

Klaas-Jan


leo



Perl 6 Summary for 2005-09-26 through 2005-10-02

2005-10-04 Thread Matt Fowles
Perl 6 Summary for 2005-09-26 through 2005-10-02
All~

Welcome to another summary, this time a day late because I was in Philly
for Serenity. If you haven't seen Serenity yet you should stop reading
this summary and go see it. The summary will be here when you get back.
I promise.

  Perl 6 Compiler
No postings this week. I blame Piers for scaring them off last week.

  Parrot
   Summary Links
Last weeks load lib thread morphed into a conversation about the life
span of the shortened links that appear in summaries. Piers pointed out
that, although the short links expire, the long links are archived at
perl.org.



   RT Cleanup
Joshua Hoblitt has been continuing his massive clean up of RT. It makes
me glad of two things: that someone is doing it and that I am not doing
it. I won't post all of the links for these messages, but much work is
getting done.

   debug segments
Jonathan Worthington posted an RFC of his design for debug and source
segments in Parrot's packfiles. People seem to like it generally.
Hopefully the design will be implemented soon.



   Leo's Context Branch Hits the Mainline
After a few more reviews from Chip, Leo's context branch has been dubbed
ready and has been moved to the mainline. This marks the culmination of
quite a bit of hard work from many people (especially Leo). Nice work
all.

 -- bit of review

 -- merge

   Amber PMCs
Roger Browne wondered how he should include Amber PMCs. Leo and Will
suggested he put the pmcs into the languages directory similar to the
way Tcl does it.



   Data::Escape Needs Tests
Jerry Gay added a TODO for tests for Data::Escape. This would be a great
thing for an eager lurker to cut his or her teeth on.



   Magic Numbers Bad, Magic Strings Good
Last weeks magic thread ended down with the conclusion that Parrot would
use a magic string instead of a magic number.



   Tests fail on win32
Jerry Gay opened a new RT ticket for some failing tests on Windows.



   Here Doc in PIR
Will Coleda revived a thread from February about PIR here doc syntax.
Looks like the syntax is ok.



   Win32 PCRE
François Perrad enabled PCRE on Win32. Jerry Gay applied the patch.



   PLATFORMS and MinGW
François Perrad updated the PLATFORMS file for MinGW.



   parrot_config dependency
Nick Glencross provided a patch (for comment only) that eases the
dependency on parrot_config. I am not sure that he got many comments.



   Data::Escape::String Dislikes Unicode
Will noticed that Data::Escape::String doesn't work on Unicode strings.



   Make Cleanup
Joshua Hoblitt started RT tickets for several things that are part of a
general make system clean up.







   Parrot Leaves Crumbs
Nick Glencross rediscovered the core files that parrot leaves around.
This is a known problem.



   Parrot Threads
Dave Frost wondered what the plan for Parrot Threading was going to be.
The answer (provided by Leo with more details from Jonathan Worthington)
was OS threads.



   Once deprecation's lost its fun...
Leo went on a bit of fall cleaning adding things to the deprecated list.
He even threatened to resolve some of them soon.









   Lexical and Variable Sized Register Frames
With the calling conventions having been redone, Leo has plans to move
to system of dynamically sized registers frames with static lexicals
stored directly in them. Chip should produce details soon.



   Exception Handling Bug
Roger Browne found a bug with exception handlers in the new scheme. Leo
fixed it. I wonder if anyone made a test out of it...



   Config missing output
Will Coleda noticed that Configure.pl was not outputting a response to a
step on his platform.



   Parrot 0.3.0 TODO
Robert J Eaglestone wondered what would be a good way of chipping in.
Will Coleda, predictably, tried to turn him towards working for the good
of Tcl.



   Tru64 Issues
Jarkko Hietaniemi appears to have recently come into some time with a
Tru64 machine. He found lots of problems, which he added to RT, so I
won't link them here.

   src/extends.c
chromatic made good on a promise to auto generate src/extends.c
automatically. Leo quibbled over pod, but thought it was 

Re: Test::Kwalitee - Where is it hosted?

2005-10-04 Thread Steve Peters
On Tue, Oct 04, 2005 at 04:15:45PM +0100, Dave Cross wrote:
> David Landgren wrote:
> >Gavin Henry wrote:
> >
> >>Dear List,
> >>
> >>In "Perl Testing - A Developers Notebook" it has a section on 
> >>Test::Kwalitee.
> >>
> >>I can't find this module anywhere, nothing on the CPAN or on Google.
> >
> >It would only be POD, I imagine.
> >
> >>Anyone know where it's hosted?
> >
> >Kwalitee, as in cpants.perl.org, is run by Thomas "domm" Klausner.
> >
> >What is Kwalitee
> >http://cpants.perl.org/kwalitee.html
> >
> >Y::E 2005 Braga slides by Thomas Klausner
> >http://domm.zsi.at/talks/2005_braga_cpants/s2.html
> 
> Actually the book strongly suggests that it's a real module which runs 
> the Kwalitee checks on your code
> 
> Download and install Test::Kwalitee. Then add the following code to
> your t/ directory as kwalitee.t:
> 
> #!perl
> 
> eval { require Test::Kwalitee };
> exit if $@;
> Test::Kwalitee->import(  );
> 
> That's from section 4.9 Validating Kwalitee.
> 

Looking at http://use.perl.org/~chromatic/journal/25127 (I love Google), its
still waiting to go to CPAN.

Steve Peters
[EMAIL PROTECTED]


Re: [perl #34991] More const weirdness

2005-10-04 Thread Nick Glencross

Joshua Hoblitt via RT wrote:


[nickg - Thu Apr 14 15:12:00 2005]:

Here's another odd one, which looks const-related. Uncommenting the '+=' 
line causes a compile error when 'c' is subsequently used.


It looks like there is still support for .const in the lexer.  Is this
still an issue?

I did try it again not so long ago, and it still behaved like this. I 
know that there is talk of redoing macros etc. so I wouldn't waste any 
time on it.  When I opened it I thought someone might be able to fix it 
quick, but I suspect it's quite involved.


Let's close it.

Nick



[perl #34258] [TODO] Here documents for PIR

2005-10-04 Thread Jonathan Worthington via RT
Hi,

After a show of demand for here docs on IRC (and leo's approval), I've
now modified to lexer to support them. The syntax for introducing a
heredoc is <<"XXX", and it ends on the line containing (only) XXX. For
example:-

$ cat example.pir
.sub _main
$S0 = <<"quotage"
Blah blah
Oh happy days...
I love my pink highlighter pen...
quotage
print $S0
.end
$ parrot example.pir
Blah blah
Oh happy days...
I love my pink highlighter pen...
$ 

Have fun,

Jonathan


Re: [PATCH] Add BROKEN.pod

2005-10-04 Thread Joshua Hoblitt
On Tue, Oct 04, 2005 at 06:30:05PM +0200, Leopold Toetsch wrote:
> 
> There are 2 philosophies amongst people: some prefer RT, others prefer 
> one document in the tree. The goal could be to auto-create BROKEN from 
> RT tickets then. (I prefer one file, btw ;-)

That shouldn't be too hard with the RT cli.  Regenerating BROKEN could
be just another release step.  I'll take a stab at it if the consensus
is to go that way.

-J

--


pgpPik0jQI2Ja.pgp
Description: PGP signature


Kwalitee and Perl::Critic

2005-10-04 Thread Nik Clayton
I don't have strong opinions about this yet, but has anyone else looked 
at the Perl::Critic suite of modules on CPAN?


It occurs to me that:

a) Kwalitee metrics could quite easily be implemented as Perl::Critic 
plugins.


b) The plugins that it ships with (based on Perl Best Practices) may 
form good kwalitee indicators.


N


Re: my $key is sensitive;

2005-10-04 Thread Brent 'Dax' Royal-Gordon
Rafael Garcia-Suarez <[EMAIL PROTECTED]> wrote:
> So, such a "sensitive" modifier could be added, but its
> precise meaning would be highly dependent on the underlying
> implementation.

Okay, but there needs to be some minimum standard for it, like "the
memory in question no longer contains its original contents after
garbage collection".  The security of the key keeping my information
from the Secret Police shouldn't be compromised because the particular
Perl backend I'm using doesn't implement "is sensitive" in a
meaningful way.

I would like "is sensitive" to be defined to mean that any data stored
in that variable, at any level of recursion, will be zeroed out as
soon as it is garbage collected.  Particular implementations can add
extra features on top of that--such as stopping the VM from swapping
it or even actively encrypting that area of memory--but without a
minimum standard there's no point in supporting the feature at all.

--
Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]>
Perl and Parrot hacker


Software Architecture of Parrot

2005-10-04 Thread Klaas-Jan Stol

Hi,

Currently I'm doing a course 'Software Architecture' for my Master 
Computer Science. For this course, I have to write a paper on some 
subject that has to do with software architecture. Therefore, I proposed 
to write a paper on the architecture of Parrot, and today I got approval 
of this subject from my Professor :-).


The idea of the paper is to describe the architecture of the current 
state of Parrot, and maybe some future plans. It should be about 5 to 10 
pages long, but I expect to write about 15-20. I'd like to start with 
the reasons for writing Parrot (why not an existing VM), and continue 
with design decisions for all the main components (so for instance, why 
not ref.counting-GC, but a DOD/GC.)


Maybe, if the document is ready, it may be a good introduction for new 
people interested in Parrot. I'm looking forward to writing it, 
especially I can finally do something in return for all the help I 
already got (I wrote my Bachelor thesis on Lua/Parrot).


Of course, it may turn out that some information I collect is outdated 
or I misinterpreted it. I hope some of you are willing to proof-read it, 
as it develops, to prevent incorrect information in the paper.


Kind regards,

Klaas-Jan







Re: zip: stop when and where?

2005-10-04 Thread Greg Woodhouse
I see your point. Option b does suggest that you can read ahead in a
"blocked" list and get undef's. If I had to choose just one, I think
I'd opt for d, but having two zip's one acting like c and one like d
might be useful. Then, of course, my first thought was wrong. This one
may well be, too.

--- Eric <[EMAIL PROTECTED]> wrote:

> Hey,
> I'd just like to say that I find B a bit misleading because you
> couldn't
> tell that the first list ended, it could just have undef's at the
> end. I
> like a because it doesn't add any data that wasn't there, of course
> that
> could be a reason to dislike it too. On the other hand c makes a good
> option
> when you want to work with infinite lists. Is this something that
> could be
> modified on per use basis and we just choose one now as the default
> "they
> didn't request a specific one so use this one).
> 
> After all that i think I agree on C specificaly because you can
> provide a
> good code use of it and it doesn't add any data that wasn't there
> before. I
> don't think it should ever lean towards (b) but them I bet someone
> else will
> have an equaly good use of that. ;) So in the end I think some way of
> chooseing would be good, with one option picked as standard.
> 
> --
> Eric Hodges
> 



===
Gregory Woodhouse  <[EMAIL PROTECTED]>



"Without the requirement of mathematical aesthetics a great many discoveries 
would not have been made."

-- Albert Einstein











Re: zip: stop when and where?

2005-10-04 Thread Jonathan Scott Duff
On Tue, Oct 04, 2005 at 09:00:15PM +0200, Juerd wrote:
> What should zip do given 1..3 and 1..6?
> 
> (a) 1 1 2 2 3 3 4 5 6
> (b) 1 1 2 2 3 3 undef 4 undef 5 undef 6
> (c) 1 1 2 2 3 3
> (d) fail
> 
> I'd want c, mostly because of code like
> 
> for @foo Y 0... -> $foo, $i { ... }
> 
> Pugs currently does b.

(a) and (d) are certainly wrong IMHO.

Surely zip could get a modifier to vary the behavior as desired?

for @foo ¥ 0...  :greedy-> $foo, $i { ... } # (b)
for @foo ¥ 0...  :conservative  -> $foo, $i { ... } # (c)

Didn't we go over this a while back? 

Anyway, I agree that (c) is probably the sanest default behavior.

-Scott
-- 
Jonathan Scott Duff
[EMAIL PROTECTED]


Re: zip: stop when and where?

2005-10-04 Thread Eric
Hey,
I'd just like to say that I find B a bit misleading because you couldn't
tell that the first list ended, it could just have undef's at the end. I
like a because it doesn't add any data that wasn't there, of course that
could be a reason to dislike it too. On the other hand c makes a good option
when you want to work with infinite lists. Is this something that could be
modified on per use basis and we just choose one now as the default "they
didn't request a specific one so use this one).

After all that i think I agree on C specificaly because you can provide a
good code use of it and it doesn't add any data that wasn't there before. I
don't think it should ever lean towards (b) but them I bet someone else will
have an equaly good use of that. ;) So in the end I think some way of
chooseing would be good, with one option picked as standard.

--
Eric Hodges


Re: zip: stop when and where?

2005-10-04 Thread Greg Woodhouse
That (b) certainly seems like the sensible option to me. My second
choice would be d.

A nice thing about c is that it leaves open the possibility of lazy
evaluation (zip as much of the lists as you can, leaving open the
possibility of picking up the process later). But I still prefer b.
Maybe there could be separate "lazy zip" (lzip?).

--- Juerd <[EMAIL PROTECTED]> wrote:

> What should zip do given 1..3 and 1..6?
> 
> (a) 1 1 2 2 3 3 4 5 6
> (b) 1 1 2 2 3 3 undef 4 undef 5 undef 6
> (c) 1 1 2 2 3 3
> (d) fail
> 
> I'd want c, mostly because of code like
> 
> for @foo Y 0... -> $foo, $i { ... }
> 
> Pugs currently does b.
> 
> 
> Juerd
> -- 
> http://convolution.nl/maak_juerd_blij.html
> http://convolution.nl/make_juerd_happy.html 
> http://convolution.nl/gajigu_juerd_n.html
> 



===
Gregory Woodhouse  <[EMAIL PROTECTED]>



"Without the requirement of mathematical aesthetics a great many discoveries 
would not have been made."

-- Albert Einstein











Re: zip: stop when and where?

2005-10-04 Thread Joshua Gatcomb
On 10/4/05, Juerd <[EMAIL PROTECTED]> wrote:
>
> What should zip do given 1..3 and 1..6?
>
> (a) 1 1 2 2 3 3 4 5 6
> (b) 1 1 2 2 3 3 undef 4 undef 5 undef 6
> (c) 1 1 2 2 3 3
> (d) fail
>
> I'd want c, mostly because of code like
>
> for @foo Y 0... -> $foo, $i { ... }
>
> Pugs currently does b.


Yeah. This is one of those things where it is hard to have a single function
always DWYM. Algorithm::Loops solves this by just providing multiple
functions. I can't see how to solve this using MMD alone. You would need to
add an optional parameter that would specify behavior

-min (zip to the smallest list)
-undef (insert undefs as needed)
-error (blow up if the lists are not equal in size)

etc

Juerd
>

Just my 2 cents from the peanut gallery.

Cheers,
Joshua Gatcomb
a.k.a. L~R


zip: stop when and where?

2005-10-04 Thread Juerd
What should zip do given 1..3 and 1..6?

(a) 1 1 2 2 3 3 4 5 6
(b) 1 1 2 2 3 3 undef 4 undef 5 undef 6
(c) 1 1 2 2 3 3
(d) fail

I'd want c, mostly because of code like

for @foo Y 0... -> $foo, $i { ... }

Pugs currently does b.


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html


Re: [perl #37308] Parrot gobbles up all the memory

2005-10-04 Thread Leopold Toetsch


On Oct 4, 2005, at 19:06, Andrew Dougherty wrote:

Ok, I've finally found the cause of this one, but I don't have a 
portable

patch at hand.

Buried in amongst the 6827 warnings emitted by gcc is one that actually
correctly identifies the problem:


There must be some really heavily used macros that cause that huge 
amount of warnings, e.g. used in ops files. Getting rid of these would 
really help I presume.


  src/inter_create.c:400: warning: dereferencing type-punned pointer 
will

  break strict-aliasing rules


The line reads:

LVALUE_CAST(char *, p) += ALIGNED_CTX_SIZE;

The intent is of course, to bump the context pointer by the needed 
size. The problem is that the needed size does not correlate with the 
size of the struct.



And indeed that appears to be the problem.  You can even reproduce the
problem under Linux/x86 with gcc-3.4 or newer.  Simply compile with
optimization level of -O3.

The *temporary workaround* for *gcc only* is to supply gcc with the
-fno-strict-aliasing flag.

For those not familiar with aliasing, I found this article

http://mail-index.netbsd.org/tech-kern/2003/08/11/0001.html


When I get this right, the article also states:

There exist an important exception to the rule above:  char* may alias 
all

types (too much code would break if ISO had prevented this...)

Anyway, does:

   p = (struct Parrot_Context *) ( (char *) p + ALIGNED_CTX_SIZE );

help, or better is it "more correct"?

We have a lot of similar code e.g. inside GC, where pointers to PMCs or 
to PObjs are icnremented by the actual size of the object and not by 
the size of some structure.


leo



Re: Test::Kwalitee - Where is it hosted?

2005-10-04 Thread Gavin Henry

> On Tue, 2005-10-04 at 17:41 +0200, Thomas Klausner wrote:
>
> Hi all,
>
>> In june, chromatic informed me that he planned something like
>> Test::Kwalitee. AFAIK it was/is in 'proof of concept'-stage, mostly
>> because CPANTS was a fast-moving target back then (I was rewriting stuff
>> a lot...)
>
> Yep, I had it working then too, then I fell behind in tracking
> Module::CPANTS::Generator.  I'll try to synchronize my code this
> weekend.

Cool. Look forward to testing.



-- 
Walking the road to enlightenment... I found a penguin and a camel on the
way. Fancy a [EMAIL PROTECTED] Just ask!!!
http://perlmonks.org/?node_id=386673


Re: Test::Kwalitee - Where is it hosted?

2005-10-04 Thread chromatic
On Tue, 2005-10-04 at 17:41 +0200, Thomas Klausner wrote:

Hi all,

> In june, chromatic informed me that he planned something like
> Test::Kwalitee. AFAIK it was/is in 'proof of concept'-stage, mostly
> because CPANTS was a fast-moving target back then (I was rewriting stuff
> a lot...)

Yep, I had it working then too, then I fell behind in tracking
Module::CPANTS::Generator.  I'll try to synchronize my code this
weekend.

-- c



Re: rx ops and support is deprecated

2005-10-04 Thread Leopold Toetsch


On Oct 4, 2005, at 18:41, Brent 'Dax' Royal-Gordon wrote:



Leopold Toetsch <[EMAIL PROTECTED]> wrote:
As Brent is listed as author in rx.ops I wanted to make sure, if it's 
ok

to remove ops/rx.ops, src/rx.c and associated files.

See also the file DEPRECATED in parrot's root dir.


I have no problem with this--the rx ops were an early experiment based
on an incomplete understanding of the problem.  I wrote the optimized
int stack too for the rx ops--are you planning on keeping that?


No, intstack was actually deprecated since quite a time. The removal of 
intstack and other stuff is included in "and associated file" above ;-)


Thanks for the quick reply,
leo



Re: Test::Kwalitee - Where is it hosted?

2005-10-04 Thread Gavin Henry

-- 
Walking the road to enlightenment... I found a penguin and a camel on the
way. Fancy a [EMAIL PROTECTED] Just ask!!!
http://perlmonks.org/?node_id=386673


> Dave Cross <[EMAIL PROTECTED]> wrote:
>
>> Actually the book strongly suggests that it's a real module which runs
>> the Kwalitee checks on your code
>>
>>  Download and install Test::Kwalitee. Then add the following code to
>>  your t/ directory as kwalitee.t:
>>
>>  #!perl
>>
>>  eval { require Test::Kwalitee };
>>  exit if $@;
>>  Test::Kwalitee->import(  );
>>
>> That's from section 4.9 Validating Kwalitee.
>
> Although not directly related to CPANTS, you can use Test::Distribution,
> which tests several aspects also tested by CPANTS kwalitee metrics.
>   http://search.cpan.org/dist/Test-Distribution/

I've got that one, not sure if it duplicates the tests yet though.

>
>
> --
> Sébastien Aperghis-Tramoni
>
> Close the world, txEn eht nepO.
>



Re: [perl #37308] Parrot gobbles up all the memory

2005-10-04 Thread Andrew Dougherty
On Fri, 30 Sep 2005, Andy Dougherty wrote:

> On Fri, 30 Sep 2005, Leopold Toetsch via RT wrote:
> 
> > Andy Dougherty (via RT) wrote:
> > 
> > > With a a fresh checkout (r9274) I get a number of errors where parrot 
> > > eventually
> > > gobbles up all the memory on the system.  Here's the first such one:
> > > 
> > > t/op/gc
> > > # Failed test (t/op/gc.t at line 279)
> > 
> > > # './parrot  --gc-debug 
> > > "/home/doughera/src/parrot/parrot-andy/t/op/gc_13.pir"' failed with exit 
> > > code 131
> > > # Looks like you failed 1 test of 22.
> > 
> > Strange. The test succeeds on linux/86 and OS/X 10.3 darwin. Running it 
> > through valgrind on the linux box doesn't show any indication of an error.

Ok, I've finally found the cause of this one, but I don't have a portable 
patch at hand.

Buried in amongst the 6827 warnings emitted by gcc is one that actually 
correctly identifies the problem:

  src/inter_create.c:400: warning: dereferencing type-punned pointer will 
  break strict-aliasing rules

And indeed that appears to be the problem.  You can even reproduce the 
problem under Linux/x86 with gcc-3.4 or newer.  Simply compile with 
optimization level of -O3.

The *temporary workaround* for *gcc only* is to supply gcc with the 
-fno-strict-aliasing flag.

For those not familiar with aliasing, I found this article

http://mail-index.netbsd.org/tech-kern/2003/08/11/0001.html

to be useful.  Another relevant page (specific to gcc) is at

http://gcc.gnu.org/bugs.html#nonbugs_c

Hope this helps,

-- 
Andy Dougherty  [EMAIL PROTECTED]


Re: rx ops and support is deprecated

2005-10-04 Thread Brent 'Dax' Royal-Gordon
Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> As Brent is listed as author in rx.ops I wanted to make sure, if it's ok
> to remove ops/rx.ops, src/rx.c and associated files.
>
> See also the file DEPRECATED in parrot's root dir.

I have no problem with this--the rx ops were an early experiment based
on an incomplete understanding of the problem.  I wrote the optimized
int stack too for the rx ops--are you planning on keeping that?

--
Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]>
Perl and Parrot hacker


Re: [PATCH] Add BROKEN.pod

2005-10-04 Thread Leopold Toetsch


On Oct 4, 2005, at 5:05, Joshua Hoblitt wrote:


On Mon, Oct 03, 2005 at 06:17:30PM -0700, chromatic wrote:


I'll check this in in two days with regard to feedback from anyone 
whose

opinion matters and what to call it and where to put it, if my initial
choice isn't perfect.


I'm wondering if this wouldn't be better split up into RT tickets
similar to the way TODOs are handled.  Having everything in one 
coherent

document is great but I suspect that significantly lowers the odds of
the individual items being kept up to date.


There are 2 philosophies amongst people: some prefer RT, others prefer 
one document in the tree. The goal could be to auto-create BROKEN from 
RT tickets then. (I prefer one file, btw ;-)



Cheers,

-J


leo



Re: Test::Kwalitee - Where is it hosted?

2005-10-04 Thread Sébastien Aperghis-Tramoni
Dave Cross <[EMAIL PROTECTED]> wrote:

> Actually the book strongly suggests that it's a real module which runs
> the Kwalitee checks on your code
>
>  Download and install Test::Kwalitee. Then add the following code to
>  your t/ directory as kwalitee.t:
>
>  #!perl
>
>  eval { require Test::Kwalitee };
>  exit if $@;
>  Test::Kwalitee->import(  );
>
> That's from section 4.9 Validating Kwalitee.

Although not directly related to CPANTS, you can use Test::Distribution,
which tests several aspects also tested by CPANTS kwalitee metrics.
  http://search.cpan.org/dist/Test-Distribution/


--
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.


Re: [PATCH] Add BROKEN.pod

2005-10-04 Thread Andrew Dougherty
On Mon, 3 Oct 2005, Chromatic wrote:

> Here's (finally) a collection and summary of all of the known broken
> items in Parrot right now as a patch to create BROKEN.pod in the top
> level directory.  If this isn't the right name or place to put the file,
> that's fine.

> +=item * Allow Building with a Different Compiler
> +
> +Parrot relies on values pulled from the Perl 5 configuration, even with
> +C<--ask>.  Andy Dougherty says that:
> +
> +  $ perl Configure.pl cc=XX cxx=XX link=XX ld=XX
> +
> +should, but doesn't, work.

You can remove that one.  I've now fixed it [perl #37160].  (There may yet 
be warts, but the basic work is in.)

-- 
Andy Dougherty  [EMAIL PROTECTED]


[svn ci r9331] Deprecated 1 - remove stack call directives

2005-10-04 Thread Leopold Toetsch

Please note again: remove *stack call directives*

* The 4 directives and 'call' are gone. If needed use please:
   .param   => save
   .arg => restore
   .return  => save
   .result  => restore
   call => bsr
* please note that *parrot calling conventions* still work of course.
* adjust some imcc tests
* remove some dead imcc.y tokens like SAVEALL

leo



Re: Test::Kwalitee - Where is it hosted?

2005-10-04 Thread David Landgren

Dave Cross wrote:

David Landgren wrote:


Gavin Henry wrote:


Dear List,

In "Perl Testing - A Developers Notebook" it has a section on 
Test::Kwalitee.


I can't find this module anywhere, nothing on the CPAN or on Google.



It would only be POD, I imagine.


Anyone know where it's hosted?



Kwalitee, as in cpants.perl.org, is run by Thomas "domm" Klausner.

What is Kwalitee
http://cpants.perl.org/kwalitee.html

Y::E 2005 Braga slides by Thomas Klausner
http://domm.zsi.at/talks/2005_braga_cpants/s2.html



Actually the book strongly suggests that it's a real module which runs 
the Kwalitee checks on your code


Download and install Test::Kwalitee. Then add the following code to
your t/ directory as kwalitee.t:

#!perl

eval { require Test::Kwalitee };
exit if $@;
Test::Kwalitee->import(  );

That's from section 4.9 Validating Kwalitee.


Perhaps this has been subsumed into what is now Module::CPANTS::Generator?

DAvid



Dave...




--
"It's overkill of course, but you can never have too much overkill."



Re: Test::Kwalitee - Where is it hosted?

2005-10-04 Thread Thomas Klausner
Hi!

On Tue, Oct 04, 2005 at 04:15:45PM +0100, Dave Cross wrote:

> >>Dear List,
> >>
> >>In "Perl Testing - A Developers Notebook" it has a section on 
> >>Test::Kwalitee.
> ..
> Actually the book strongly suggests that it's a real module which runs 
> the Kwalitee checks on your code
> .. 
> That's from section 4.9 Validating Kwalitee.

In june, chromatic informed me that he planned something like
Test::Kwalitee. AFAIK it was/is in 'proof of concept'-stage, mostly
because CPANTS was a fast-moving target back then (I was rewriting stuff
a lot...)

BTW, Module::CPANTS::Generator nwo includes a script called lint.pl
http://search.cpan.org/src/DOMM/Module-CPANTS-Generator-0.43/cpants/lint.pl
that sort of runs kwalitee checks on an unreleased dist. It's not
documented and hardly working (e.g. it can only test on dist, and
reporting is done by writing a sqlite file (with a fixed name...))


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}


Re: Test::Kwalitee - Where is it hosted?

2005-10-04 Thread Gavin Henry

> On Tue, Oct 04, 2005 at 04:15:45PM +0100, Dave Cross wrote:
>> David Landgren wrote:
>> >Gavin Henry wrote:
>> >
>> >>Dear List,
>> >>
>> >>In "Perl Testing - A Developers Notebook" it has a section on
>> >>Test::Kwalitee.
>> >>
>> >>I can't find this module anywhere, nothing on the CPAN or on Google.
>> >
>> >It would only be POD, I imagine.
>> >
>> >>Anyone know where it's hosted?
>> >
>> >Kwalitee, as in cpants.perl.org, is run by Thomas "domm" Klausner.
>> >
>> >What is Kwalitee
>> >http://cpants.perl.org/kwalitee.html
>> >
>> >Y::E 2005 Braga slides by Thomas Klausner
>> >http://domm.zsi.at/talks/2005_braga_cpants/s2.html
>>
>> Actually the book strongly suggests that it's a real module which runs
>> the Kwalitee checks on your code
>>
>> Download and install Test::Kwalitee. Then add the following code to
>> your t/ directory as kwalitee.t:
>>
>> #!perl
>>
>> eval { require Test::Kwalitee };
>> exit if $@;
>> Test::Kwalitee->import(  );
>>
>> That's from section 4.9 Validating Kwalitee.
>>
>
> Looking at http://use.perl.org/~chromatic/journal/25127 (I love Google),
> its
> still waiting to go to CPAN.
>

I missed that then. Well, that's a bit of keen advertising in his book ;-)

Gavin.

-- 
Walking the road to enlightenment... I found a penguin and a camel on the
way. Fancy a [EMAIL PROTECTED] Just ask!!!
http://perlmonks.org/?node_id=386673


Re: Test::Kwalitee - Where is it hosted?

2005-10-04 Thread Gavin Henry

> David Landgren wrote:
>> Gavin Henry wrote:
>>
>>> Dear List,
>>>
>>> In "Perl Testing - A Developers Notebook" it has a section on
>>> Test::Kwalitee.
>>>
>>> I can't find this module anywhere, nothing on the CPAN or on Google.
>>
>> It would only be POD, I imagine.
>>
>>> Anyone know where it's hosted?
>>
>> Kwalitee, as in cpants.perl.org, is run by Thomas "domm" Klausner.
>>
>> What is Kwalitee
>> http://cpants.perl.org/kwalitee.html
>>
>> Y::E 2005 Braga slides by Thomas Klausner
>> http://domm.zsi.at/talks/2005_braga_cpants/s2.html
>
> Actually the book strongly suggests that it's a real module which runs
> the Kwalitee checks on your code
>
>  Download and install Test::Kwalitee. Then add the following code to
>  your t/ directory as kwalitee.t:
>
>  #!perl
>
>  eval { require Test::Kwalitee };
>  exit if $@;
>  Test::Kwalitee->import(  );
>
> That's from section 4.9 Validating Kwalitee.
>
> Dave...
>

Yup. Although I changed the example to be more like their previous examples:


use Test::More;

eval 'require Test::Kwalitee';
plan( skip_all => 'Test::Kwalitee not installed' ) if $@;
Test::Kwalitee->import();


Maybe I should change it to:

plan( skip_all => 'Test::Kwalitee not installed, because I can't find it'
) if $@;

;-)

-- 
Walking the road to enlightenment... I found a penguin and a camel on the
way. Fancy a [EMAIL PROTECTED] Just ask!!!
http://perlmonks.org/?node_id=386673


Re: Test::Kwalitee - Where is it hosted?

2005-10-04 Thread Dave Cross

David Landgren wrote:

Gavin Henry wrote:


Dear List,

In "Perl Testing - A Developers Notebook" it has a section on 
Test::Kwalitee.


I can't find this module anywhere, nothing on the CPAN or on Google.


It would only be POD, I imagine.


Anyone know where it's hosted?


Kwalitee, as in cpants.perl.org, is run by Thomas "domm" Klausner.

What is Kwalitee
http://cpants.perl.org/kwalitee.html

Y::E 2005 Braga slides by Thomas Klausner
http://domm.zsi.at/talks/2005_braga_cpants/s2.html


Actually the book strongly suggests that it's a real module which runs 
the Kwalitee checks on your code


Download and install Test::Kwalitee. Then add the following code to
your t/ directory as kwalitee.t:

#!perl

eval { require Test::Kwalitee };
exit if $@;
Test::Kwalitee->import(  );

That's from section 4.9 Validating Kwalitee.

Dave...

--
Site: http://dave.org.uk/
Blog: http://blog.dave.org.uk/
Code: http://dave.org.uk/code/


Re: Test::Kwalitee - Where is it hosted?

2005-10-04 Thread David Landgren

Gavin Henry wrote:

Dear List,

In "Perl Testing - A Developers Notebook" it has a section on Test::Kwalitee.

I can't find this module anywhere, nothing on the CPAN or on Google.


It would only be POD, I imagine.


Anyone know where it's hosted?


Kwalitee, as in cpants.perl.org, is run by Thomas "domm" Klausner.

What is Kwalitee
http://cpants.perl.org/kwalitee.html

Y::E 2005 Braga slides by Thomas Klausner
http://domm.zsi.at/talks/2005_braga_cpants/s2.html

David
--
"It's overkill of course, but you can never have too much overkill."



Test::Kwalitee - Where is it hosted?

2005-10-04 Thread Gavin Henry
Dear List,

In "Perl Testing - A Developers Notebook" it has a section on Test::Kwalitee.

I can't find this module anywhere, nothing on the CPAN or on Google.

Anyone know where it's hosted?

Thanks.

-- 
Walking the road to enlightenment... I found a penguin and a camel on the
way. Fancy a [EMAIL PROTECTED] Just ask!!!
http://perlmonks.org/?node_id=386673


Re: my $key is sensitive;

2005-10-04 Thread Michele Dondi

On Tue, 4 Oct 2005, Rafael Garcia-Suarez wrote:


language like C. So, such a "sensitive" modifier could be added, but its
precise meaning would be highly dependent on the underlying
implementation.


It would be of interest more to a perl programmer than to a Perl 
programmer. Like keys() as an lvalue in Perl5.



Michele
--

Having taken a look at that: bleech.

Thanks for the constructive feedback Ben. :-)
- Paul Marquess to Ben Morrow in clpmisc


Re: Tcl - compiling

2005-10-04 Thread Will Coleda


On Oct 4, 2005, at 5:11 AM, Leopold Toetsch wrote:



On Oct 4, 2005, at 3:52, Will Coleda wrote:



On Oct 3, 2005, at 6:34 PM, Leopold Toetsch wrote:






I don't see the point. Your compiler can emit, e.g.:

  "while"(test, body)





That's actually how things work right now (very similar to the  
interpreter from previous versions).




Not quite:

$ find lib -name '*.pir' | xargs grep 'sub.*while'
lib/commands/while.pir:.sub "&while"

You obviously have to mangle the subname first, before you can call  
it.


Yes, this is mandatory, as subs and variables must co-exist in a  
parrot namespace, but in tcl, you can have a sub and a var with the  
same name in the same namespace. This _might_ change once Matt  
Diephouse's proposal is formalized, but for now, it's the easiest  
solution. (The other is mangle the namespaces instead of the names,  
but I felt this solution would be better for language interoperability.)


I was focusing more on the dispatch part than the naming conventions  
in my earlier reply, sorry.




Is the argument that inlining will not (even theoretically)  
provide a speed boost?




No, not at all, that's fine. I just wanted to mention that there  
are still a lot of code pieces left over from the interpreter.




Oh, sure. I'm doing now the bare minimum to be called a compiler, I  
think, but this particular piece is probably going to stay,  
regardless of compile vs. interpret.


Regards.



Re: [perl #37345] [BUG] r9318: imcc label/op interference (only in test harness on win32)

2005-10-04 Thread jerry gay
On 10/4/05, jerry gay <[EMAIL PROTECTED]> wrote:
> i'll also add a statement to this effect
...to the documentation...
> , if there's not one already.


Re: [perl #37345] [BUG] r9318: imcc label/op interference (only in test harness on win32)

2005-10-04 Thread jerry gay
On 10/4/05, Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> jerry gay (via RT) wrote:
>
> >
> > D:\usr\local\parrot-bug\trunk>parrot -t imcc/t/syn/clash_8.pir
> >  0 branch 2
> >  2 if I0, 17- I0=0,
>
> I see. The test doesn't initialize I0 before testing it.
>
> I think we decided that Parrot doesn't provide pre-cleared I and N
> registers, therefore the test should start with:
>
> null I0
>
ah, of course. i remember discussion of this matter. i'll fix the
test, and look for others that may suffer the same problem. i'll also
add a statement to this effect, if there's not one already.

~jerry


Re: [perl #37338] [BUG] Parrot 0.3.0 tru64 t/pmc/string.t #13

2005-10-04 Thread Leopold Toetsch

Jarkko Hietaniemi (via RT) wrote:



t/pmc/stringok 12/35

# Failed test (t/pmc/string.t at line 556)
#  got: '0
# 1
# -1
# 128


It looks like #37338 and #37339 reveal the same, now fixed, bug as #37337.

leo



Re: [perl #37337] [BUG] Parrot 0.3.0 tru64 t/op/comp.t #7

2005-10-04 Thread Leopold Toetsch

Jarkko Hietaniemi (via RT) wrote:
# New Ticket Created by  Jarkko Hietaniemi 
# Please include the string:  [perl #37337]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/rt3/Ticket/Display.html?id=37337 >



t/op/compok 6/80

# Failed test (t/op/comp.t at line 156)
#  got: '1
# 0
# -242


Ah. That is the string compare C, which ends up in 
charset/ascii.c, where memcmp(3) is called for fixed8 encodings. The 
return result was not normalized to (-1, 1) as memcmp may need it.


Thanks for testing - fixed r9326

leo



Re: [perl #37336] [BUG] Parrot 0.3.0 t/pmc/io.t assert core dump

2005-10-04 Thread Leopold Toetsch

Jarkko Hietaniemi (via RT) wrote:
# New Ticket Created by  Jarkko Hietaniemi 
# Please include the string:  [perl #37336]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/rt3/Ticket/Display.html?id=37336 >



$ ./parrot t/pmc/io_1.pir


This is a TODO test. See also "Two core dumps.." by Nick Glencross.

leo



Re: [perl #37335] [BUG] Parrot 0.3.0 tru64 compiler serious warning

2005-10-04 Thread Leopold Toetsch

Jarkko Hietaniemi (via RT) wrote:


cc: Info: imcc/pcc.c, line 379: In this statement, an array is being
accessed o\
utside the bounds specified for the array type. (subscrbounds)^
regs[2] = arg;^
-


nice compiler


And sure enough, regs has been declared as two-element array:

SymReg *arg, *sub, *reg, *regs[2];

Assiging to the third elements is bound to be deadly.


Yeah, thanks. Can you 'svn ci' such kind of errors directly, please, if 
possible, or are you still lacking commit rights?


Anyway, fixed in r9324
leo



Re: [perl #37334] [PATCH] Parrot 0.3.0 does not compile in Tru64 because of missing socklen_t

2005-10-04 Thread Leopold Toetsch

Jarkko Hietaniemi (via RT) wrote:
# New Ticket Created by  Jarkko Hietaniemi 
# Please include the string:  [perl #37334]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/rt3/Ticket/Display.html?id=37334 >



io/io_unix.c does not compile because socklen_t is not defined.

According to the standards,  is needed to get socklen_t.


According to config/auto/headers.pl this file is tested for existance 
and actually I have the appropriate include line in 
include/parrot/parrot.h along with the PARROT_HAS_HEADER_SYSSOCKET set 
to 1 one i386/linux.


You could run

$ perl Configure.pl --verbose-step=headers

and you should see the test results

leo



Re: [perl #37345] [BUG] r9318: imcc label/op interference (only in test harness on win32)

2005-10-04 Thread Leopold Toetsch

jerry gay (via RT) wrote:



D:\usr\local\parrot-bug\trunk>parrot -t imcc/t/syn/clash_8.pir
 0 branch 2
 2 if I0, 17- I0=0,


I see. The test doesn't initialize I0 before testing it.

I think we decided that Parrot doesn't provide pre-cleared I and N 
registers, therefore the test should start with:


   null I0

leo



Re: [perl #37340] Calling vtable functions from PIR fails in 0.3.0

2005-10-04 Thread Leopold Toetsch

Roger Browne wrote:


  b = a + a

This will call the "__add" multi, whatever it is.



My real problem occurs in Amber's HLL code where I call functions like
"__add" directly (as part of the implementation of Amber's basic types),


Well, as said, that shouldn't be necessary. If your native types define 
"__add" in PIR or PMCs provide the "add" multi sub, it will be called.


Tcl defines e.g. TclInt.divide inside languages/classes/tclint.pmc and 
it is called, if MMD type signatures match.



Regards,
Roger


leo



Re: [perl #37340] Calling vtable functions from PIR fails in 0.3.0

2005-10-04 Thread Roger Browne
> ... infix multi subs take an optional 3rd argument (the 
> destination) and that there is no good means yet to denote :optional 
> NCI arguments.

OK. It's my fault for developing against the 0.2.3 release rather than
against the svn branch.

> ... Just use:
> 
>b = a + a
> 
> This will call the "__add" multi, whatever it is.

The code I posted was just a minimal example to illustrate the
regression.

My real problem occurs in Amber's HLL code where I call functions like
"__add" directly (as part of the implementation of Amber's basic types),
and therefore Amber's basic types stopped working in 0.3.0.

I will implement the ability to have inline PIR fragments within Amber
code, so that I can use the workaround you suggest. No problem.

Regards,
Roger




Re: [perl #34949] [BUG] _p_i_ic

2005-10-04 Thread Leopold Toetsch


On Oct 4, 2005, at 8:11, Joshua Hoblitt via RT wrote:




[leo - Wed Apr 13 02:18:49 2005]:

The following snippet ...

$ cat b.imc
.sub main @MAIN
 .local pmc b
 b = new BigInt
 b = 1e10
 if b > 4 goto ok
 print "never\n"
 end
ok:
 print "ok\n"
.end

... shows that the implementation of some compare opcodes is wrong:

$ ./parrot b.imc
bigint_get_long: number too big
 in file 'b.imc' near line 4

The C opcode calls VTABLE_get_integer on the PMC which isn't 
correct

in that case.

We need either a MMD_CMP_INT functions defined in vtable.tbl or less
efficiently promote the integer constant to an Integer PMC.

leo






Leo,

Is this still a valid bug?


Yep


-J


leo



Re: my $key is sensitive;

2005-10-04 Thread Rafael Garcia-Suarez
Brent 'Dax' Royal-Gordon wrote in perl.perl6.language :
> Basically, I'd like to be able to mark a variable as "sensitive" or
> "secret".  This implies that the language should overwrite the memory
> it uses before deallocating it, and that if possible it should tell
> the virtual memory system to avoid swapping it out.  Moreover, it
> should probably do so recursively, and to any value that has ever been
> stored in the variable.  (In essence, the *variable* marks all
> *values* it ever contains as sensitive.)
>
> This feature could make Perl 6 a better language for security work
> than any other I've seen.  C and C++ could do this, but only with the
> programmer's assistance (by calling a "wipe" function or making sure a
> destructor is correctly called), and optimizers have been known to
> "helpfully" remove such code.

Isn't the "volatile" modifier supposed to avoid this ?

Oh, and remark that "volatile" is quite a high-level construct for a
language like C. So, such a "sensitive" modifier could be added, but its
precise meaning would be highly dependent on the underlying
implementation.

-- 
The universe (which others call the Library) is composed of an indefinite and
perhaps infinite number of hexagonal galleries.
-- Borges


Re: [PATCH] Add BROKEN.pod

2005-10-04 Thread Joshua Hoblitt
On Mon, Oct 03, 2005 at 06:17:30PM -0700, chromatic wrote:
> 
> I'll check this in in two days with regard to feedback from anyone whose
> opinion matters and what to call it and where to put it, if my initial
> choice isn't perfect.

I'm wondering if this wouldn't be better split up into RT tickets
similar to the way TODOs are handled.  Having everything in one coherent
document is great but I suspect that significantly lowers the odds of
the individual items being kept up to date.

Cheers,

-J

--


pgptFKTvPnjDo.pgp
Description: PGP signature


[perl #37345] [BUG] r9318: imcc label/op interference (only in test harness on win32)

2005-10-04 Thread via RT
# New Ticket Created by  jerry gay 
# Please include the string:  [perl #37345]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/rt3/Ticket/Display.html?id=37345 >


D:\usr\local\parrot-bug\trunk>perl t/harness imcc/t/syn/clash.t
imcc/t/syn/clashok 7/15
imcc/t/syn/clashNOK 8# Failed test (imcc/t/syn/clash.t at line 151)
#  got: 'nok
# '
# expected: 'ok
# '
imcc/t/syn/clashok 15/15# Looks like you failed 1 test of 15.
imcc/t/syn/clashdubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 8
Failed 1/15 tests, 93.33% okay
Failed TestStat Wstat Total Fail  Failed  List of Failed
---
imcc/t/syn/clash.t1   256151   6.67%  8
Failed 1/1 test scripts, 0.00% okay. 1/15 subtests failed, 93.33% okay.

D:\usr\local\parrot-bug\trunk>parrot -t imcc/t/syn/clash_8.pir
 0 branch 2
 2 if I0, 17- I0=0,
 5 if I0, 14- I0=0,
 8 inc I0   - I0=0
10 unless I0, 9 - I0=1,
13 unless I0, 6 - I0=1,
16 print "ok\n"
ok
18 end

D:\usr\local\parrot-bug\trunk>

~jerry


Re: [perl #37340] Calling vtable functions from PIR fails in 0.3.0

2005-10-04 Thread Leopold Toetsch


On Oct 3, 2005, at 21:58, Roger Browne (via RT) wrote:


Under Parrot 0.2.3 the following PIR program prints "4" as
expected:

.sub "main" @MAIN
   .local pmc a, b
   a = new Integer
   a = 2
   b = a.__add(a)
   print b
   print "\n"
   end
.end

Under Parrot 0.3.0 the same code fails like this:

parrot: src/nci.c:72: get_nci_P: Assertion `n < st->src.n' failed.


Yep. The equivalent tests in t/pmc/mmd.t are still skipped. The problem 
is that the infix multi subs take an optional 3rd argument (the 
destination) and that there is no good means yet to denote :optional 
NCI arguments.


But please note that there is hardly a real need to invoke the method 
directly. Just use:


  b = a + a

This will call the "__add" multi, whatever it is.

leo



Re: Tcl - compiling

2005-10-04 Thread Leopold Toetsch


On Oct 4, 2005, at 3:52, Will Coleda wrote:


On Oct 3, 2005, at 6:34 PM, Leopold Toetsch wrote:




I don't see the point. Your compiler can emit, e.g.:

  "while"(test, body)



That's actually how things work right now (very similar to the 
interpreter from previous versions).


Not quite:

$ find lib -name '*.pir' | xargs grep 'sub.*while'
lib/commands/while.pir:.sub "&while"

You obviously have to mangle the subname first, before you can call it.

Is the argument that inlining will not (even theoretically) provide a 
speed boost?


No, not at all, that's fine. I just wanted to mention that there are 
still a lot of code pieces left over from the interpreter.



Regards.


leo