Re: Slicing conflict

2005-04-12 Thread Brent 'Dax' Royal-Gordon
Luke Palmer <[EMAIL PROTECTED]> wrote:
> In Perl 5:
> 
> my @a = (1,2,3);
> my @b = @a[0..3];
> print scalar(@b);   # 4
> 
> But in Perl 6:
> 
> my @a = (1,2,3,4);
> my @b = @a[1...];  # elements from 1 onward
> say [EMAIL PROTECTED];   # should probably be 3, but with Perl 5 
> semantics is Inf
> 
> We have to break one of these.  I think the former is the one to break,
> even though that might cause some unexpected surprises here and there.
> Any ideas?

I was thinking about this today, actually, because my CS textbook was
talking about multidimensional arrays.  If we make an infinite index
mean "slice until you can slice no more", then we can possibly have a
C> which is the same as C<0...>.  That means we can slice
like this:

@foo[1,3; *; 7]

Which I rather like.  (Although term:<*> might conflict with
prefix:<*>...hmm.  I'm not sure it would in common usage--the only
things I can think of that could follow are a dot, opening or closing
bracket, semicolon or comma, or hyperoperator, none of which are
ambiguous if we stick to the no-whitespace-before-postcircumfix rule.)

By the way, this also shortens the common idiom:

@[EMAIL PROTECTED]

To simply:

@foo[3...]

Which strikes me as a win.

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

"I used to have a life, but I liked mail-reading so much better."


Re: imcc/ directory

2005-04-12 Thread Bernhard Schmalhofer
MrJoltCola wrote:
At 06:57 PM 4/11/2005, Matt Diephouse wrote:
Now that IMCC is a core part of Parrot, I'd like to see the imcc/
directory go away. 

Technically IMCC should be separate
I think mild separation that still exists is a good thing. IMCC does
not actually execute anything, it is a "registered" front-end that
handles PIR and PASM. You could add another front-end
called PIR2 if you wanted. It just so happens that IMCC is the
default front-end.
Actually there is already a second front end, PAST, which resides in the 
'ast/' directory.
It might make sense to refactor 'imcc/main.c' and split it into e.g. 
'src/main.c' and 'imcc/frontend.c'. This would make the distinction more 
clear, and would provide an opportunity to clean up the exported symbols.

CU, Bernhard
--
**
Dipl.-Physiker Bernhard Schmalhofer
Senior Developer
Biomax Informatics AG
Lochhamer Str. 11
82152 Martinsried, Germany
Tel: +49 89 895574-839
Fax: +49 89 895574-825
eMail: [EMAIL PROTECTED]
Website: www.biomax.com
**


Re: Whither "use English"?

2005-04-12 Thread Michele Dondi
On Mon, 11 Apr 2005, Juerd wrote:
Seriously, is there some reason that we would not provide a
"Language::Russian" and "Language::Nihongo"? Given Perl 6, it would even
[snip]
Because providing it leads to its use, and when it gets used, knowing
English is no longer enough.
I have some code that uses Dutch variable names. When I show that code
to people who can't read any Dutch, they have a hard time finding out
Which reminds me of the TeX format ConTeXt which is (told to be) somehow 
more powerful and modern wrt LaTeX, but has a much narrower user base, and 
IIRC is expressedly design to support localized user interfaces, the only 
existing one should actually be ductch. I'd be curious to know if and how 
this works amongst ConTeXt users...

Michele
--
[...] is like requiring to play tennis with a square ball.
Which admittedly makes the game more interesting.
- Giuseppe "Oblomov" Bilotta in comp.text.tex (edited)


Takers wanted - a perl job

2005-04-12 Thread Leopold Toetsch
t/src/manifest.t tests 3 and 4 used to compare MANIFEST file entries 
against CVS/Entries. The latter is now .svn/entries with an xmlish syntax.
The job is now to replace t/src/manifest.t:scan_cvs so that it extracts 
C items from .svn/entries and descends into C 
subdirectories. And no - I don't think, we need a full-fledged XML 
parser for this.

Thanks,
leo


Re: [perl #34704] [PATCH] get SDL running on win32

2005-04-12 Thread Leopold Toetsch
Jerry Gay <[EMAIL PROTECTED]> wrote:

>> > the attached patch gets the SDL library and examples running on win32.

Are there more Win32 libs that have the same naming conventions:

  unixish:   win32:
  libSDL SDL

The question is, if the dynext loader should try to strip "^lib" off the
library name.

leo


Re: [perl #34912] Badly balanced at classes/pmc2c2.pl

2005-04-12 Thread Leopold Toetsch
Jrieks @ Wmit00 . It . Math . Uni-Wuppertal . De <[EMAIL PROTECTED]> wrote:

> wmit01 ~ > perl -v

> This is perl, v5.6.0 built for i586-linux

As it seems to be a perl issue, please check the relevant part of the
PMC compiler. IIRC there was a patch regarding C not
too long ago.

leo


Re: imcc/ directory

2005-04-12 Thread Leopold Toetsch
Matt Diephouse <[EMAIL PROTECTED]> wrote:
> Now that IMCC is a core part of Parrot, I'd like to see the imcc/
> directory go away. I'd be willing to spend some time trying to prepare
> some patches (it'd be a good way to become more familiar with the
> source), but I have a few questions first:

>  (1) Is this desirable?

As Melvin already stated, no: IMCC is a distinct subsystem of parrot
namely the PASM/PIR compilers (or assemblers). If you like to spend time
on it, I'd prefer the following instead:

- split PASM/PIR parsers and lexers into tow distinct file pairs
- make the C<.macro> pre-processor a separate pass

>  (2) Does IMCC's version number ever differ from Parrot's?

We probably don't need the IMCC_VERSION.

>  (3) Should all the headers in imcc/ be moved to include/parrot/?

No, they are mostly private to IMCC. But we need eventually a public
compiler interface, which should reside inside include/parrot.

>  (4) Should all the files be moved to src/?

No with one exception: imcc/sets.c is a file implementing a bit set. All
functions should get a Parrot prefix and an interpreter argument.

>  (5) Should the contents of the docs/, examples/, and t/ directories
> be moved to the root directories of the same names?

imcc/examples is useless, it can go away. imcc/docs needs some updates.
Especially syntax.pod sould be pasm.pod and pir.pod. Both are not quite
up-to-date. The tests are for testing the assemblers and should stay
there.

>  (6) Is there a document i should be reading about Parrot's directory
>  structure?

Probably:
$ perldoc -F docs/pdds/pdd07_codingstd.pod
/Subsystems

>  (7) Should IMCC_ functions stay with that prefix or be renamed to use
> Parrot_ or something similar?

The IMCC_ prefix is fine.

>  (8) Is there any reason to keep src/parrot.c around?

I'd like that to be eventually the real start program. It should parse
the commandline arguments and select an appropriate compiler depending
on the source filetype. One of these compilers is IMCC (or two :)

>  (9) Is there anything else I should be aware of?

Yes ;)

> Thanks.

leo


Re: Takers wanted - a perl job

2005-04-12 Thread Michael G Schwern
On Tue, Apr 12, 2005 at 11:08:30AM +0200, Leopold Toetsch wrote:
> t/src/manifest.t tests 3 and 4 used to compare MANIFEST file entries 
> against CVS/Entries. The latter is now .svn/entries with an xmlish syntax.
> The job is now to replace t/src/manifest.t:scan_cvs so that it extracts 
> C items from .svn/entries and descends into C 
> subdirectories. And no - I don't think, we need a full-fledged XML 
> parser for this.

No need to parse the XML files, "svn list -R" lists everything in the repo.

And I suppose I just volunteered myself for the job.



Re: Takers wanted - a perl job

2005-04-12 Thread Nicholas Clark
On Tue, Apr 12, 2005 at 02:50:57AM -0700, Michael G Schwern wrote:

> No need to parse the XML files, "svn list -R" lists everything in the repo.
> 
> And I suppose I just volunteered myself for the job.

$ svn list -R
svn: '.' is not a working copy

Doesn't work when svk is used to check out the copy. But in that case
svk list -R does.

Nicholas Clark



S27 Draft

2005-04-12 Thread Brian Ingerson
I've taken a shot at starting a Synopsis 27 as well:

http://svn.openfoundry.org/pugs/docs/S27draft.pod

Cheers, Brian


Re: Takers wanted - a perl job

2005-04-12 Thread Ron Blaschke
Leopold Toetsch wrote:
> t/src/manifest.t tests 3 and 4 used to compare MANIFEST file entries
> against CVS/Entries. The latter is now .svn/entries with an xmlish syntax.
> The job is now to replace t/src/manifest.t:scan_cvs so that it extracts
> C items from .svn/entries and descends into C 
> subdirectories. And no - I don't think, we need a full-fledged XML 
> parser for this.

No XML parser?  Bummer, it would be sooo much simpler. ;-)

C:\parrot\.svn>perl -MXML::Simple -MData::Dumper
-e"print(join \"\n\", keys %{XMLin('entries')->{entry}})"

encodings
ops
pf
ast
PBC_COMPAT
MANIFEST
...
VERSION
build_tools
README

Ron



Re: Blocks, continuations and eval()

2005-04-12 Thread Piers Cawley
wolverian <[EMAIL PROTECTED]> writes:

> On Fri, Apr 08, 2005 at 12:18:45PM -0400, MrJoltCola wrote:
>> I cannot say how much Perl6 will expose to the high level language.
>
> That is what I'm wondering about. I'm sorry I was so unclear.
>
>> Can you tell me what your idea of a "scope" is? I'm thinking a
>> continuation, and if that is what you are thinking, I'm thinking the
>> answer to your question is yes.
>
> Yes. I want to know how Perl 6 exposes continuations, and how to get one
> for, say, the current lexical scope, and if it has a method on it that
> lets me evaluate code in that context (or some other way to do that).

As I understand what Larry's said before. Out of the box, it
doesn't. Apparently we're going to have to descend to Parrot to write
evalcc/letcc/your-preferred-continuation-idiom equivalent. 


Re: Question about list context for String.chars

2005-04-12 Thread Larry Wall
On Mon, Apr 11, 2005 at 03:53:32PM -0400, Mark Reed wrote:
(B: I think that, in general, at the level of Perl code, 1 
$B!H(Bcharacter$B!I(B should be
(B: one code point, and any higher-level support for combining and splitting
(B: should be outside the core, in Unicode::Whatever.
(B
(BI think the default should be language-independent graphemes, and
(Bthat support for all Unicode levels below that is in the core, while
(Ball of the many level 4 ("use French") modules should come standard,
(Bwhich is core by some definition.
(B
(BLarry

Re: Blocks, continuations and eval()

2005-04-12 Thread Larry Wall
On Tue, Apr 12, 2005 at 11:36:02AM +0100, Piers Cawley wrote:
: wolverian <[EMAIL PROTECTED]> writes:
: 
: > On Fri, Apr 08, 2005 at 12:18:45PM -0400, MrJoltCola wrote:
: >> I cannot say how much Perl6 will expose to the high level language.
: >
: > That is what I'm wondering about. I'm sorry I was so unclear.
: >
: >> Can you tell me what your idea of a "scope" is? I'm thinking a
: >> continuation, and if that is what you are thinking, I'm thinking the
: >> answer to your question is yes.
: >
: > Yes. I want to know how Perl 6 exposes continuations, and how to get one
: > for, say, the current lexical scope, and if it has a method on it that
: > lets me evaluate code in that context (or some other way to do that).
: 
: As I understand what Larry's said before. Out of the box, it
: doesn't. Apparently we're going to have to descend to Parrot to write
: evalcc/letcc/your-preferred-continuation-idiom equivalent. 

We'll make continuations available in Perl for people who ask for
them specially, but we're not going to leave them sitting out in the
open where some poor benighted pilgrim might trip over them unawares.

Larry


Re: Slicing conflict

2005-04-12 Thread Larry Wall
On Tue, Apr 12, 2005 at 12:08:43AM -0700, Brent 'Dax' Royal-Gordon wrote:
: I was thinking about this today, actually, because my CS textbook was
: talking about multidimensional arrays.  If we make an infinite index
: mean "slice until you can slice no more", then we can possibly have a
: C> which is the same as C<0...>.  That means we can slice
: like this:
: 
: @foo[1,3; *; 7]
: 
: Which I rather like.

Me too.  Unless my memory is failing me, I believe that's what S09
already specifies.

Larry


Re: Question about list context for String.chars

2005-04-12 Thread Larry Wall
On Mon, Apr 11, 2005 at 01:08:04PM -0700, gcomnz wrote:
: I read "followed by 0 or more combining characters" to mean that it is
: smart enough to combine the vowels in Arabic and other syllabic
: alphabets that use special conjuncts. However I'm also not exactly
: sure if that's even reasonably possible, or even if it makes sense in
: the counting of "characters" for languages that use those.

The "0 or more combining characters" is relying on the exact
definition of combining character in Unicode, which is construed as
(somewhat) language-independent.  But the language-dependent level
can split up characters in whatever way makes sense to a native
speaker of the language.  That's what it's there for.  But you
actually have to declare up front what language you want to work in.
Language-independent graphemes is the highest we can go by default,
and that's where I think we should go by default, because that's
closest to what the naïve user will expect.  The smart people will
know to drop to codepoints or bytes when they need that.

Larry


Re: Phalanx kwiki

2005-04-12 Thread James E Keenan
Walter Goulet wrote:
Looks like the phalanx kwiki as well as the phalanx subversion 
repository is down.

Any ETA on when it will be back up?
I can get the repository but not the kwiki.  But, IIRC, the kwiki is 
hosted by Ingy and is physically independent of the repository, which I 
believe is hosted by perl.org.

jimk


Re: Whither "use English"?

2005-04-12 Thread David Cantrell
On Mon, Apr 11, 2005 at 03:42:25PM -0400, Aaron Sherman wrote:
> I don't think you can say (as Larry has) that you want to be able to
> fully re-define the language from within itself and still impose the
> constraint that "it can't confuse people who don't know anything about
> my module."
> 
> You might argue that Language::Dutch should never ship with the core...
> that's a valid opinion, but SOMEONE is going to write it. It'd be a kind
> of strange form of censorship for CPAN not to accept it. After all,
> there's more than one way to say it... isn't there?

While it may be possible to do it, and while it may be an interesting
exercise to implement it, that doesn't mean that anyone *using* it for
anything other than a joke isn't a blithering idiot.

> > I'm not even sure I like the *possibility* of using non-ascii letters in
> > identifiers, even.
> I think we already have Latin-1 in identifiers...

more's the pity.

> Let's see about UTF-8
> pugs> my $??? = 1;
> undef
> pugs> $???;
> 1

I see a sequence of three question marks, there's no funny foreign
characters there.  I have to confess to being surprised that $??? is
legal.

-- 
David Cantrell | Benevolent Dictator Of The World

May your blessings always outweigh your blotches!
-- Dianne van Dulken,
   in alt.2eggs...


Re: Whither "use English"?

2005-04-12 Thread Juerd
Thomas Yandell skribis 2005-04-12 13:13 (+0100):
> According to Wikipedia there are around 400 million native English speakers 
> and 600 million people who have English as a second language. Should the 
> remaining ~5.5 billion humans be exluded from writing perl code just so that 
> we English speakers can understand all the code that is written?

Yes.

But your numbers are utterly useless, as they are counts of humans, not
programmers. I think that the number of programmers who don't understand
English is very small. They know English because historically, the
programmer's world has been English. 

Of course, the level of comprehension differs greatly. That's why where
things get hard, Perl lets you write the "wrong" thing, like 1th and
2th, maybe even 5rd and 7nd. And documentation should be written as
simply and clearly as possible. If a word like "mnemonic" is used, it
should first be explained.

And keywords are new to any programmer anyway. Mnemonically, it may be
easy to remember that say prints something, but it certainly doesn't say
anything. And how is remembering "my" or "readline" or "try" any harder
than the many not-at-all-english \W operators that Perl has?

Then, there are books, documentation, mailing lists and fora, most of
which are available in English only. A small part is translated, but
I find it hard to believe that the translated portion can be enough.
(Still, having them around does help many people, and that's why I think
perldocs should perhaps come in several languages (as a different
project, so translation delays don't delay Perl releases)).


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


Re: Whither "use English"?

2005-04-12 Thread Nicholas Clark
On Tue, Apr 12, 2005 at 02:38:01PM +0200, Juerd wrote:

> (Still, having them around does help many people, and that's why I think
> perldocs should perhaps come in several languages (as a different
> project, so translation delays don't delay Perl releases)).

"Should" ?

Who is going to pay for all these translations?

There are already volunteer efforts to translate into Japanese and Italian,
according to http://www.perl.org/docs.html plus I'm aware of perlchina.org,
which is actively translating documentation to Chinese:

http://wiki.perlchina.org/main/recently_revised/

Nicholas Clark


Re: Whither "use English"?

2005-04-12 Thread Juerd
Nicholas Clark skribis 2005-04-12 13:58 (+0100):
> > (Still, having them around does help many people, and that's why I think
> > perldocs should perhaps come in several languages (as a different
> > project, so translation delays don't delay Perl releases)).
> "Should" ?

Yes, should. That's ideology, though.

> Who is going to pay for all these translations?

Who is going to pay for Parrot? Perl 6? Who's paying for Pugs? Who's
going to pay for perldocs in English? 

Did I miss some important memo?

Many people work on Perl 6 voluntarily, and as many could work on
translations, but you need an army of translators to keep up with newer
versions, and that's why I think it should be official, so it gets
lots of attention.

> There are already volunteer efforts to translate into Japanese and Italian,
> according to http://www.perl.org/docs.html plus I'm aware of perlchina.org,
> which is actively translating documentation to Chinese:
> http://wiki.perlchina.org/main/recently_revised/

That's nice, but were this an international project for in theory any
language in existence, then I had probably heard of it much sooner,
which is my argument for making translated perldocs an official project
that isn't limited to any language.


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


Re: Whither "use English"?

2005-04-12 Thread Andrew Rodland
On Tuesday 12 April 2005 07:42 am, David Cantrell wrote:
> On Mon, Apr 11, 2005 at 03:42:25PM -0400, Aaron Sherman wrote:

> > > I'm not even sure I like the *possibility* of using non-ascii letters
> > > in identifiers, even.
> >
> > I think we already have Latin-1 in identifiers...
>
> more's the pity.
>
> > Let's see about UTF-8
> > pugs> my $??? = 1;
> > undef
> > pugs> $???;
> > 1
>
> I see a sequence of three question marks, there's no funny foreign
> characters there.  I have to confess to being surprised that $??? is
> legal.

If it helps any, the problem is somewhere betwen lists.develooper.com and your 
eyes; the missing doodad was U+0E81 LAO LETTER KO, which is pleasantly curvy.


Re: Whither "use English"?

2005-04-12 Thread David Cantrell
On Tue, Apr 12, 2005 at 02:38:01PM +0200, Juerd wrote:
> Thomas Yandell skribis 2005-04-12 13:13 (+0100):
> > According to Wikipedia there are around 400 million native English speakers 
> > and 600 million people who have English as a second language. Should the 
> > remaining ~5.5 billion humans be exluded from writing perl code just so that
> > we English speakers can understand all the code that is written?
> But your numbers are utterly useless, as they are counts of humans, not
> programmers. I think that the number of programmers who don't understand
> English is very small. They know English because historically, the
> programmer's world has been English. 

There's another issue that he didn't address.

OK, let's allow identifiers in (say) Urdu.  That's great for the three
people in the entire world who speak Urdu, right up to the moment that
they want their English, or Russian, or German, or Japanese users to
submit patches.

-- 
David Cantrell | London Perl Mongers Deputy Chief Heretic

It's my experience that neither users nor customers can articulate
what it is they want, nor can they evaluate it when they see it
-- Alan Cooper


Re: Whither "use English"?

2005-04-12 Thread Thomas Yandell
> > > I'm not even sure I like the *possibility* of using non-ascii letters 
> in
> > > identifiers, even.
> > I think we already have Latin-1 in identifiers...
> 
> more's the pity.


According to Wikipedia there are around 400 million native English speakers 
and 600 million people who have English as a second language. Should the 
remaining ~5.5 billion humans be exluded from writing perl code just so that 
we English speakers can understand all the code that is written? I think 
not.
Tom


Re: Whither "use English"?

2005-04-12 Thread Thomas Yandell
But your numbers are utterly useless, as they are counts of humans, not
> programmers. I think that the number of programmers who don't understand
> English is very small. They know English because historically, the
> programmer's world has been English.


My point was that English speakers are in a minority and that the current 
bias towards English speakers is not necessarily a good thing, and 
definitely not something we should seek to preserve.

> Of course, the level of comprehension differs greatly. That's why where
> things get hard, Perl lets you write the "wrong" thing, like 1th and
> 2th, maybe even 5rd and 7nd. And documentation should be written as
> simply and clearly as possible. If a word like "mnemonic" is used, it
> should first be explained.
> 
> And keywords are new to any programmer anyway. Mnemonically, it may be
> easy to remember that say prints something, but it certainly doesn't say
> anything. And how is remembering "my" or "readline" or "try" any harder
> than the many not-at-all-english \W operators that Perl has?



My point was in response to the expressed sentiment that non-ascii letters 
should not be used in identifiers, rather than in keywords. 

Then, there are books, documentation, mailing lists and fora, most of
> which are available in English only. A small part is translated, but
> I find it hard to believe that the translated portion can be enough.
> (Still, having them around does help many people, and that's why I think
> perldocs should perhaps come in several languages (as a different
> project, so translation delays don't delay Perl releases)).


I sincerely hope that one day there will be perl books written by 
non-English speakers that I can find English translations for ;-)
Tom


Re: [perl #34704] [PATCH] get SDL running on win32

2005-04-12 Thread jerry gay
On 12 Apr 2005 09:44:08 -, Leopold Toetsch via RT <
[EMAIL PROTECTED]> wrote: 
> 
> Jerry Gay <[EMAIL PROTECTED]> wrote:
> 
> >> > the attached patch gets the SDL library and examples running on 
> win32.
> 
> Are there more Win32 libs that have the same naming conventions:
> 
> unixish: win32:
> libSDL SDL
> 
> The question is, if the dynext loader should try to strip "^lib" off the
> library name.

 the convention on windows is not to include the "lib" prefix, however there 
are exceptions. notably, the windows svn client, and trillian, my irc 
client. centralizing the logic of loading libraries so it Just Works on any 
platform makes sense to me. this should follow for other conventions on 
other platforms, as well. i dunno what macOS and os2 do.
 and then i could stop patching runtime libraries and move on to something 
more exciting :)
 
> leo

 ~jerry


Re: Whither "use English"?

2005-04-12 Thread Nicholas Clark
On Tue, Apr 12, 2005 at 03:09:10PM +0200, Juerd wrote:
> Nicholas Clark skribis 2005-04-12 13:58 (+0100):
> > > (Still, having them around does help many people, and that's why I think
> > > perldocs should perhaps come in several languages (as a different
> > > project, so translation delays don't delay Perl releases)).
> > "Should" ?
> 
> Yes, should. That's ideology, though.

I read "should" as a danger word. It's often person A describing a desirable
feature and intimating that unspecified other people B-Z ought to be
implementing it.

> > Who is going to pay for all these translations?
> 
> Who is going to pay for Parrot? Perl 6? Who's paying for Pugs? Who's
> going to pay for perldocs in English? 
> 
> Did I miss some important memo?
> 
> Many people work on Perl 6 voluntarily, and as many could work on
> translations, but you need an army of translators to keep up with newer
> versions, and that's why I think it should be official, so it gets
> lots of attention.

You missed an important social observation. Many *programmers* work on these
projects voluntarily because they find programming fun. Translation isn't
programming, so it's unlikely to be as appealing to the majority of the
community involved in Perl 6 currently.

> That's nice, but were this an international project for in theory any
> language in existence, then I had probably heard of it much sooner,
> which is my argument for making translated perldocs an official project
> that isn't limited to any language.

Would you be volunteering to organise this?


It's nothing personal if I'm sounding harsh. There is always this great
temptation to assign jobs to the "they" department. ("They should do this"
"They should do that"). There is no "they" department in a volunteer
organisation - stuff happens because people care about it enough to do it
themselves.

Nicholas Clark


Re: SVN revision (was: [perl #xxxxxx] Badly balanced at classes/pmc2c2.pl)

2005-04-12 Thread Jens Rieks
On Monday 11 April 2005 17:54, Leopold Toetsch wrote:
> BTW: a nice to have: include SVN revision of local copy in bug report.
I'll implement it. 

jens


Re: Whither "use English"?

2005-04-12 Thread Juerd
Nicholas Clark skribis 2005-04-12 14:34 (+0100):
> > Yes, should. That's ideology, though.
> I read "should" as a danger word. It's often person A describing a desirable
> feature and intimating that unspecified other people B-Z ought to be
> implementing it.

Please note that I try to not think about who's going to implement it at
all. That makes being creative and coming up with good ideas much, much
easier.

Yes, if it is done, people are indeed involved, but if we all agree that
something must happen, that's not terribly relevant. And before we can
agree, someone must first let it enter discussion.

> Translation isn't programming, so it's unlikely to be as appealing to
> the majority of the community involved in Perl 6 currently.

If it wasn't for all the pain in my wrists, hands and arms, I would
already have translated perldocs and Beginning Perl (1st ed.) to Dutch.
And I can't imagine I'm the only language nerd who also understands
Perl. Translations work well for lots of other software, and I don't see
why software for programming languages would be any different.

> Would you be volunteering to organise this?

When/if I have the time and health to spend on it, certainly. This is
one of the many things I'd love to do, but at the moment can't.

> There is no "they" department in a volunteer organisation - stuff
> happens because people care about it enough to do it themselves.

Of course there is a they. Many of them even. Let me list a few groups
of people commonly referred to as "they":

* parrot people
* @Larry
* perldoc/doc/kwid people
* p6l people
* the people who will be writing perl6

I'm one of the people who has ideas but is currently unable to help
implementing them. I can discuss them, though, and I hope that my input
can somehow, even though I'm not writing any code, help make Perl 6
a great language. For me, there is a very large "they", and without them,
there'd never be a Perl 6.

If stuff is only happening because people care about it, then my
approach should be to try and make people care, and a mailing list like
this is a perfect medium for that.


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


Re: Whither "use English"?

2005-04-12 Thread Juerd
Juerd skribis 2005-04-12 15:46 (+0200):
> Please note that I try to not think about who's going to implement it at
> all. That makes being creative and coming up with good ideas much, much
> easier.

And to be honest, it makes coming up with bad ideas much easier than
that even :)


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


Re: [PATCH] Dynamic Perl, 2 [t/]

2005-04-12 Thread Leopold Toetsch
William Coleda <[EMAIL PROTECTED]> wrote:
> Or, rather, find the attached patch here:

> https://rt.perl.org/rt3/Ticket/Attachment/110536/75860/dynamic_perl2.patch

Thanks, applied.
leo


Re: Whither "use English"?

2005-04-12 Thread Nicholas Clark
On Tue, Apr 12, 2005 at 03:46:03PM +0200, Juerd wrote:

> Yes, if it is done, people are indeed involved, but if we all agree that
> something must happen, that's not terribly relevant. And before we can


That's another dangerous word.

> If stuff is only happening because people care about it, then my
> approach should be to try and make people care, and a mailing list like
> this is a perfect medium for that.

This I agree with completely. It's the right way to go about things, as
you're not able to do them in person.

It's just dangerous words such as "should" and "must" that I don't like,
because they start to sound like they're imposing obligations on
volunteers. Maybe I'm jaded, but if you read enough feedback about Perl 5
it seems that there are an awful lot of people in the world using it who
seem to expect rather a lot for nothing. I'd just like people to be careful
in their choice of words when suggesting things.

Nicholas Clark


Re: Whither "use English"?

2005-04-12 Thread Nicholas Clark
On Tue, Apr 12, 2005 at 03:48:02PM +0200, Juerd wrote:
> Juerd skribis 2005-04-12 15:46 (+0200):
> > Please note that I try to not think about who's going to implement it at
> > all. That makes being creative and coming up with good ideas much, much
> > easier.
> 
> And to be honest, it makes coming up with bad ideas much easier than
> that even :)

Good point. Saves having to ask "how would I do that?", let alone answer
it :-)

Nicholas Clark


Re: Whither "use English"?

2005-04-12 Thread Juerd
Nicholas Clark skribis 2005-04-12 14:52 (+0100):
> > Yes, if it is done, people are indeed involved, but if we all agree that
> > something must happen, that's not terribly relevant. And before we can
> 
> That's another dangerous word.

Not in combination with "if we all agree" :)

> I'd just like people to be careful in their choice of words when
> suggesting things.

My English is very basic, so there is probably a simple way to avoid
these dangerous words that I don't yet know. If you have any suggestions
not involving long phrases like "would be very nice to have", please let
me know. I suggest we continue this branch of the thread in private,
then.


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


Re: Whither "use English"?

2005-04-12 Thread Aaron Sherman
On Tue, 2005-04-12 at 07:42, David Cantrell wrote:

> > You might argue that Language::Dutch should never ship with the core...
> > that's a valid opinion, but SOMEONE is going to write it. It'd be a kind
> > of strange form of censorship for CPAN not to accept it. After all,
> > there's more than one way to say it... isn't there?
> 
> While it may be possible to do it, and while it may be an interesting
> exercise to implement it, that doesn't mean that anyone *using* it for
> anything other than a joke isn't a blithering idiot.

We're all programmers (I assume), and we've all come across environments
where programming tools that seemed useless or silly in one environment
were critical in another. The education example I gave is an ideal one,
but there are dozens of others from any number of fields. Perl 6 offers
us the opportunity to create true dialects, and dialects are valuable
things.

I don't recommend that everyone rush in and use such a module, but it
has its value.

> > > I'm not even sure I like the *possibility* of using non-ascii letters in
> > > identifiers, even.
> > I think we already have Latin-1 in identifiers...
> 
> more's the pity.

This is just ASCII prejudice (which seems strange, as your domain
implies you're not here in the US where such prejudice is usually
assumed). There's nothing fundamentally wrong with having $Ãther as a
variable name, other than the fact that most Americans are confused by
it because they think "Ã" and "ae" are identical. They're wrong. We've
already deeply embraced the Latin-1 character set for many purposes in
Perl 6.

I *would* however, have a "use warning " type of thing which
would warn on the use of any Unicode character in an identifier whose
standard display form is difficult to distinguish from some more
commonly used character's display form. For example, "Æ" is just a bit
too close to "b", so you might want to warn the user unless their
default locale was one where it's commonly used, or at least provide a
facility for requesting such warnings.

> > Let's see about UTF-8
> > pugs> my $??? = 1;
> > undef
> > pugs> $???;
> > 1
> 
> I see a sequence of three question marks, there's no funny foreign
> characters there.  I have to confess to being surprised that $??? is
> legal.

That's either a bug in your mailer (or possibly something that tried to
re-encode your mail for you) or the fact that you're using some ancient
output device that doesn't grok Unicode character sequences. It's
refusing to display perfectly valid "Content-Type: text/plain;
charset=UTF-8" mail in "Content-Transfer-Encoding: quoted-printable"
correctly. It should render "pugs> my $=E0=BA=81 =3D 1;" as the
appropriate Unicode sequence.

Certainly we've already stated that the default encoding of Perl 6
programs will be UTF-8, and that means that such sequences are valid,
and all editors I know of handle these sequences correctly (Emacs, vim,
eclipse, etc.)

I don't see why stopping someone in Russia from writing code in their
native syllabary is wrong... after all, they're probably not going to
use ASCII to represent words that I can read anyway... they're going to
use ASCII to write a romanized form of their own language. Restrictions
on style should be performed at a higher level. For example the new CPAN
for Perl 6 might have some qualifiers that you can attach to your
programs that describe character set used and other stylistic
conventions. That way, I might choose to look for only modules that are
written in a language that I feel comfortable maintaining. Then again, I
might not care, and just install whatever works.

-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback




Re: [perl #34704] [PATCH] get SDL running on win32

2005-04-12 Thread Leopold Toetsch
jerry gay wrote:
On 12 Apr 2005 09:44:08 -, Leopold Toetsch via RT <
[EMAIL PROTECTED]> wrote: 

The question is, if the dynext loader should try to strip "^lib" off the
library name.
 the convention on windows is not to include the "lib" prefix, however there 
are exceptions.
Ok, let's try it. Please test rev 7813.
leo


subscripts are.... objects?

2005-04-12 Thread Yuval Kogman

We blitzed a discussion on #perl 3 minutes ago, reaching the
conclusion that negated subscripts are cool.

So i was thinking:

subscripts are objects.

They are sets, really.

You can perform set operations on them:

[!-2]

is the subscript for everything but the second to last element.

By using a context enforcer (subscript [] ?, maybe since lists are
lazyy they can just be subscripts when used that way?) you can get a
subscript object, which you can then use in a subscript, and it
flattens out.

The set math is done by special casing junctions, perhaps?


my @array;

@array[$subscript];
@array[$other];

@array[$subscript | $other]; # union
@array[$subscript & $other]; # intersection

@array[!-1]; # -1 but false? this means that it's masking

my $not_1 = [!-1];

@array[$subscript & $not_1]; # subscript without -1
@array[$subscript | $not_1]; # subscript with -1, since it's a union
# with the complement of just -1


I've found myself replicating sets like these for accessing data
many a time in perl 5.

Maybe if refined this can be useful?

-- 
 ()  Yuval Kogman <[EMAIL PROTECTED]> 0xEBD27418  perl hacker &
 /\  kung foo master: /me wields bonsai kittens: neeyah



pgpQp5v4Xx9wd.pgp
Description: PGP signature


Win32 with ICU files build problem

2005-04-12 Thread Solinski, Mark
Following the instructions in README.Win32 (which has been successful
for me in the past), no longer works successfully.  First, I cannot run
Configure.pl successfully; it complains about --icudatadir not being
defined (again not one of the --icu* options mentioned in README.Win32
AND not necessary before).  Defining --icudatadir, I now get the
following error during make:

Src\string_primitives.c(24) : fatal error C1083: Cannot open include
file: 'unicode/ucnv.h': No such file or directory

I had defined --icuheaders in my call to Configure in whose directory
'unicode/ucnv.h' does exist.  Does this mean that Configure is ignoring
--icuheader or --icuheader is ignored in the build of the file above?

Has anyone successfully built Parrot on Win32 (MSVC 13.10.3077)
recently?

Mark Solinski


perlscalar morph code

2005-04-12 Thread Nicholas Clark
I'm trying to understand how morph works. perlscalar's morph looks like this:

void morph (INTVAL type) {
if (SELF->vtable->base_type == type)
return;
if (SELF->vtable->base_type == enum_class_PerlString) {
PObj_custom_mark_CLEAR(SELF);
SELF->vtable = Parrot_base_vtables[type];
return;
}
if (type == enum_class_PerlString) {
/*
 * if we morph to a string, first clear str_val
 * so that after changing the vtable a parallel
 * reader doesn't get a gargabe pointer
 */
PMC_str_val(SELF) = NULL;
PObj_custom_mark_SET(SELF);
SELF->vtable = Parrot_base_vtables[type];
return;
}
if (type == enum_class_BigInt || type == enum_class_Complex) {
PMC_str_val(SELF) = NULL;
SELF->vtable = Parrot_base_vtables[type];
DYNSELF.init();
return;
}
SELF->vtable = Parrot_base_vtables[type];
}


I think that there are 2 bugs here

1: Morphing from enum_class_PerlString to enum_class_BigInt or
enum_class_Complex looks broken. The return in the second if clause will
quit the function and the DYNSELF.init() will never get called.

Can anyone easily write a regression test that demonstrates this

I think that the cure is to remove

SELF->vtable = Parrot_base_vtables[type];
return;

An optimisation on top would be to change the following

if (type == enum_class_PerlString) {

to

else if (type == enum_class_PerlString) {



2: The code isn't thread safe, even though it thinks that it is:

if (type == enum_class_PerlString) {
/*
 * if we morph to a string, first clear str_val
 * so that after changing the vtable a parallel
 * reader doesn't get a gargabe pointer
 */
PMC_str_val(SELF) = NULL;
PObj_custom_mark_SET(SELF);
SELF->vtable = Parrot_base_vtables[type];
return;
}


I see no write barrier. There's no reason why on a dual CPU machine the
parallel reader doesn't see the writes to memory in the order:


SELF->vtable = Parrot_base_vtables[type];
PMC_str_val(SELF) = NULL;

and manage go SEGV between the two.

Nicholas Clark


Re: subscripts are.... objects?

2005-04-12 Thread Thomas Sandlaß
Yuval Kogman wrote:
You can perform set operations on them:
	[!-2]
Hmm, that would produce a boolean index.

is the subscript for everything but the second to last element.
By using a context enforcer (subscript [] ?, maybe since lists are
lazyy they can just be subscripts when used that way?) you can get a
subscript object, which you can then use in a subscript, and it
flattens out.
The set math is done by special casing junctions, perhaps?
I'm not the junction expert, but it's said that they wrap around
indexing/slicing! So the @array[!-2] would just read @array[none(-2)]?
But how does none() get the base set where the second to last is excluded
from?

my @array;
@array[$subscript];
@array[$other];
@array[$subscript | $other]; # union
That is valid already.

@array[$subscript & $other]; # intersection
This'll do autothreaded, indexed access with the outcome of the
all() junction.
Regards,
--
TSa (Thomas Sandlaß)



Tests running Tests

2005-04-12 Thread Sam Tregar
Hello all.  I've got a test I want to write, but I don't know to write
it (easily).  I've got a test script, call it foo.t which uses
Test::More and runs under Test::Harness.  Now I want to make a new
test script tweek-then-foo.t which tweeks the system and then ensures
that foo.t still passes.  How do I write tweek-then-foo.t?

-sam


Re: Tests running Tests

2005-04-12 Thread Paul Johnson
On Tue, Apr 12, 2005 at 01:20:18PM -0400, Sam Tregar wrote:

> Hello all.  I've got a test I want to write, but I don't know to write
> it (easily).  I've got a test script, call it foo.t which uses
> Test::More and runs under Test::Harness.  Now I want to make a new
> test script tweek-then-foo.t which tweeks the system and then ensures
> that foo.t still passes.  How do I write tweek-then-foo.t?

I would do it in the same way as if this had nothing to do with tests.
That is, abstract away the common code into a module, which can also
live under t/

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net


Re: Blocks, continuations and eval()

2005-04-12 Thread Piers Cawley
Larry Wall <[EMAIL PROTECTED]> writes:

> On Tue, Apr 12, 2005 at 11:36:02AM +0100, Piers Cawley wrote:
> : wolverian <[EMAIL PROTECTED]> writes:
> : 
> : > On Fri, Apr 08, 2005 at 12:18:45PM -0400, MrJoltCola wrote:
> : >> I cannot say how much Perl6 will expose to the high level language.
> : >
> : > That is what I'm wondering about. I'm sorry I was so unclear.
> : >
> : >> Can you tell me what your idea of a "scope" is? I'm thinking a
> : >> continuation, and if that is what you are thinking, I'm thinking the
> : >> answer to your question is yes.
> : >
> : > Yes. I want to know how Perl 6 exposes continuations, and how to get one
> : > for, say, the current lexical scope, and if it has a method on it that
> : > lets me evaluate code in that context (or some other way to do that).
> : 
> : As I understand what Larry's said before. Out of the box, it
> : doesn't. Apparently we're going to have to descend to Parrot to write
> : evalcc/letcc/your-preferred-continuation-idiom equivalent. 
>
> We'll make continuations available in Perl for people who ask for
> them specially, but we're not going to leave them sitting out in the
> open where some poor benighted pilgrim might trip over them unawares.

Oh goody! Presumably we're initially talking of a simple
'call_with_current_continuation'? 


Testing for NULL return values in test scripts

2005-04-12 Thread Walter Goulet
Hi,

I was wondering if there is a way to use the ok() function in Test.pm
to check for a null return value. It looks like the 3 arg form of ok()
I'm using only tests the first 2 args to see if they're equal.

I'm considering this approach:

$val = some_func(); # returns NULL on failure

if($val != 0 && $val ne "0")
{
   $isnull = 0;
}
else
{
   $isnull = 1;
}

ok($isnull,0,"NULL returned");

Thanks,
Walter


Re: Tests running Tests

2005-04-12 Thread Sam Tregar
On Tue, 12 Apr 2005, Paul Johnson wrote:

> I would do it in the same way as if this had nothing to do with tests.
> That is, abstract away the common code into a module, which can also
> live under t/

That would be a lot of work in this case.  I found an easier
solution.  In tweek-then-foo.t:

  {
 local $ENV{SUB_TEST} = 1;
 do 't/foo.t' or die ...;
  }

And in foo.t, replacing the usual Test::More use line:

  BEGIN {
unless ($ENV{SUB_TEST}) {
eval "use Test::More qw(no_plan);";
die $@ if $@;
}
  }

Seems to work fine so far, and it definitely is a lot easier than
trying to modularize a rather hairy foo.t.

-sam


Re: Win32 with ICU files build problem

2005-04-12 Thread Christian Sporer
Hi Mark,

I was able to compile parrot yesterday night. I compiled icu and
copied the contents of the directory icu/include (two directories)
manually to parrot/src. After that the compiler didn't complain
anymore and I got a working parrot.exe. The --icudatadir I pointed to
the out directory in my icu-build.

Hope that helps.

Christian Sporer

On Apr 12, 2005 6:25 PM, Solinski, Mark <[EMAIL PROTECTED]> wrote:
> Following the instructions in README.Win32 (which has been successful
> for me in the past), no longer works successfully.  First, I cannot run
> Configure.pl successfully; it complains about --icudatadir not being
> defined (again not one of the --icu* options mentioned in README.Win32
> AND not necessary before).  Defining --icudatadir, I now get the
> following error during make:
> 
> Src\string_primitives.c(24) : fatal error C1083: Cannot open include
> file: 'unicode/ucnv.h': No such file or directory
> 
> I had defined --icuheaders in my call to Configure in whose directory
> 'unicode/ucnv.h' does exist.  Does this mean that Configure is ignoring
> --icuheader or --icuheader is ignored in the build of the file above?
> 
> Has anyone successfully built Parrot on Win32 (MSVC 13.10.3077)
> recently?
> 
> Mark Solinski
> 
>


Re: Testing for NULL return values in test scripts

2005-04-12 Thread Steve Peters
On Tue, Apr 12, 2005 at 12:49:30PM -0500, Walter Goulet wrote:
> Hi,
> 
> I was wondering if there is a way to use the ok() function in Test.pm
> to check for a null return value. It looks like the 3 arg form of ok()
> I'm using only tests the first 2 args to see if they're equal.
> 
> I'm considering this approach:
> 
> $val = some_func(); # returns NULL on failure
> 
> if($val != 0 && $val ne "0")
> {
>$isnull = 0;
> }
> else
> {
>$isnull = 1;
> }
> 
> ok($isnull,0,"NULL returned");
> 

First, there is no NULL in Perl.  There is undef, so I'll assume that's what
you mean.  The test above does not test for undef at all.  It just checks
to see that the return is not equal to zero.  If you used Test::Simple, it
would be as simple as

use strict;
use warnings;

use Test::Simple tests => 1;

my $val = some_func();

ok(! defined $val, "undef returned");


This should work just fine for what you are testing.

Steve Peters
[EMAIL PROTECTED]


Re: [perl #34704] [PATCH] get SDL running on win32

2005-04-12 Thread jerry gay
On 12 Apr 2005 15:14:58 -, Leopold Toetsch via RT <
[EMAIL PROTECTED]> wrote: 
> 
> jerry gay wrote:
> > On 12 Apr 2005 09:44:08 -, Leopold Toetsch via RT <
> > [EMAIL PROTECTED]> wrote:
> 
> >>The question is, if the dynext loader should try to strip "^lib" off the
> >>library name.
> >
> > the convention on windows is not to include the "lib" prefix, however 
> there
> > are exceptions.
> 
> Ok, let's try it. Please test rev 7813.

  works! the win32-specific stuff can be ripped out of 
runtime/library/pcre.imc && SDL.imc. 
or i'll submit a patch if you'd rather.

leo

 ~jerry


Re: [perl #34704] [PATCH] get SDL running on win32

2005-04-12 Thread chromatic
On Tue, 2005-04-12 at 10:59 -0700, jerry gay wrote:

>   works! the win32-specific stuff can be ripped out of 
> runtime/library/pcre.imc && SDL.imc. 
> or i'll submit a patch if you'd rather.

There shouldn't be any Win32-specific stuff in SDL.imc now.  (I don't
see any.)

There's Debian-specific stuff, but that's just Debian being charmingly
itself.

If Jerry's happy, I'm happy and the RT overlords can close this ticket.

-- c



Re: [perl #34704] [PATCH] get SDL running on win32

2005-04-12 Thread jerry gay
i'm happy. close the ticket.

On 12 Apr 2005 18:10:49 -, chromatic via RT <
[EMAIL PROTECTED]> wrote: 
> 
> On Tue, 2005-04-12 at 10:59 -0700, jerry gay wrote:
> 
> > works! the win32-specific stuff can be ripped out of
> > runtime/library/pcre.imc && SDL.imc.
> > or i'll submit a patch if you'd rather.
> 
> There shouldn't be any Win32-specific stuff in SDL.imc now. (I don't
> see any.)
> 
> There's Debian-specific stuff, but that's just Debian being charmingly
> itself.
> 
> If Jerry's happy, I'm happy and the RT overlords can close this ticket.
> 
> -- c
> 
>


[perl #34932] [PATCH] Add -I/path/to/icu/headers flag if needed

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


If the user has ICU installed in a location not normally searched by
the compiler, but does specify the location of the icu-config program,
Configure.pl ought to add in the appropriate -I/path/to/icu to
ccflags, if necessary.

This patch has Configure.pl test if that additional -I flag is needed.
If ICU is found, it first tries to include .  If that
fails, then it adds -I $icuheaders to ccflags.

I don't understand ICU on Windows.  If anyone could test this patch
there, I'd appreciate it.

[As an aside:  I didn't suggest using icu-config --cppflags because
that's broken in icu-3.2 for Solaris; I've sent an appropriate patch
off to the icu list.]

Apply with patch -p1.

diff -r -u parrot-orig/config/gen/icu.pl parrot-andy/config/gen/icu.pl
--- parrot-orig/config/gen/icu.pl   Mon Apr 11 11:14:55 2005
+++ parrot-andy/config/gen/icu.pl   Tue Apr 12 10:58:53 2005
@@ -142,10 +142,29 @@
   Configure::Data->set(
 has_icu=> 1,
 icu_shared  => $icushared,
-icu_cflags  => "-I$icuheaders",
 icu_headers => join( ' ', @icu_headers ),
 icu_datadir => $icudatadir,
   );
+
+  # Add -I $Icuheaders if necessary
+  my $header = "unicode/ucnv.h";
+  Configure::Data->set(testheaders =>"#include <$header>\n");
+  Configure::Data->set(testheader => "$header");
+  cc_gen('config/auto/headers/test_c.in');
+
+  Configure::Data->set(testheaders => undef);  # Clean up.
+  Configure::Data->set(testheader => undef);
+  eval { cc_build(); };
+  if (!$@ && cc_run() =~ /^$header OK/) {
+# Ok, we don't need anything more.
+print "Your compiler found the icu headers... good!\n" if $verbose;
+  }
+  else {
+print "Adding -I $icuheaders to ccflags for icu headers.\n" if $verbose;
+Configure::Data->add(' ',
+ccflags=> "-I $icuheaders");
+  }
+  cc_clean();
 
   $Configure::Step::result = "yes";
 

-- 
Andy Dougherty  [EMAIL PROTECTED]


[perl #34933] [PATCH] Handle trailing space in $(LD_OUT)

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


Removing ICU from the build uncovered an odd build bug concerning the
space after ${ld_out} in config/init/data.pl.  This patch fixes it.

Gory details:
The Makefile command to build ./parrot is (essentially)

$(LINK) $(LINKFLAGS) $(LD_OUT)$(PARROT) $(IMCC_DIR)/main$(O) 

Note how there's no space between LD_OUT and PARROT.  That's
deliberate, I think, allowing for VMS-like syntax
link /output=parrot.exe 
on the compile line.

On Unix systems, however, the typical command would be
cc -o parrot 
Some compilers don't require the space after the '-o'; Sun's CC
compiler does (at least under certain conditions, which are triggered
by the parrot Makefile).  The ${ld_out} Configure.pl variable contains
a trailing space, and the $(LD_OUT) Makefile variable also holds that
trailing space.  However, not all 'make' programs honor trailing
spaces.  GNU make does.  Sun's make doesn't.  NetBSD make doesn't
either.

This patch takes the issue out of make's hands and leaves it up to
perl to decide as it extracts the root.in Makefile.  Since I highly
doubt that anyone is experimenting with command-line overrides for LD_OUT
when they type 'make', this fix should be safe and sensible.

diff -r -u parrot-orig/config/gen/makefiles/root.in 
parrot-andy/config/gen/makefiles/root.in
--- parrot-orig/config/gen/makefiles/root.inMon Apr 11 11:14:51 2005
+++ parrot-andy/config/gen/makefiles/root.inTue Apr 12 12:32:04 2005
@@ -121,7 +121,6 @@
 SHARE_EXT   = ${share_ext}
 LOAD_EXT= ${load_ext}
 A   = ${a}
-LD_OUT  = ${ld_out}
 LD_SHARE_FLAGS  = ${ld_share_flags}
 LD_LOAD_FLAGS   = ${ld_load_flags}
 
@@ -625,7 +624,7 @@
$(PARROT) parrot-config.imc VERSION DEVEL
 
 $(PARROT) : $(IMCC_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) 
lib/Parrot/OpLib/core.pm
-   $(LINK) $(LD_OUT)$(PARROT) $(LINKFLAGS) $(IMCC_DIR)/main$(O) 
$(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(PARROT) $(LINKFLAGS) $(IMCC_DIR)/main$(O) 
$(ALL_PARROT_LIBS)
 
 lib_deps_object : $(O_FILES)
$(PERL) tools/dev/lib_deps.pl object $(O_FILES)
@@ -660,10 +659,10 @@
 
 blib/lib/libparrot$(SHARE_EXT) : $(O_FILES)
$(MKDIR) blib blib/lib
-   $(LD) $(LD_SHARE_FLAGS) $(LDFLAGS) 
$(LD_OUT)blib/lib/libparrot$(SHARE_EXT) $(O_FILES) $(C_LIBS) $(LIBICUCORE) 
$(LIBICUDATA)
+   $(LD) $(LD_SHARE_FLAGS) $(LDFLAGS) 
${ld_out}blib/lib/libparrot$(SHARE_EXT) $(O_FILES) $(C_LIBS) $(LIBICUCORE) 
$(LIBICUDATA)
 
 $(PARROT_SO) : $(IMCC_DIR)/main$(O) blib/lib/libparrot$(SHARE_EXT) 
lib/Parrot/OpLib/core.pm
-   $(LINK) $(LINKFLAGS) $(LD_OUT)$(PARROT) $(IMCC_DIR)/main$(O) -Lblib/lib 
-lparrot $(C_LIBS)
+   $(LINK) $(LINKFLAGS) ${ld_out}$(PARROT) $(IMCC_DIR)/main$(O) -Lblib/lib 
-lparrot $(C_LIBS)
 
 #
 # Parrot Debugger
@@ -672,7 +671,7 @@
 $(SRC_DIR)/pdb$(O) : $(GENERAL_H_FILES)
 
 $(PDB) : $(SRC_DIR)/pdb$(O) $(LIBPARROT)
-   $(LINK) $(LD_OUT)$(PDB) $(SRC_DIR)/pdb$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(PDB) $(SRC_DIR)/pdb$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
 
 #
 # Parrot Disassembler
@@ -681,19 +680,19 @@
 $(SRC_DIR)/disassemble$(O) : $(GENERAL_H_FILES)
 
 $(DIS) : $(SRC_DIR)/disassemble$(O) $(LIBPARROT)
-   $(LINK) $(LD_OUT)$(DIS) $(SRC_DIR)/disassemble$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(DIS) $(SRC_DIR)/disassemble$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
 
 #
 # Parrot Dump
 #
 
 $(PDUMP) : $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) $(LIBPARROT)
-   $(LINK) $(LD_OUT)$(PDUMP) $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) 
$(LINKFLAGS) $(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(PDUMP) $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) 
$(LINKFLAGS) $(ALL_PARROT_LIBS)
 
 
 # pbc_info
 $(PINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT)
-   $(LINK) $(LD_OUT)$(PINFO) $(SRC_DIR)/pbc_info$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(PINFO) $(SRC_DIR)/pbc_info$(O) $(LINKFLAGS) 
$(ALL_PARROT_LIBS)
 
 ###
 #
@@ -1361,17 +1360,17 @@
 ###
 
 exec : $(SRC_DIR)/exec_start$(O) $(LIBPARROT)
-   $(LINK) $(LD_OUT)$(EXEC) $(LINKFLAGS) $(EXEC)$(O) 
$(SRC_DIR)/exec_start$(O) $(ALL_PARROT_LIBS)
+   $(LINK) ${ld_out}$(EXEC) $(LINKFLAGS) $(EXEC)$(O) 
$(SRC_DIR)/exec_start$(O) $(ALL_PARROT_LIBS)
 
 exec_so : $(SRC_DIR)/exec_start$(O) blib/lib/libparrot$(SHARE_EXT)
-   $(LINK) $(LD_OUT)$(EXEC) $(LINKFLAGS) $(EXEC)$(O) 
$(SRC_DIR)/exec_start$(O) -lparrot $(C_LIBS)
+   $(LINK) ${ld_out}$(EXEC) $(LINKFLAGS) $(EXEC)$(O) 
$(SRC_DIR)/exec_start$(O) -lparrot $(C_LIBS)
 
 ## OS depend targets ##
 
 # for use by t/pmc/nci.t
 $(LIBNCI_TEST_SO): $(SRC_DIR)/nci_test$(O)

Re: [perl #34704] [PATCH] get SDL running on win32

2005-04-12 Thread Leopold Toetsch
chromatic wrote:
There's Debian-specific stuff, but that's just Debian being charmingly
itself.
That should go away too. The canonical fix is to create the missing 
symlinks and probably submit patches to debian.

leo


Re: [perl #34932] [PATCH] Add -I/path/to/icu/headers flag if needed

2005-04-12 Thread Jens Rieks
On Tuesday 12 April 2005 19:10, Andy Dougherty wrote:
> # New Ticket Created by  Andy Dougherty
> # Please include the string:  [perl #34932]
> # in the subject line of all future correspondence about this issue.
> # https://rt.perl.org/rt3/Ticket/Display.html?id=34932 >
>
>
> If the user has ICU installed in a location not normally searched by
> the compiler, but does specify the location of the icu-config program,
> Configure.pl ought to add in the appropriate -I/path/to/icu to
> ccflags, if necessary.
>
> This patch has Configure.pl test if that additional -I flag is needed.
> If ICU is found, it first tries to include .  If that
> fails, then it adds -I $icuheaders to ccflags.
Thanks, applied!

> I don't understand ICU on Windows.  If anyone could test this patch
> there, I'd appreciate it.
>
> [As an aside:  I didn't suggest using icu-config --cppflags because
> that's broken in icu-3.2 for Solaris; I've sent an appropriate patch
> off to the icu list.]
>
> Apply with patch -p1.
[snip]

jens


Re: Testing for NULL return values in test scripts

2005-04-12 Thread Walter Goulet
I can't use Test::Simple, I have to use Test.pm for this module for
backwards compatibility reasons.

I'm trying to replace this function call with an ok() call:

$ctx = Net::SSLeay::SSL_CTX_new() or die ("Unable to create SSL context");

Hard to tell what $ctx is if SSL_CTX_new() fails; I know it returns NULL in c.

> On 4/12/05, Steve Peters <[EMAIL PROTECTED]> wrote:
> > On Tue, Apr 12, 2005 at 12:49:30PM -0500, Walter Goulet wrote:
> > > Hi,
> > >
> > > I was wondering if there is a way to use the ok() function in Test.pm
> > > to check for a null return value. It looks like the 3 arg form of ok()
> > > I'm using only tests the first 2 args to see if they're equal.
> > >
> > > I'm considering this approach:
> > >
> > > $val = some_func(); # returns NULL on failure
> > >
> > > if($val != 0 && $val ne "0")
> > > {
> > >$isnull = 0;
> > > }
> > > else
> > > {
> > >$isnull = 1;
> > > }
> > >
> > > ok($isnull,0,"NULL returned");
> > >
> >
> > First, there is no NULL in Perl.  There is undef, so I'll assume that's what
> > you mean.  The test above does not test for undef at all.  It just checks
> > to see that the return is not equal to zero.  If you used Test::Simple, it
> > would be as simple as
> >
> > use strict;
> > use warnings;
> >
> > use Test::Simple tests => 1;
> >
> > my $val = some_func();
> >
> > ok(! defined $val, "undef returned");
> >
> > This should work just fine for what you are testing.
> >
> > Steve Peters
> > [EMAIL PROTECTED]
> >
>


Re: Win32 with ICU files build problem

2005-04-12 Thread Matt Diephouse
Solinski, Mark <[EMAIL PROTECTED]> wrote:
> Following the instructions in README.Win32 (which has been successful
> for me in the past), no longer works successfully.  First, I cannot run
> Configure.pl successfully; it complains about --icudatadir not being
> defined (again not one of the --icu* options mentioned in README.Win32
> AND not necessary before).  Defining --icudatadir, I now get the
> following error during make:

Note that you sent this to the wrong list (perl6-internals is for
Parrot discussion, perl6-language is for discussion of Perl 6).

I just recently saw some of this on Linux as well. I didn't go as far
as to define --icudatadir, but I noticed that passing no icu options
causes Configure.pl to autodetect icu. You might give that a shot.

Please consider patching the documentation if what you find there doesn't work.

-- 
matt diephouse
http://matt.diephouse.com


Re: Slicing conflict

2005-04-12 Thread Brent 'Dax' Royal-Gordon
Larry Wall <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 12, 2005 at 12:08:43AM -0700, Brent 'Dax' Royal-Gordon wrote:
> : @foo[1,3; *; 7]
> :
> : Which I rather like.
> 
> Me too.  Unless my memory is failing me, I believe that's what S09
> already specifies.

It does include a C> (d'oh, should've checked), but it
doesn't specify how it works.

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

"I used to have a life, but I liked mail-reading so much better."


Win32 with ICU files build problem

2005-04-12 Thread Solinski, Mark
I'm sorry if this is a repeat... I posted this accidentally to
perl6-language...

> Following the instructions in README.Win32 (which has been successful
> for me in the past), no longer works successfully.  First, I cannot
> run Configure.pl successfully; it complains about --icudatadir not
> being defined (again not one of the --icu* options mentioned in
> README.Win32 AND not necessary before).  Defining --icudatadir, I now
> get the following error during make:
> 
> Src\string_primitives.c(24) : fatal error C1083: Cannot open include
> file: 'unicode/ucnv.h': No such file or directory
> 
> I had defined --icuheaders in my call to Configure in whose directory
> 'unicode/ucnv.h' does exist.  Does this mean that Configure is
> ignoring --icuheader or --icuheader is ignored in the build of the
> file above?
> 
> Has anyone successfully built Parrot on Win32 (MSVC 13.10.3077)
> recently?
> 
> Mark Solinski


Re: Win32 with ICU files build problem

2005-04-12 Thread Jens Rieks
On Tuesday 12 April 2005 21:06, Solinski, Mark wrote:
> > Following the instructions in README.Win32 (which has been successful
> > for me in the past), no longer works successfully.  First, I cannot
> > run Configure.pl successfully; it complains about --icudatadir not
> > being defined (again not one of the --icu* options mentioned in
> > README.Win32 AND not necessary before).  Defining --icudatadir, I now
> > get the following error during make:
> >
> > Src\string_primitives.c(24) : fatal error C1083: Cannot open include
> > file: 'unicode/ucnv.h': No such file or directory
With which command line arguments is the compiler called?

> > I had defined --icuheaders in my call to Configure in whose directory
> > 'unicode/ucnv.h' does exist.  Does this mean that Configure is
> > ignoring --icuheader or --icuheader is ignored in the build of the
> > file above?
Configure.pl does not complain about missing headers, does it?

Can you please retry with the latest version of parrot (>= r7817),
run Configure.pl with --verbose-step=ICU and provide its output?

> > Has anyone successfully built Parrot on Win32 (MSVC 13.10.3077)
> > recently?
No, but I tried it on an old Win98 box with VC6 or so, it worked there.
(The problem though was that each time parrot is invoked, "No such file or 
directory" appears in the output, but the result looks okay nevertheless - 
have to dig into it another time...)

> > Mark Solinski
jens


Re: Win32 with ICU files build problem

2005-04-12 Thread wi
I succeeded using the mingw32 setup. I counldn't get the Visual
Studio.Net or free VC++ compilers to work, and ran out of energy.

On Apr 12, 2005 12:06 PM, Solinski, Mark <[EMAIL PROTECTED]> wrote:
> I'm sorry if this is a repeat... I posted this accidentally to
> perl6-language...
> 
> > Following the instructions in README.Win32 (which has been successful
> > for me in the past), no longer works successfully.  First, I cannot
> > run Configure.pl successfully; it complains about --icudatadir not
> > being defined (again not one of the --icu* options mentioned in
> > README.Win32 AND not necessary before).  Defining --icudatadir, I now
> > get the following error during make:
> >
> > Src\string_primitives.c(24) : fatal error C1083: Cannot open include
> > file: 'unicode/ucnv.h': No such file or directory
> >
> > I had defined --icuheaders in my call to Configure in whose directory
> > 'unicode/ucnv.h' does exist.  Does this mean that Configure is
> > ignoring --icuheader or --icuheader is ignored in the build of the
> > file above?
> >
> > Has anyone successfully built Parrot on Win32 (MSVC 13.10.3077)
> > recently?
> >
> > Mark Solinski
> 
>



Summary for the week ending 2005-04-12

2005-04-12 Thread The Perl 6 Summarizer
The Perl 6 Summary for the week ending 2005-04-12
Whoa! Deja vu! Where'd Matt go?

Don't worry, Matt's still writing summaries. As you may have noticed,
Matt's been writing summaries every two weeks. And now so am I. Because
we love you, we've decided to arrange things so I write summaries in the
weeks when Matt doesn't. We could do it the other way, but that could be
seen by some as self-defeating. Heck, when I say 'some' I probably mean
'all'.

So, bear with me while I remember how to type all those accented
characters and get back into the swing of writing these things (and of
reading everything in the mailing lists once more -- someone should
write a summary for us summarizers...)

I'll be sticking to my old 'lists in alphabetical order' scheme of
writing summaries. So, let's get going

This week in perl6-compiler
  Array of arrays, hash of hashes, elems, last
Lev Selector asked for confirmation that Pugs didn't support compound
data structures, "@ar.elems" or "@ar.last". Autrijus and others
confirmed that they didn't then, but they do now.



  MakeMaker6 stalls on takeoff
Darren Duncan pointed out that, whilst last week's summary had claimed
he was working on implementing MakeMaker in Perl 6 which is, sadly not
the case. He reckoned he'd possibly look into it again when he had tuits
and Pugs was more complete (supporting objects, for instance).



  Declaration oddness
Roie Marianer pointed out what looks like some weirdness in Pugs'
parsing of lexically scoped subroutines. Warnock applies.



  Toronto pugs hackathon
John Macdonald asked for people who wanted to come to the YAPC::NA pugs
hackathon to get in touch with him beforehand as spaces there are
limited. If you're interested, drop him a line.



  Pugs slice oddities
Andrew Savige noticed some weirdness in pugs's slicing behaviour. He
posted some example code showing the problem. Autrijus agreed that there
was a problem and explained that he was in the process of rewriting all
the variable types, symbol tables and casting rules to agree with the
Perl 5 model as described in perltie.pod. The rewrite is currently
failing tests, so he posted a patch for people who want to play. On
Sunday, he bit the bullet and committed the entire 2500 line patch which
'touches pretty much all evaluator code'.

 -- Autrijus's patch

 -- Autrijus on the patch



Meanwhile, in perl6-internals
  Tcl, Unicode
William Coleda has been trying to add Unicode support to his TCL
implementation and he fell across issues with missing methods in
charset/unicode.h. Leo waved a magic wand and checked in an
implementation which he fenced about with disclaimers.



  The status of Ponie
Nicholas Clark confessed that Ponie had been pretty much stalled for
some time, but sweetened the pill by announcing that it's about to
restart and that he would be able to allocate at least one day a week to
the project. He pointed people at the Ponie roadmap which breaks down
the required tasks between here and a first release, complete with time
estimates. If you're interested in getting Ponie to a ridable state,
this would be a good place to start.

People were pleased.

 -- Ponie intro/roadmap



  Monthly release schedule
Chip donned his "Fearless Leader" hat and announced that, effective,
Parrot would be moving to a monthly release schedule (with an initial
three week 'month' to get things into sync). There was some debate about
whether Solaris/SPARC should be one of the officially required monthly
release platforms (darwin, linux-x86-gcc3.* and win32-ms-cl were Chip's
initial blessed three). This morphed into a discussion of Tinderbox;
apparently there are cool things happening behind the scenes.



  Calling convention abstraction
What do you know? You go away for n months and when you come back people
are *still* talking about calling conventions.



  Dynamic Perl, Part 1
William Coleda announced that he was starting work on removing the
core's dependence on Perl* PMCs in favour of using language agnostic
PMCs internally and loading the Perl ones dynamically as required.
Everything but PerlArray was dealt with quickly and names and ways
forward with that tricky case were discussed. It looks like we're going
to have a 'ResizablePMCArray' added to the core once people have the
tuits.



  Subversion
Another discussion that wouldn't go away back when I was last writing
summaries has come to a head. Parrot's finally migrating from CVS t

Re: Takers wanted - a perl job

2005-04-12 Thread Michael G Schwern
On Tue, Apr 12, 2005 at 10:54:14AM +0100, Nicholas Clark wrote:
> On Tue, Apr 12, 2005 at 02:50:57AM -0700, Michael G Schwern wrote:
> 
> > No need to parse the XML files, "svn list -R" lists everything in the repo.
> > 
> > And I suppose I just volunteered myself for the job.
> 
> $ svn list -R
> svn: '.' is not a working copy
> 
> Doesn't work when svk is used to check out the copy. But in that case
> svk list -R does.

Hmm.  Maybe this should be a commit action and not a test.



Re: Win32 with ICU files build problem

2005-04-12 Thread jerry gay
On Apr 12, 2005 12:06 PM, Solinski, Mark <[EMAIL PROTECTED]> wrote: 
> 
> > Has anyone successfully built Parrot on Win32 (MSVC 13.10.3077)
> > recently?

 parrot builds fine on win32--vc-7.1-perl-5.8.6 for me, without icu. i have 
been building this way for some time now.
 configure.pl --without-icu
 nmake
 nmake test
 i have not tried with icu for the past several days.
 
>
> > Mark Solinski
> 
> ~jerry


Re: perlscalar morph code

2005-04-12 Thread Simon Glover
On Tue, 12 Apr 2005, Nicholas Clark wrote:
I think that there are 2 bugs here
1: Morphing from enum_class_PerlString to enum_class_BigInt or
enum_class_Complex looks broken. The return in the second if clause will
quit the function and the DYNSELF.init() will never get called.
Can anyone easily write a regression test that demonstrates this
 This code:
   new P0, .PerlString
   new P1, .BigInt
   typeof I1, P1
   morph P0, I1
   set P0, 123
   print P0
   end
 segfaults for me with the latest snapshot of parrot, but prints '123' as
 expected if you remove the two lines mentioned below. The analogous test
 with Complex instead of BigInt appears to work regardless of whether the
 lines are present or not.
I think that the cure is to remove
   SELF->vtable = Parrot_base_vtables[type];
   return;
 I've also re-run the test suite with these lines removed, and all
 existing tests still pass.
 Hope this is useful,
 Simon


Re: Summary for the week ending 2005-04-12

2005-04-12 Thread Simon Glover
On Tue, 12 Apr 2005, The Perl 6 Summarizer wrote:
 Dynamic Perl, Part 1
   William Coleda announced that he was starting work on removing the
   core's dependence on Perl* PMCs in favour of using language agnostic
   PMCs internally and loading the Perl ones dynamically as required.
   Everything but PerlArray was dealt with quickly and names and ways
   forward with that tricky case were discussed. It looks like we're going
   to have a 'ResizablePMCArray' added to the core once people have the
   tuits.
 Minor correction: 'ResizablePMCArray' is already in the core, but some of
 the necessary vtable methods still need to be implemented (and tested!).
 Simon


Pugs 6.2.0 released.

2005-04-12 Thread Autrijus Tang
I am delighted to report that the first major milestone of Pugs, version
6.2.0, has been released to CPAN:

http://wagner.elixus.org/~autrijus/dist/Perl6-Pugs-6.2.0.tar.gz
SIZE (Perl6-Pugs-6.2.0.tar.gz) = 642482
MD5 (Perl6-Pugs-6.2.0.tar.gz) = 8d5438d49db872ffe2394fd4995d335b

It represents the culmination of 71 days of intensive work, by more
than 60 people in our committer team, with nearly 2000 revisions.

According to the roadmap in PA01, this and the next milestone are:

6.2: Basic IO and control flow elements; mutable variables; assignment.
6.28: Classes and traits.

In other words, we are now reasonably confident that the basics of
Perl 6 syntax and data structures are in place.  We already have an
object/type system now, and the 6.2.x series will make them available
on the language leve, together with a full-fledged class system.

After this release, I will take a short break from coding Pugs, and
focus on writing "Pugs Apocryphon 2: Design of Pugs". In it I will
explain the relation of the various components in Pugs, as well as how
it relates to Parrot, GHC, and other systems.  Once it is written,
I plan to start working on the IMC subsystem, with the goal of making
Parrot IMC the primary target for the 6.28.0 release.

Again, thanks too all lambdacamels for making this release possible,
and for building this new ship with me.

Enjoy,
/Autrijus/

== Changes for 6.2.0 - April 13, 2005

=== Pugs Internals

* Major refactor of ITypes subsystem, we now have:
** Nested structures: `$a{1}[2]{3}`
** Autovivification: `$a{1}[2]{3} = `
** Tied magic: `%ENV`
** Proxy scalars: `%ENV ~= '/tmp'`
** Slice assignment: [EMAIL PROTECTED],2] = `
** Anonymous arrays: `[1..10][0] = 0`
** Lazy IArray structures: "Infinite lists, constant time"
** Infinite slices: [EMAIL PROTECTED]
** and much much more ...
* Experimental support for link external Haskell libraries
** One such module is SHA1.pm: http://tpe.freepan.org/repos/ingy/SHA1/
* New builtins:
** `sum`, `log`, `log10`, `sign`, `pi`, `tan`, `cos`, `atan`
** `zip`, `hash`, `pair`, `isa`, `bytes`, `chars`, `codes`, `graphs`
* New type specific builtins;
** `.kv`, `.pairs`, `.delete`, `.exists`
** `.pick`, `.keys`, `.values`
* Several file test operators
** `-r`, `-w`, `-x`, `-e`, `-z`, `-s`, `-f`, `-d`
* Support for `$*UID`, `$*EUID`, `$*GID`, and `$*EGID` on *nix
* Stacked file test operators now (mostly) work
* Added `is rw` trait for subroutine parameters
* `$*PID` now works on *nix systems 
* Several command line switches implemented: `-I` `-p` `-n` and more
* `s:perl5/.../{  }/` works correctly
* Type casting errors are now more descriptive
* `require ""` now works on UTF-8 files
* Regex substitution is now UTF-8 safe
* `sort {}` now works
* Some support for the /splat/ star `*` 

=== Tests, Examples and Documentations

* Many new tests and cleaning up of older tests, we now have 4200+
* `examples/games/hangman.p6` added which uses the `AUTHORS` file as
  the dictionary file
* `READTHEM` added; recommended reading for aspiring Pugs hackers
* The Perl 6 Cookbook is well underway at `examples/cookbook/`
* Working perl6 modules added to `ext/`
** CGI.pm
** lib.pm
** HTML::Entities
* Several Working Drafts added to `docs/`
** Apocalypse 20 - Debugging
** Synopsis 26 - Perl Documentation
** Synopsis 28 - Special Variables
** Synopsis 27 - Perl Culture (with CPAN drinking game rules)
** Synopsis 29 - Builtin Functions
* Early work on Perl 6 Object System in `docs/class/`

=== Bug Fixes

* Parens no longer required for; `last()` and `return()`
* Fixed issue with binding invocant parameters
* Fixed parsing issue with `lc $, $y`
* `$_` now behaves correctly in most cases
* `exit()` now triggers `END {}` correctly
* `undef $x` now works correctly ($x is rw)
* Fixed parsing of default parameters: `sub foo (+$x = 3, +$y = 4)`
* `say` and `print` now default to `$_`
* `map { ... } @list` now parses correctly
* `loop { ... }` no works correctly
* `int(3) + 4` now parses correctly
* Fix parsefail bug on false unaries
* `for (@list)` no longer flattens [EMAIL PROTECTED]
* `$var.method $param` is now illegal: use `$var.method($param)`
* `readline()` is now strict in list context
* `$list.join('|')` now works
* `xor` and `^^` now short-circuits
* Named bindings to `%_` repaired


pgpNcMWLM2np1.pgp
Description: PGP signature


Re: Pugs 6.2.0 released.

2005-04-12 Thread Matt Fowles
Autrijus~

On Apr 12, 2005 3:50 PM, Autrijus Tang <[EMAIL PROTECTED]> wrote:
> * `xor` and `^^` now short-circuits

How does this work?  I thought xor /had/ to evaluate both sides.

Matt
-- 
"Computer Science is merely the post-Turing Decline of Formal Systems Theory."
-???


Re: Testing for NULL return values in test scripts

2005-04-12 Thread Michael G Schwern
On Tue, Apr 12, 2005 at 01:39:59PM -0500, Walter Goulet wrote:
> I can't use Test::Simple, I have to use Test.pm for this module for
> backwards compatibility reasons.

Try Test::Legacy, it gives you an upgrade path away from Test.pm.
http://search.cpan.org/dist/Test-Legacy/

It almost perfectly emulates the Test.pm interface and it works in 
conjunction with other test modules.  If you're worried about dependencies,
you can simply ship a copy of Test::Legacy and Test::Builder with your
module.  Stick 'em in t/lib/ and put "use lib qw(t/lib)" at the top of your
tests.

Then you can say:

use Test::Legacy;  # replaces use Test;

and leave the rest of your code the same.  You can also add in other
modules...

# so as not to clash with Test::Legacy's functions
use Test::More import => [qw(!ok !plan !skip)];


> I'm trying to replace this function call with an ok() call:
> 
> $ctx = Net::SSLeay::SSL_CTX_new() or die ("Unable to create SSL context");
> 
> Hard to tell what $ctx is if SSL_CTX_new() fails; I know it returns NULL in c.

To test for undef using Test.pm... 

ok( $ctx, undef );




Re: Testing for NULL return values in test scripts

2005-04-12 Thread Tels
-BEGIN PGP SIGNED MESSAGE-

Moin,

On Tuesday 12 April 2005 22:15, Michael G Schwern wrote:
> On Tue, Apr 12, 2005 at 01:39:59PM -0500, Walter Goulet wrote:
> > I can't use Test::Simple, I have to use Test.pm for this module for
> > backwards compatibility reasons.
>
> Try Test::Legacy, it gives you an upgrade path away from Test.pm.
> http://search.cpan.org/dist/Test-Legacy/
>
> It almost perfectly emulates the Test.pm interface and it works in
> conjunction with other test modules.  If you're worried about
> dependencies, you can simply ship a copy of Test::Legacy and
> Test::Builder with your module.  Stick 'em in t/lib/ and put "use lib
> qw(t/lib)" at the top of your tests.
>
> Then you can say:

Uhm, is there any reason why you can't do this with Test::Simple, too? 
*puzzled*

Best wishes,

Tels

- -- 
 Signed on Tue Apr 12 22:56:23 2005 with key 0x93B84C15.
 Visit my photo gallery at http://bloodgate.com/photos/
 PGP key on http://bloodgate.com/tels.asc or per email.

 "Retsina?" - "Ja, Papa?" - "Schach Matt." - "Is gut, Papa."

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)

iQEVAwUBQlw2JncLPEOTuEwVAQFHXwf/Uuk+jnOjvijI+Nm+/9v4KaaPa61XoqYx
73Aot4Vm203Q5mYm86ax/HgdsqHQyQWxRBeAIKGN9cASpHj9ZdVBbOrMgNrw4jzC
y/eEw1eODAhb6SfvWLn6mbxjZIFzxmkphP5mgxRMNqqTsXHUCkmk0VaaIcvAxxoH
C61gAcM7uSYSVt+WMlDRPq6D9CmmKVerFpgjo4Puqq32taPK8RRdwtlfDnQTEyDR
KApr8bgCrHNUeWAtuXxO3keig2E96KM/UEKziAPcdLwCH1IJ82JJ24LZl7RRHtTv
jzT1/Fspf5rWptEPyAYQ+QNWDcVInPmJAgs4TAO6Mp+q1zwGCqew5Q==
=01+/
-END PGP SIGNATURE-


ANN: JavaScript TestSimple 0.02

2005-04-12 Thread David Wheeler
I'm pleased to announce the second alpha release of TestSimple, the 
port of Test::Builder, Test::Simple, and Test::More to JavaScript. This 
release has the following changes:

  - Removed eqArray() and eqAssoc() functions from TestMore per
suggestion from Michael Schwern. The problem is that these are 
not
test functions, and so are inconsistent with the way the rest of
the functions work. isDeeply() is the function that users really
want.
  - Changed eqSet() to isSet() and made it into a real test 
function.
  - Implemented skip(), todoSkip(), and todo(). These are a bit
different than the Perl originals originals so read the docs!
  - Implemented skipAll() and BAILOUT() using exceptions and an
exception handler installed in "window.onerror".
  - The final message of a test file now properly outputs in the
proper place. Tests must be run inside an element its "id"
attribute set to "test", such as ''. The
window.onload handler will find it and append the final test
information.
  - Implemented skipRest() in TestBuilder and TestMore. This method 
is
stubbed out the Perl original, but not yet implemented there!

The only truly outstanding issues I see before I would consider these 
"modules" ready for production use are:

* Figure out how to get at file names and line numbers for better 
diagnostic messages. Is this even possible in JavaScript?

* Decide where to send test output, and where to allow other output to 
be sent. Test::Builder clones STDERR and STDOUT for this purpose. We'll 
probably have to do it by overriding C, but it'd be 
good to allow users to define alternate outputs (tests may not always 
run in a browser, eh?). Maybe we can use an output object? Currently, a 
browser and its DOM are expected to be present. I could really use some 
advice from real JavaScript gurus on this one.

* Write tests!
Feedback/advice/insults welcome!
Regards,
David


Re: ANN: JavaScript TestSimple 0.02

2005-04-12 Thread David Wheeler
On Apr 12, 2005, at 2:07 PM, David Wheeler wrote:
I'm pleased to announce the second alpha release of TestSimple, the 
port of Test::Builder, Test::Simple, and Test::More to JavaScript.
And you can download it from here:
  http://www.justatheory.com/downloads/TestSimple-0.02.tar.gz
Cheers,
David


Re: Testing for NULL return values in test scripts

2005-04-12 Thread Walter Goulet
I think the suggestion to use Test::Legacy was based on the statement
'backwards compatibility reasons' require me to use Test.pm. I should
have been clearer in my explanation; the module author is not
permitting me to use any additional modules that aren't included in
perl 5.6.0 to test his module. Therefore, I am restricted to only
using Test.pm for testing the module.

If I had the flexibility of specifying additional dependancies, I
would gladly move to Test::Simple or Test::More.

If only I could convince the author to let me bundle additional test
modules with his distribution...

- walt

On 4/12/05, Tels <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> 
> Moin,
> 
> On Tuesday 12 April 2005 22:15, Michael G Schwern wrote:
> > On Tue, Apr 12, 2005 at 01:39:59PM -0500, Walter Goulet wrote:
> > > I can't use Test::Simple, I have to use Test.pm for this module for
> > > backwards compatibility reasons.
> >
> > Try Test::Legacy, it gives you an upgrade path away from Test.pm.
> > http://search.cpan.org/dist/Test-Legacy/
> >
> > It almost perfectly emulates the Test.pm interface and it works in
> > conjunction with other test modules.  If you're worried about
> > dependencies, you can simply ship a copy of Test::Legacy and
> > Test::Builder with your module.  Stick 'em in t/lib/ and put "use lib
> > qw(t/lib)" at the top of your tests.
> >
> > Then you can say:
> 
> Uhm, is there any reason why you can't do this with Test::Simple, too?
> *puzzled*
> 
> Best wishes,
> 
> Tels
> 
> - --
>  Signed on Tue Apr 12 22:56:23 2005 with key 0x93B84C15.
>  Visit my photo gallery at http://bloodgate.com/photos/
>  PGP key on http://bloodgate.com/tels.asc or per email.
> 
>  "Retsina?" - "Ja, Papa?" - "Schach Matt." - "Is gut, Papa."
> 
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.2.4 (GNU/Linux)
> 
> iQEVAwUBQlw2JncLPEOTuEwVAQFHXwf/Uuk+jnOjvijI+Nm+/9v4KaaPa61XoqYx
> 73Aot4Vm203Q5mYm86ax/HgdsqHQyQWxRBeAIKGN9cASpHj9ZdVBbOrMgNrw4jzC
> y/eEw1eODAhb6SfvWLn6mbxjZIFzxmkphP5mgxRMNqqTsXHUCkmk0VaaIcvAxxoH
> C61gAcM7uSYSVt+WMlDRPq6D9CmmKVerFpgjo4Puqq32taPK8RRdwtlfDnQTEyDR
> KApr8bgCrHNUeWAtuXxO3keig2E96KM/UEKziAPcdLwCH1IJ82JJ24LZl7RRHtTv
> jzT1/Fspf5rWptEPyAYQ+QNWDcVInPmJAgs4TAO6Mp+q1zwGCqew5Q==
> =01+/
> -END PGP SIGNATURE-
>


Re: Testing for NULL return values in test scripts

2005-04-12 Thread Michael G Schwern
On Tue, Apr 12, 2005 at 10:57:02PM +0200, Tels wrote:
> > Try Test::Legacy, it gives you an upgrade path away from Test.pm.
> > http://search.cpan.org/dist/Test-Legacy/
> >
> > It almost perfectly emulates the Test.pm interface and it works in
> > conjunction with other test modules.  If you're worried about
> > dependencies, you can simply ship a copy of Test::Legacy and
> > Test::Builder with your module.  Stick 'em in t/lib/ and put "use lib
> > qw(t/lib)" at the top of your tests.
> >
> > Then you can say:
> 
> Uhm, is there any reason why you can't do this with Test::Simple, too? 
> *puzzled*

If you mean replace "use Test" with "use Test::Simple" the problem is
except in the very, very simple cases Test.pm's ok() function works
differently from Test::Simple/More's ok() function.  Test.pm's ok() is like
ok(), is() and like() all rolled into one.

Test.pm Test::More

ok( $foo ); ==  ok( $foo );
ok( $foo, $bar );   ==  is( $foo, $bar );
ok( $foo, '/regex/');   ==  like( $foo, '/regex/' );
ok( $foo, $code_ref);   ==  is( $foo, $code_ref->() );



Re: Testing for NULL return values in test scripts

2005-04-12 Thread Michael G Schwern
On Tue, Apr 12, 2005 at 04:15:01PM -0500, Walter Goulet wrote:
> I think the suggestion to use Test::Legacy was based on the statement
> 'backwards compatibility reasons' require me to use Test.pm. I should
> have been clearer in my explanation; the module author is not
> permitting me to use any additional modules that aren't included in
> perl 5.6.0 to test his module. Therefore, I am restricted to only
> using Test.pm for testing the module.

Is there a reason for this odd policy?  The only thing I can think of is
to avoid users having to download and install additional dependencies but
the t/lib trick takes care of that.

Test::Builder/More/Simple are tested back to 5.004_05 so there's no
compatibility issue.

If you want to go all the way you can try out Module::Install and PAR to 
completely break the dependency problem.


> If only I could convince the author to let me bundle additional test
> modules with his distribution...

If logic isn't working you might just want to go with the "everybody's doing 
it" argument.  
FWIW here's some important projects which do the t/lib trick.

ExtUtils::MakeMaker
http://search.cpan.org/src/MSCHWERN/ExtUtils-MakeMaker-6.27/t/lib/

Test::Harness
http://search.cpan.org/src/PETDANCE/Test-Harness-2.47_03/t/lib/

mod_perl
http://perl.apache.org/dist/mod_perl-2.0-current/t/lib/

Parrot
https://svn.perl.org/parrot/trunk/lib/

xmlstream
http://www.jabberstudio.org/cgi-bin/viewcvs.cgi/cvs/xmlstream/t/lib/

darcs
http://abridgegame.org/cgi-bin/darcs.cgi/darcs/tests/lib/perl/?c=browse



Testing Ties

2005-04-12 Thread James E Keenan
How do you test that a variable has been tied to a class?
I looked through Test::More; the term 'tie' is conspicuous by its 
absence.  I also searched the archives of this list and couldn't locate 
anything.

I'm looking for something along the lines of Test::More::isa_ok that we 
could use like this where the 'tie' call does not (at least in normal 
practice) explicitly return an object:

use Tie::File;
tie @data, 'Tie::File', $file or die;
is_tied(@data, $file, "[EMAIL PROTECTED] is tied to \$file");
Jim Keenan


Re: Testing Ties

2005-04-12 Thread James E Keenan
James E Keenan wrote:
How do you test that a variable has been tied to a class?
I looked through Test::More; the term 'tie' is conspicuous by its 
absence.  I also searched the archives of this list and couldn't locate 
anything.

I'm looking for something along the lines of Test::More::isa_ok that we 
could use like this where the 'tie' call does not (at least in normal 
practice) explicitly return an object:

use Tie::File;
tie @data, 'Tie::File', $file or die;
is_tied(@data, $file, "[EMAIL PROTECTED] is tied to \$file");
I partially answered my own question by looking at the tests MJD wrote 
for Tie::File.  He has the 'tie' call explicitly return an object:

# from 01_gen.t
my $o = tie @a, 'Tie::File', $file, autochomp => 0, autodefer => 0;
print $o ? "ok $N\n" : "not ok $N\n";
$N++;
But he's not using *any* Perl test module here; everything is manual. 
So I'm still wondering if anybody has attempted something that says, in 
a self-documenting way, "Here I'm testing whether X is tied to Y."

Or perhaps this should be on the TODO list?
Jim Keenan


Re: Testing Ties

2005-04-12 Thread Michael G Schwern
On Tue, Apr 12, 2005 at 06:58:34PM -0400, James E Keenan wrote:
> How do you test that a variable has been tied to a class?

$ perldoc -f tied
   tied VARIABLE
   Returns a reference to the object underlying VARIABLE (the same
   value that was originally returned by the "tie" call that bound
   the variable to a package.)  Returns the undefined value if
   VARIABLE isn't tied to a package.

ie. get the object from the tied variable and then treat it like any other
object.

isa_ok tied $var, "A::Class";


> I'm looking for something along the lines of Test::More::isa_ok that we 
> could use like this where the 'tie' call does not (at least in normal 
> practice) explicitly return an object:

tie() always returns an object.

   The object returned by the "new" method is also
   returned by the "tie" function, which would be useful if you
   want to access other methods in CLASSNAME.


> use Tie::File;
> tie @data, 'Tie::File', $file or die;
> is_tied(@data, $file, "[EMAIL PROTECTED] is tied to \$file");

That can't work as you can't tell what particular thing a variable is
tied to in any sort of universal way... it could be tied to anything.
You can only tell the class and get at the underlying object.

To find out what file a Tie::File variable is tied to you have to use some
Tie::File specific method.

my $obj = tie @data, 'Tie::File', $file or die;
is $obj->filename, $file, "[EMAIL PROTECTED] is tied to $file";

However, AFAIK, Tie::File has no such method.  You can poke inside and
get at it with $obj->{filename} but that's unsupported.  Perhaps a patch
is in order.



Re: Pugs 6.2.0 released.

2005-04-12 Thread Andrew Savige
--- Matt Fowles <[EMAIL PROTECTED]> wrote:
> Autrijus~
> 
> On Apr 12, 2005 3:50 PM, Autrijus Tang <[EMAIL PROTECTED]> wrote:
> > * `xor` and `^^` now short-circuits
> 
> How does this work?  I thought xor /had/ to evaluate both sides.

It does. At least according to "Perl 6 and Parrot Essentials" book,
page 36 it does (I couldn't find details on xor operator in S03).
I added some xor tests which Autrijus fixed. I'm worried now that
my tests may be wrong. On page 36 it says: "it returns the value
of the true operand if any one operand is true".

# cat f.p6
my $x = 0 ^^ 42;
print "x='$x'\n";
$x = (0 xor 42);
print "x='$x'\n";

# pugs f.p6
x='42'
x='42'

Is this correct behaviour? (Pugs used to print not '42' but '1').

/-\


Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com


Re: Testing Ties

2005-04-12 Thread Kevin Scaldeferri
On Apr 12, 2005, at 3:58 PM, James E Keenan wrote:
How do you test that a variable has been tied to a class?
I looked through Test::More; the term 'tie' is conspicuous by its 
absence.  I also searched the archives of this list and couldn't 
locate anything.

I'm looking for something along the lines of Test::More::isa_ok that 
we could use like this where the 'tie' call does not (at least in 
normal practice) explicitly return an object:

use Tie::File;
tie @data, 'Tie::File', $file or die;
is_tied(@data, $file, "[EMAIL PROTECTED] is tied to \$file");
in most cases,
  isa_ok(tied $data, 'Tie::File')
should work, I think.  There's no generic way to check the additional 
arguments like you are trying to do.

-kevin


[perl #34935] [PATCH] r7818: removing more warnings in src/

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


This transaction appears to have no contentthis patch against r7818 should eliminate many more warning messages in 
src/*.c
i'll follow up with another patch against other dirs
 ~jerry


r7818-src-warnings.patch
Description: Binary data


[perl #34936] [PATCH] r7818: removing more warnings in other dirs

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


This transaction appears to have no contentthis patch covers charset/, ops/, pf/, classes/, and io/
adds typecast info, and removes unreferenced locals
 BTW svn made this very much easier than cvs.
 ~jerry


r7818-other-warnings.patch
Description: Binary data


[perl #34937] [PATCH] Absolute library paths on Win32

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


This patch makes Parrot recognise /path/to/file and c:/path/to/file as 
absolute paths on Win32 (so that e.g. 'load_bytecode "c:/path/to/file"' 
can be used instead of 'load_bytecode "c:\\path/to/file"')

-- 
Philip Taylor
[EMAIL PROTECTED]
Index: src/library.c
===
--- src/library.c	(revision 7810)
+++ src/library.c	(working copy)
@@ -202,8 +202,10 @@
 
 /* use absolute paths as is */
 #ifdef WIN32
-if (file_name[0] == '\\' || (isalpha(file_name[0]) &&
-strncmp(file_name+1, ":\\", 2) == 0)) {
+if (file_name[0] == '\\' || file_name[0] == '/' ||
+(isalpha(file_name[0]) &&
+(strncmp(file_name+1, ":\\", 2) == 0 ||
+ strncmp(file_name+1, ":/",  2) == 0))) {
 #else
 if (file_name[0] == '/') {
 #endif


Re: Testing Ties

2005-04-12 Thread James E Keenan
Michael G Schwern wrote:
ie. get the object from the tied variable and then treat it like any other
object.
isa_ok tied $var, "A::Class";

tie() always returns an object.


   use Tie::File;
   tie @data, 'Tie::File', $file or die;
   is_tied(@data, $file, "[EMAIL PROTECTED] is tied to \$file");

That can't work as you can't tell what particular thing a variable is
tied to in any sort of universal way... it could be tied to anything.
You can only tell the class and get at the underlying object.
To find out what file a Tie::File variable is tied to you have to use some
Tie::File specific method.
Thanks.  Tie::File is the Tie::* module I use most often -- and in 
normal use I don't explicitly call for the returned object.  So that's 
why I was puzzled.

jimk


Re: Pugs 6.2.0 released.

2005-04-12 Thread Luke Palmer
Andrew Savige writes:
> --- Matt Fowles <[EMAIL PROTECTED]> wrote:
> > Autrijus~
> > 
> > On Apr 12, 2005 3:50 PM, Autrijus Tang <[EMAIL PROTECTED]> wrote:
> > > * `xor` and `^^` now short-circuits
> > 
> > How does this work?  I thought xor /had/ to evaluate both sides.
> 
> It does. At least according to "Perl 6 and Parrot Essentials" book,
> page 36 it does (I couldn't find details on xor operator in S03).
> I added some xor tests which Autrijus fixed. I'm worried now that
> my tests may be wrong. On page 36 it says: "it returns the value
> of the true operand if any one operand is true".
> 
> # cat f.p6
> my $x = 0 ^^ 42;
> print "x='$x'\n";
> $x = (0 xor 42);
> print "x='$x'\n";
> 
> # pugs f.p6
> x='42'
> x='42'
> 
> Is this correct behaviour? (Pugs used to print not '42' but '1').

Ahh, so it returns the correct value.  It's not short-circuiting
because, for example, in this expression:

a() xor b()

There is no value that a() (or b()) could return that would supress the
evaluation of the other.

Luke


trim() and words() functions?

2005-04-12 Thread gcomnz
Hey all, not sure if I'm just missing some obvious source of
information, but I used trim() as a function in a cookbook example,
then realized that it's not even in S29...

There is a brief mention of trim(), as well as words() (odd as the
words() function may seem, to me at least), at
http://tinyurl.com/6fjda but it hardly seems definitive.

Trim sure is handy and would get used a lot, I think. But boy do I
need to study up on my Unicode: I have such a hard time believing that
words() is practical for CJK. It sure would be cool I guess, if that
did work.

Any validation on whether either, both, or neither of those functions
is supposed to exist?

Just to throw another question in the works and perhaps gunk up the
machine, the link above also talks about whether or not these
functions would exist as methods to strings and arrays. I'm certainly
not clear on what the outcome of that is? I've been writing examples
as if that's a possibility and no one seems to be disputing those, so
I apologize if I just need to be pointed to where methods v functions
is clarified.

Perhaps a good "next" synopsis would be to start putting some docs
around the String and Array object methods? Again, sorry if I'm
missing that in some obvious location already.

Thanks!

Marcus


Re: Pugs 6.2.0 released.

2005-04-12 Thread John Macdonald
On Tuesday 12 April 2005 19:18, Andrew Savige wrote:
> It does. At least according to "Perl 6 and Parrot Essentials" book,
> page 36 it does (I couldn't find details on xor operator in S03).
> I added some xor tests which Autrijus fixed. I'm worried now that
> my tests may be wrong. On page 36 it says: "it returns the value
> of the true operand if any one operand is true".

The mathematical definition of xor for two arguments is "true if
exactly one argument is true, false otherwise".  When that gets
generalized to multiple arguments it means "true if an odd number
of the arguments are true, false otherwise".  So, you cannot short
circuit the evaluation because any value, if it happens to be true,
changes the result of the expression.  However, with perl's usual
flexibility for the value "true" you could choose the first or last true
value as the result if there were an odd number of true values, I
suppose, but returning last true (or false) makes more sense.
(Using the first is essentially the same as making xor right associative
instead of left.)


Re: Pugs 6.2.0 released.

2005-04-12 Thread Darren Duncan
At 8:27 PM -0400 4/12/05, John Macdonald wrote:
The mathematical definition of xor for two arguments is "true if
exactly one argument is true, false otherwise".
Yes.
When that gets
generalized to multiple arguments it means "true if an odd number
of the arguments are true, false otherwise".
Is this the official mathematics position?
If not, I would generalize it like this: true If >= 1 arg is true 
and >= 1 arg is false, otherwise false.

Is that better or worse?
  So, you cannot short
circuit the evaluation because any value, if it happens to be true,
changes the result of the expression.
If my assertion is used, then all you can short circuit once you find 
a true value and a false value.

Of course, we should go with what the official mathematics standard is.
-- Darren Duncan


Re: Pugs 6.2.0 released.

2005-04-12 Thread Luke Palmer
Darren Duncan writes:
> At 8:27 PM -0400 4/12/05, John Macdonald wrote:
> >The mathematical definition of xor for two arguments is "true if
> >exactly one argument is true, false otherwise".
> 
> Yes.
> 
> >When that gets
> >generalized to multiple arguments it means "true if an odd number
> >of the arguments are true, false otherwise".
> 
> Is this the official mathematics position?

Naively, yes.  And mathematics othen revels in the naive position (any
other would not be consistent):

xor(1, 0, 0, 1, 1, 0)
1 xor 0 xor 0 xor 1 xor 1 xor 0
1 xor (0 xor (0 xor (1 xor (1 xor 0
1  # parity 1, odd number of arguments true

> If not, I would generalize it like this: true If >= 1 arg is true 
> and >= 1 arg is false, otherwise false.
> 
> Is that better or worse?

I don't think that's what xor is testing.  I can't quite think of why
you'd need that (but I can't quite think of why you'd need xor
either...).

Luke


Re: Pugs 6.2.0 released.

2005-04-12 Thread John Macdonald
On Tuesday 12 April 2005 20:45, Darren Duncan wrote:
> At 8:27 PM -0400 4/12/05, John Macdonald wrote:
> >The mathematical definition of xor for two arguments is "true if
> >exactly one argument is true, false otherwise".
> 
> Yes.
> 
> >When that gets
> >generalized to multiple arguments it means "true if an odd number
> >of the arguments are true, false otherwise".
> 
> Is this the official mathematics position?

It's simply chaining a series of 2-arg xor's together.  As it happens, the
result of such chaining comes out as "odd number true" and has the nice
properties of being commutative [a xor b === b xor a] and associative
[((a xor b) xor c) === (a xor (b xor c))].

> If not, I would generalize it like this: true If >= 1 arg is true 
> and >= 1 arg is false, otherwise false.
> 
> Is that better or worse?

The "mathematical" definition can generalize down to one or zero
elements as well as up to n.

> >   So, you cannot short
> >circuit the evaluation because any value, if it happens to be true,
> >changes the result of the expression.
> 
> If my assertion is used, then all you can short circuit once you find 
> a true value and a false value.

Well, it's a function that can be short circuited, but it's not xor and would
have different uses.


Re: [PROPOSAL] calling convention abstraction

2005-04-12 Thread Bob Rogers
   From: Roger Hale <[EMAIL PROTECTED]>
   Date: Mon, 11 Apr 2005 09:30:32 -0400

   Bob Rogers wrote:
   >From: Roger Hale <[EMAIL PROTECTED]>
   >Date: Thu, 07 Apr 2005 04:23:41 -0400
   > 
   >Leopold Toetsch wrote:
   >> Roger Hale <[EMAIL PROTECTED]> wrote:
   >> 
   >>>Leopold Toetsch wrote:
   >>>
   >>>>As @ARGS (or @IN_ARGS, @OUT_ARGS) is being stored in the context, and
   >>>>that context is defacto the continuation, yes - a tail-call would
   >>>>inherit this information.
   >> 
   >>>But as each tail-call supplies a new @ARGS, how can this be the case?
   >> 
   >> We would have two parts in the context: @IN_ARGS, @OUT_ARGS. The
   >> C opcode can preserve that part with the return context.
   > 
   >It seems to me that both @IN_ARGS and @OUT_ARGS get used for other 
   >things (the tail-calls' arguments) in a chain of tail-calls.
   > 
   > The definition of a tail call is that it returns its callee's results
   > back to its caller unmodified.

   Agreed, but...

   > So if @OUT_ARGS is used for other
   > things, then it's not a tail call.

   I don't understand.  @OUT_ARGS aren't the arguments returned (to my 
   understanding), they're the arguments to the next function in sequence.

My mistake; I had thought "@OUT_ARGS" meant "results".  I see I didn't
read Leo's original proposal carefully enough, and you were just
following his terminology; my apologies.  I agree that information about
return context can't live in @ARGS (in or out) directly.

   >. . . but the continuation (I propose) does; and this continues to be
   >good for whoever wants to know: the return object holds the return
   >context.
   > 
   >No?
   > 
   >regards,
   >  Roger
   > 
   > I believe so, but I think this is what Leo meant by "... that context is
   > defacto the continuation."  There doesn't need to be a separate "return
   > object" because it would be one-to-one with the continuation.

   Sorry, by "return object" I was only meaning the continuation; you are 
   quite right.  Just using a different term for parallelism with "return 
   context", but I see it only introduced confusion.

So it sounds like we are all saying the same thing now?

-- Bob


Re: Pugs 6.2.0 released.

2005-04-12 Thread Patrick R. Michaud
On Tue, Apr 12, 2005 at 05:45:24PM -0700, Darren Duncan wrote:
> At 8:27 PM -0400 4/12/05, John Macdonald wrote:
> >The mathematical definition of xor for two arguments is "true if
> >exactly one argument is true, false otherwise".
> 
> Yes.
> 
> >When that gets
> >generalized to multiple arguments it means "true if an odd number
> >of the arguments are true, false otherwise".
> 
> Is this the official mathematics position?
> 
> If not, I would generalize it like this: true If >= 1 arg is true 
> and >= 1 arg is false, otherwise false.

The above generalization is probably wrong.  C and C<^^> are
analogous to C and C<||> in that they can return one of their 
operands as values, and not a boolean "true" value (unless of
course that happens to be one of the operands).  The returns-a-boolean 
form of xor is &infix: .

Thus:

$a = 0 ^^ 5;# $a == 5
$b = 7 ^^ 0;# $b == 7
$c = 7 ^^ 5;# $c == false or 0, could be argued either way
$d = 0 ^^ 0;# $d == 0

but what to do with

$e = 2 ^^ 4 ^^ 6;   # $e == ??

One could treat it as 

$e = 2 ^^ (4 ^^ 6);  # $e == 2

or maybe 

$e = (2 ^^ 4) ^^ 6;  # $e == 6

or one could even be analogous to the one() junction (&infix:^) 
such that

$e = 2 ^^ 4 ^^ 6;# $e == false or 0 

> Of course, we should go with what the official mathematics standard is.

Only if someone can define what the "mathematics standard" is here
without saying that "xor returns 'true' or 'false'".  (Of course, p6l
is allowed to trump us on this one.)

Pm


Re: subscripts are.... objects?

2005-04-12 Thread Rod Adams
Thomas Sandlaß wrote:
Yuval Kogman wrote:
You can perform set operations on them:
[!-2]

Hmm, that would produce a boolean index.

is the subscript for everything but the second to last element.
By using a context enforcer (subscript [] ?, maybe since lists are
lazyy they can just be subscripts when used that way?) you can get a
subscript object, which you can then use in a subscript, and it
flattens out.
The set math is done by special casing junctions, perhaps?

I'm not the junction expert, but it's said that they wrap around
indexing/slicing! So the @array[!-2] would just read @array[none(-2)]?
But how does none() get the base set where the second to last is excluded
from?
It does no such thing. It creates a new none() junction over what was 
stored at index -2. It's when you evaluate the new junction that the 
none comes into effect.

And once again, I feel the need to remind people that junctions and sets 
are two different things.

If I get to do what I'd like to to junctions, the above would actually 
be illegal. But for that I have to wait for Damian to get back. Given 
that when he left he said "I'll be away for the rest of the week", and 
that was on Feb 22, one can be left to assume that Damian is suffering 
from a very long week. Poor Damian. Sadly, my recent weeks have felt as 
if they were 2 months long. Here's to a return of the 7 day 
week!

-- Rod Adams


Re: Pugs 6.2.0 released.

2005-04-12 Thread Patrick R. Michaud
On Tue, Apr 12, 2005 at 09:15:13PM -0400, John Macdonald wrote:
> On Tuesday 12 April 2005 20:45, Darren Duncan wrote:
> > At 8:27 PM -0400 4/12/05, John Macdonald wrote:
> > >The mathematical definition of xor for two arguments is "true if
> > >exactly one argument is true, false otherwise".
> > 
> > Yes.
> > 
> > >When that gets
> > >generalized to multiple arguments it means "true if an odd number
> > >of the arguments are true, false otherwise".
> > 
> > Is this the official mathematics position?
> 
> It's simply chaining a series of 2-arg xor's together.  As it happens, the
> result of such chaining comes out as "odd number true" and has the nice
> properties of being commutative [a xor b === b xor a] and associative
> [((a xor b) xor c) === (a xor (b xor c))].

It's entirely possible that I have my mathematics messed up here,
but C doesn't seem to me to be entirely associative, at least not
as I commonly think of associativity.  Consider

   $x = (((0 xor 2) xor 4) xor 6);# ((a xor b) xor c) == 6

   $y = ((0 xor 2) xor (4 xor 6));# (a xor (b xor c)) == 2

Pm


Re: trim() and words() functions?

2005-04-12 Thread Rod Adams
gcomnz wrote:
Hey all, not sure if I'm just missing some obvious source of
information, but I used trim() as a function in a cookbook example,
then realized that it's not even in S29...
There is a brief mention of trim(), as well as words() (odd as the
words() function may seem, to me at least), at
http://tinyurl.com/6fjda but it hardly seems definitive.
Trim sure is handy and would get used a lot, I think. But boy do I
need to study up on my Unicode: I have such a hard time believing that
words() is practical for CJK. It sure would be cool I guess, if that
did work.
Any validation on whether either, both, or neither of those functions
is supposed to exist?
 

Well, some form of words() exists... only spelled  q:w//, with various 
doublings of q and w available, some of which can be spelled <> or «», 
though to be honest, I've lost track of how often the meanings of those 
as quoters has changed. I suspect S02 or S03 would have that answer.

As for whether or not these actually exist, I'd like a bit more 
consensus that they are actually needed as builtins. One side of me says 
"Hey, we've got them all seperated into different namespaces now, so 
we're not really getting polluted, so sure, let's add anything that's in 
the least bit useful". The other side of me then starts to say 
"bloated". I'm not sure where the balance on this lies, and will yield 
to the will of those better at language design than myself.

Just to throw another question in the works and perhaps gunk up the
machine, the link above also talks about whether or not these
functions would exist as methods to strings and arrays. I'm certainly
not clear on what the outcome of that is? I've been writing examples
as if that's a possibility and no one seems to be disputing those, so
I apologize if I just need to be pointed to where methods v functions
is clarified.
 

Many of them will happen in S29, since there's an odd duality that class 
based multi subs exist in. I don't pretend to fully understand it, but 
look at http://www.nntp.perl.org/group/perl.perl6.language/19802 for 
insight.

-- Rod Adams


Re: Pugs 6.2.0 released.

2005-04-12 Thread John Macdonald
On Tuesday 12 April 2005 22:36, Patrick R. Michaud wrote:
> On Tue, Apr 12, 2005 at 09:15:13PM -0400, John Macdonald wrote:
> > On Tuesday 12 April 2005 20:45, Darren Duncan wrote:
> > > At 8:27 PM -0400 4/12/05, John Macdonald wrote:
> > > >The mathematical definition of xor for two arguments is "true if
> > > >exactly one argument is true, false otherwise".
> > > 
> > > Yes.
> > > 
> > > >When that gets
> > > >generalized to multiple arguments it means "true if an odd number
> > > >of the arguments are true, false otherwise".
> > > 
> > > Is this the official mathematics position?
> > 
> > It's simply chaining a series of 2-arg xor's together.  As it happens, the
> > result of such chaining comes out as "odd number true" and has the nice
> > properties of being commutative [a xor b === b xor a] and associative
> > [((a xor b) xor c) === (a xor (b xor c))].
> 
> It's entirely possible that I have my mathematics messed up here,
> but C doesn't seem to me to be entirely associative, at least not
> as I commonly think of associativity.  Consider
> 
>$x = (((0 xor 2) xor 4) xor 6);# ((a xor b) xor c) == 6
> 
>$y = ((0 xor 2) xor (4 xor 6));# (a xor (b xor c)) == 2

You're both messed up your math and you've mixed the boolean
xor function up with the extension of it to an array of bits that is used
for integer xor.  When you xor integers, you are really xor'ing each
of the bit positions in the integers in parallel, using the boolean xor
function for each bit independently.

You can see the same boolean/integer difference in perl5 with:

(4&2) is 0
(4&&2) is 4

Meanwhile, with your example (using integer xor):


(((0 xor 2) xor 4) xor 6)
is ((2 xor 4) xor 6)
is (6 xor 6)
is 0

((0 xor 2) xor (4 xor 6))
is (2 xor (4 xor 6))
is (2 xor 2)
is 0

The same example, using boolean xor:

(((0 xor 2) xor 4) xor 6)
--> (((false xor true) xor true) xor true)
--> ((true xor true) xor true)
--> (false xor true)
--> true

((0 xor 2) xor (4 xor 6))
--> ((false xor true) xor (true xor true))
--> (true xor (true xor true))
--> (true xor false)
--> true

While boolean xor and integer xor give different results (just as boolean
and integer AND gave different results in my example above) they are
both perfectly associative.

The issue for perl, in the boolean xor case, is which particular true value
will be returned (I'd prefer 6 my self, simply by not changing the numbers
to true and false, but rather leaving them as their numerical values and then
having xor return the non-false value if there is exactly one, or returning
0 otherwise.  However, *that* interpretation reduces the associativity
because adding parentheses can change which component value is returned
for a true result as shown by your example:

(((0 xor 2) xor 4) xor 6)
--> ((2 xor 4) xor 6)
--> (0 xor 6)
--> 6

((0 xor 2) xor (4 xor 6))
--> (2 xor (4 xor 6))
--> (2 xor 0)
--> 2

Both return a true value, but it is a different true value.


Re: trim() and words() functions?

2005-04-12 Thread gcomnz
> Rod Adams wrote:
> Well, some form of words() exists... only spelled  q:w//, with various
> doublings of q and w available, some of which can be spelled <> or «»,
> though to be honest, I've lost track of how often the meanings of those
> as quoters has changed. I suspect S02 or S03 would have that answer.

I must have misunderstood the original discussion that I linked to.
When i saw words() I assumed words($string), and that it was a split
by 'words' function. Sorry if that was my dumb error.

I'm aware of q:w//, just didn't realize that's what I was seeing.

> As for whether or not these actually exist, I'd like a bit more
> consensus that they are actually needed as builtins. One side of me says
> "Hey, we've got them all seperated into different namespaces now, so
> we're not really getting polluted, so sure, let's add anything that's in
> the least bit useful". The other side of me then starts to say
> "bloated". I'm not sure where the balance on this lies, and will yield
> to the will of those better at language design than myself.

I agree, with my (probably wrong) impression that words() was a "split
a string into words" function, I was thinking to myself bloat, but
then I was also reminding myself that Perl's power as a natural
language text processor has always been a premium feature (somehow
even prior to full Unicode).

Marcus Adair


Re: trim() and words() functions?

2005-04-12 Thread gcomnz
> I agree, with my (probably wrong) impression that words() was a "split
> a string into words" function, I was thinking to myself bloat, but
> then I was also reminding myself that Perl's power as a natural
> language text processor has always been a premium feature (somehow
> even prior to full Unicode).

On the other hand: words() as i (mis-)understood it, probably is
perfectly covered by Rules, sure does seem like bloat that's unlikely
to be in the final spec now that I continue thinking about it :)

Marcus Adair


Re: Pugs 6.2.0 released.

2005-04-12 Thread Patrick R. Michaud
On Tue, Apr 12, 2005 at 11:13:18PM -0400, John Macdonald wrote:
> On Tuesday 12 April 2005 22:36, Patrick R. Michaud wrote:
> > It's entirely possible that I have my mathematics messed up here,
> > but C doesn't seem to me to be entirely associative, at least not
> > as I commonly think of associativity.  Consider
> > 
> >$x = (((0 xor 2) xor 4) xor 6);# ((a xor b) xor c) == 6
> > 
> >$y = ((0 xor 2) xor (4 xor 6));# (a xor (b xor c)) == 2
> 
> You're both messed up your math and you've mixed the boolean
> xor function up with the extension of it to an array of bits that is used
> for integer xor.  When you xor integers, you are really xor'ing each
> of the bit positions in the integers in parallel, using the boolean xor
> function for each bit independently.

No, I'm afraid I haven't messed up my math.  Integer-xor is &infix:<+^> .
Array-of-bits-xor is &infix:<~^> .  I'm specifically talking about 
&infix:, which "Perl 6 and Parrot Essentials" says (p. 36):

   The XOR relation ... returns the value of the true operand if any
   one operand is true, and a false value if both are true or neither
   is true.

It does *not* say that XOR returns "true", it says it returns
"the value of the true operand".  (Note that this is different from p5,
which at least on my system does return true/false for C.)


> You can see the same boolean/integer difference in perl5 with:
> 
> (4&2) is 0
> (4&&2) is 4

Yes, I know this difference.  And in perl 6, the difference is

   (4 +& 2) is 0
   (4 && 2) is 4

   (4 +^ 2) is 6
   (4 ^^ 2) is false

> Meanwhile, with your example (using integer xor):
> (((0 xor 2) xor 4) xor 6)
> is ((2 xor 4) xor 6)
> is (6 xor 6)
> is 0

Integer xor is  (((0 +^ 2) +^ 4) +^ 6) == 0.

> The same example, using boolean xor:
> (((0 xor 2) xor 4) xor 6)
> --> (((false xor true) xor true) xor true)
> --> ((true xor true) xor true)
> --> (false xor true)
> --> true

Boolean xor is (((0 ?^ 2) ?^ 4) ?^ 6) == 1.

> While boolean xor and integer xor give different results (just as boolean
> and integer AND gave different results in my example above) they are
> both perfectly associative.

Yes, boolean xor and integer xor are associative.  But that's not what
I was talking about.   In particular:

(((0 xor 2) xor "four") xor "six")
--> ((2 xor "four") xor "six")
--> (false xor "six")
--> "six"

> The issue for perl, in the boolean xor case, is which particular true value
> will be returned 

The &infix: operator in perl 6 is not a "boolean" operator, it's
a low-level "logical" operator, same as &infix: and &infix:.
And C returns one of its arguments (or "false"), again the same that
C and C do.  And within these constraints, I don't believe
that C is mathematically associative according to any of the
definitions offerred thus far.

Pm


Hyper operator corner case?

2005-04-12 Thread David Christensen
Hey folks,
I wanted to delurk and address an issue that may need clarification in 
regards to hyper operators.

Quoting S03:
If one argument is insufficiently dimensioned, Perl "upgrades" it:
 (3,8,2,9,3,8) >>-<< 1;  # (2,7,1,8,2,7)
Now in this example case, it's pretty clear that the scalar 1 gets 
turned into a list of 1s with the length of the lhs.  What about the 
case of a larger-dimensioned or single-dimensioned array?

Example:
  (1,2,3,4,5) >>+<< (1,2)
Is this equivalent to:
a) (1,2,3,4,5) >>+<< (1,2,undef,undef,undef) (undef padding)
b) (1,2,3,4,5) >>+<< (1,2,1,2,1) (repetition)
c) (1,2,3,4,5) >>+<< (1,2,2,2,2) (stretching)
d) (1,2) >>+<< (1,2) (truncation)
e) something else, ie, warnings about mismatched dimension, die(), 
segfault, kill -9 1 (whatever your sadism level is).

Additionally, I was wondering if there was a difference between:
(3,8,2,9,3,8) >>-<< 1
and
(3,8,2,9,3,8) >>-<< (1)
I suppose the answer to that depends on the answer to the above 
question.

If the answer is the a) case as above and undef resolves to 0 
numerically, then we run into another issue to consider.  In the case 
of addition and subtraction, 0 is the identity element, and so:

(1,2,3,4,5) >>+<< (1,2) yields (2,4,3,4,5).
But the intuitiveness goes away with multiplication, and completely 
blows up with division:

(1,2,3,4,5) >>*<< (1,2) yields (1,4,0,0,0), probably not what we wanted.
(1,2,3,4,5) >>/<< (1,2) yields (1,1,NaN,NaN,NaN), and probably die()s 
with division by zero errors.

If in the addition and subtraction cases we want to preserve the 
identity cases for the slots not accounted for, undef is fine because 
it resolves to 0; to provide the same features for multiplication and 
division, the identity element would have to be 1.  But that would 
suppose that the potential hyper-operators would know what their 
appropriate identity elements were (and that such a thing is meaningful 
to them).

Additionally, if there is a difference between the automatic scalar 
promotion and list promotion, we could run into errors where people 
would expect an expression to be a scalar which would be promoted in 
the documented fashion, but would really be promoted in one of a)-e), 
breaking what they expected:

(1..5) >>+<< ($a-$b) # list context for the expression?  Promotes like 
what?
(1..5) >>+<< +($a-$b) # forced scalar context -- promotes like 
documented.
(1..5) >>+<< (1) # promotes like what?

Thoughts?
David Christensen


Re: trim() and words() functions?

2005-04-12 Thread Larry Wall
On Tue, Apr 12, 2005 at 09:52:38PM -0500, Rod Adams wrote:
: gcomnz wrote:
: 
: >Hey all, not sure if I'm just missing some obvious source of
: >information, but I used trim() as a function in a cookbook example,
: >then realized that it's not even in S29...
: >
: >There is a brief mention of trim(), as well as words() (odd as the
: >words() function may seem, to me at least), at
: >http://tinyurl.com/6fjda but it hardly seems definitive.
: >
: >Trim sure is handy and would get used a lot, I think. But boy do I
: >need to study up on my Unicode: I have such a hard time believing that
: >words() is practical for CJK. It sure would be cool I guess, if that
: >did work.

A words() function would only be useful for space-separated CJK.

: >Any validation on whether either, both, or neither of those functions
: >is supposed to exist?
: > 
: >
: Well, some form of words() exists... only spelled  q:w//, with various 
: doublings of q and w available, some of which can be spelled <> or «», 
: though to be honest, I've lost track of how often the meanings of those 
: as quoters has changed. I suspect S02 or S03 would have that answer.

Yes, it's a dup of «$string», so we probably don't need words().
On the other hand, there's no trivially obvious way to trim whitespace
from both ends of a string.  (Not that «$string» is *entirely*
obvious either...)  Of course, generations of Perl programmers have
made do with various forms of s///, trudging miles through the snow,
uphill both ways.

: As for whether or not these actually exist, I'd like a bit more 
: consensus that they are actually needed as builtins. One side of me says 
: "Hey, we've got them all seperated into different namespaces now, so 
: we're not really getting polluted, so sure, let's add anything that's in 
: the least bit useful". The other side of me then starts to say 
: "bloated". I'm not sure where the balance on this lies, and will yield 
: to the will of those better at language design than myself.

Hmm, where there's a way, there's a will, I guess.

Larry


  1   2   >