Re: [svn:perl6-synopsis] r14485 - doc/trunk/design/syn

2008-01-17 Thread Moritz Lenz
[EMAIL PROTECTED] wrote:

>  The C<:ii> variant may be used on a substitution to change the
>  substituted string to the same case pattern as the matched string.
> -Case info is carried across on a character by character basis.  If
> -the right string is longer than the left one, the case of the final
> -character is replicated.
> +Case info is carried across on a character by character basis.  If the
> +right string is longer than the left one, the case of the final
> +character is replicated.  Titlecase is carried across if possible
> +regardless of whether the resulting letter is at the beginning of
> +a word or not; if there is no titlecase character available, the
> +corresponding uppercase character is used.  (This policy can be
> +modified within a lexical scope by a language-dependent Unicode
> +declaration to substitute titlecase according to the orthographic
> +rules of the specified language.)


what happens if some of the characters aren't cased at all, like white
spaces?

my $str = "AB DE";
$str ~~ s:ii/.*/abcde/;

is the result ABcDE ? or is the space ignored and the substition is
performed as if $str was "ABDE" in the first place?

IMHO the current behaviour is not very DWIMmy.

Instead I'd suggest to check if the matched string is
 * all lowercase
 * all uppercase
 * firsts letter upper, rest lower
 * the other way round
 * Capitalized (first char of each word is upper)
and if any of these hold true (checked in this order), then the same
casing rule is applied to the substitution string.

> @@ -212,7 +218,8 @@
>  substituted string to the same accent pattern as the matched string.
>  Accent info is carried across on a character by character basis.  If
>  the right string is longer than the left one, the remaining characters

my $str = "määh";
$str =~ s:bb/.*/mo i/;

is $str now 'mö i' ? Or does the space get a \N{COMBINING DIAERESIS}? Or
is it tranlated to \N{DIAERESIS}? What about other non-letter characters?



-- 
Moritz Lenz
http://moritz.faui2k3.org/ |  http://perl-6.de/





signature.asc
Description: OpenPGP digital signature


Re: Extending Parrot NCI callback functionality

2008-01-17 Thread Paul Seamons
> I am starting to implement a GLUT and OpenGL binding for Parrot.  GLUT
> is extremely callback-oriented.  You essentially can't do anything
> beyond open the top-level window until callbacks are functional.  You
> can't even draw in that window -- the rendered image never actually
> appears, and in fact the window itself is simply transparent with just
> the chrome showing.

I started down this path several months ago.  The following is the thread on 
the topic.

http://tinyurl.com/3crzpu

In that short thread, Allison Randall responded with:

 The immediate solution, to get OpenGL working now without waiting for 
 the implementation of the concurrency scheduler and JITed call/callback 
 thunks, is to add a few more callback signatures to the current set of 
 alternatives, and to write a little bit of custom C code for the cases 
 that can't pass dispatch information in a user data argument. 

It appears that NCI is on the roadmap a couple of months out (or more), but 
that when it is done it will be done right - for some definition of right.
I would've put more work into a temporary solution, but real life has 
interfered.

I'm glad to see other people interested in OpenGL on parrot.  When the NCI PDD 
is up for drafting, it will be good to have a listing of sample libraries and 
required callback signatures available.

I'm excited about the progress Parrot is making.

Paul


Re: [svn:perl6-synopsis] r14485 - doc/trunk/design/syn

2008-01-17 Thread Ryan Richter
On Thu, Jan 17, 2008 at 10:57:11AM +0100, Moritz Lenz wrote:
> what happens if some of the characters aren't cased at all, like white
> spaces?
> 
> my $str = "AB DE";
> $str ~~ s:ii/.*/abcde/;
> 
> is the result ABcDE ? or is the space ignored and the substition is
> performed as if $str was "ABDE" in the first place?

I think chars in the target string should be left alone when the
corresponding pattern char is uncased, so I vote for "ABcDE".

> my $str = "määh";
> $str =~ s:bb/.*/mo i/;
> 
> is $str now 'mö i' ? Or does the space get a \N{COMBINING DIAERESIS}? Or
> is it tranlated to \N{DIAERESIS}? What about other non-letter characters?

This case is actually pretty clear, combining codes will combine with
space (0020), in fact that's the canonical way to display them on their
own.  And in graph mode, Perl 6 will consider a space with COMBINING
DIAERESIS and a plain DIAERESIS to be the same character, because their
representations in NFD are the same.

A hard case would be \n instead of space, because combining chars won't
combine with it - "\n\N{COMBINING DIAERESIS}" is two graphemes.  I'm not
sure what samebase should do in that case.

-ryan


[svn:perl6-synopsis] r14490 - doc/trunk/design/syn

2008-01-17 Thread larry
Author: larry
Date: Thu Jan 17 10:22:06 2008
New Revision: 14490

Modified:
   doc/trunk/design/syn/S05.pod

Log:
Clarifications suggested by moritz++ and rhr++


Modified: doc/trunk/design/syn/S05.pod
==
--- doc/trunk/design/syn/S05.pod(original)
+++ doc/trunk/design/syn/S05.podThu Jan 17 10:22:06 2008
@@ -14,9 +14,9 @@
Maintainer: Patrick Michaud <[EMAIL PROTECTED]> and
Larry Wall <[EMAIL PROTECTED]>
Date: 24 Jun 2002
-   Last Modified: 10 Jan 2008
+   Last Modified: 17 Jan 2008
Number: 5
-   Version: 70
+   Version: 71
 
 This document summarizes Apocalypse 5, which is about the new regex
 syntax.  We now try to call them I rather than "regular
@@ -192,7 +192,9 @@
 
 The C<:ii> variant may be used on a substitution to change the
 substituted string to the same case pattern as the matched string.
-Case info is carried across on a character by character basis.  If the
+
+If the pattern is matched without the C<:sigspace> modifier, case
+info is carried across on a character by character basis.  If the
 right string is longer than the left one, the case of the final
 character is replicated.  Titlecase is carried across if possible
 regardless of whether the resulting letter is at the beginning of
@@ -200,7 +202,28 @@
 corresponding uppercase character is used.  (This policy can be
 modified within a lexical scope by a language-dependent Unicode
 declaration to substitute titlecase according to the orthographic
-rules of the specified language.)
+rules of the specified language.)  Characters that carry no case
+information leave their corresponding replacement character unchanged.
+
+If the pattern is matched with C<:sigspace>, then a slightly smarter
+algorithm is used which attempts to determine if there is a uniform
+capitalization policy over each matched word, and applies the same
+policy to each replacement word.  If there doesn't seem to be a uniform
+policy on the left, the policy for each word is carried over word by
+word, with the last pattern word replicated if necessary.  If a word
+does not appear to have a recognizable policy, the replacement word
+is translated character for character as in the non-sigspace case.
+Recognized policies include:
+
+lc()
+uc()
+ucfirst(lc())
+lcfirst(uc())
+capitalize()
+
+In any case, only the officially matched string part of the pattern
+match counts, so any sort of lookahead or contextual matching is not
+included in the analysis.
 
 =item *
 
@@ -220,6 +243,7 @@
 the right string is longer than the left one, the remaining characters
 are substituted without any modification.  (Note that NFD/NFC distinctions
 are usually immaterial, since Perl encapsulates that in grapheme mode.)
+Under C<:sigspace> the preceding rules are applied word by word.
 
 =item *
 


[svn:parrot-pdd] r24944 - trunk/docs/pdds/draft

2008-01-17 Thread chromatic
Author: chromatic
Date: Thu Jan 17 11:28:43 2008
New Revision: 24944

Modified:
   trunk/docs/pdds/draft/pdd09_gc.pod

Log:
[PDD] Added yet another reference link to the GC PDD.

Modified: trunk/docs/pdds/draft/pdd09_gc.pod
==
--- trunk/docs/pdds/draft/pdd09_gc.pod  (original)
+++ trunk/docs/pdds/draft/pdd09_gc.pod  Thu Jan 17 11:28:43 2008
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007, The Perl Foundation.
+# Copyright (C) 2001-2008, The Perl Foundation.
 # $Id$
 
 =head1 NAME
@@ -362,3 +362,5 @@
 "A unified theory of garbage collection" 

 
 "Scalable Locality-Conscious Multithreaded Memory Allocation" 
http://people.cs.vt.edu/~scschnei/papers/ismm06.pdf
+
+"Parallel and concurrent garbage collectors" 



[svn:perl6-synopsis] r14491 - doc/trunk/design/syn

2008-01-17 Thread larry
Author: larry
Date: Thu Jan 17 13:18:31 2008
New Revision: 14491

Modified:
   doc/trunk/design/syn/S02.pod

Log:
Define truthiness of standard types.


Modified: doc/trunk/design/syn/S02.pod
==
--- doc/trunk/design/syn/S02.pod(original)
+++ doc/trunk/design/syn/S02.podThu Jan 17 13:18:31 2008
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall <[EMAIL PROTECTED]>
   Date: 10 Aug 2004
-  Last Modified: 10 Jan 2008
+  Last Modified: 17 Jan 2008
   Number: 2
-  Version: 125
+  Version: 126
 
 This document summarizes Apocalypse 2, which covers small-scale
 lexical items and typological issues.  (These Synopses also contain
@@ -3015,6 +3015,29 @@
 
 return 0 but True;
 
+=item *
+
+The definition of C<.true> for the most ancestral type (that is, the
+C type) is equivalent to C<.defined>.  Since protoobjects are
+considered undefined, all protoobjects (including C itself)
+are false unless the type overrides the definition of C<.true>
+to include undefined values.  Instantiated objects default to true
+unless the class overrides the definition.  Note that if you could
+instantiate an C it would be considered defined, and thus true.
+(It is not clear that this is allowed, however.)
+
+=item *
+
+In general any container types should return false if they are empty,
+and true otherwise.  This is true of all the standard container types
+except Scalar, which always defers the definition of truth to its
+contents.  Non-container types define truthiness much as Perl 5 does.
+
+Just as with the standard types, user-defined types should feel free
+to partition their defined values into true and false values if such
+a partition makes sense in control flow using boolean contexts, since
+the separate C<.defined> method is always there if you need it.
+
 =back
 
 =head1 Lists


Re: Extending Parrot NCI callback functionality

2008-01-17 Thread Geoffrey Broadwell
On Wed, 2008-01-16 at 22:38 -0700, Paul Seamons wrote:
> > I am starting to implement a GLUT and OpenGL binding for Parrot.
> 
> I started down this path several months ago.  The following is the thread on 
> the topic.
> 
> http://tinyurl.com/3crzpu

OK, read it now.  I think I got a little farther, but I'm blocked now
just as you were, on the same problem.

> It appears that NCI is on the roadmap a couple of months out (or more), but 
> that when it is done it will be done right - for some definition of right.

I think that Allison hand-waved over exactly the case that you and I
tried to address first -- no JIT available, and want to create the shims
in portable C instead of hand-coded assembly per platform.

I'll try to take a look at the other PDDs she mentioned in a day or two,
but from what she wrote in your thread, I didn't get the feeling her
solution quite covered the same ground.

> I would've put more work into a temporary solution, but real life has 
> interfered.

Yes, and that's exactly my worry.  I don't often get concentrated time
to help out with Parrot and Perl 6, but I have some now.  If this is
going to be blocked indefinitely, my tuits are likely to evaporate.  And
dangit, I don't want to miss out on my window of opportunity!

> I'm glad to see other people interested in OpenGL on parrot.  When the NCI 
> PDD 
> is up for drafting, it will be good to have a listing of sample libraries and 
> required callback signatures available.

I had already made a list of all of the callback signatures needed by
GLUT, which I've included below.

> I'm excited about the progress Parrot is making.

Ditto that!  I'm hoping that when this blocking issue is dealt with,
I'll be able to create a fully functioning OpenGL binding, which is
actually for me a bit of yak shaving -- what I really *want* to do is
port some of my OpenGL code to Perl 6, but I need a working binding
first.  :-)


-'f

***

=head1 Needed Callback Signatures

XXX: Currently Parrot does not support the callback signatures needed
by GLUT to function properly (at all, really).  The following are the
missing signatures:

=over 4

=item 'v'

C, C, C,
C, C, C(*)

=item 'vi'

C, C, C,
C(*), C(*)

=item 'vii'

C, C, C,
C(!), C(!),
C(!), C(!)

=item 'vcii'

C, C

=item 'viii'

C, C, C,
C(!), C(!)

=item 'v'

C, C, C,
C(!)

=back


Special marks are as follows:

=over 4

=item (*)

Function is deprecated in OpenGLUT in favor of a more modern callback.

=item (!)

Function is unimplemented in freeglut and OpenGLUT (these all support
rarer input devices; in many cases, the input device in question is
SGI-specific and most likely no longer manufactured).

=back

=cut




Perl6::Doc - the next step

2008-01-17 Thread herbert breunung

hello dear list attendees

after taken step 1 (reactivate p6doc and update to current state) and 
step 2 (perl.com articles)[thanks to all authors]

, which is nearly finished (just fix some UTF problems) i have next plans.

there are some interesting docs in the parrot svn regarding perl6 that 
are written by pmichaud which i currently want to
include. shure it has to be separated cleanly from the design docs, but 
my question to you all is: how far should i go?
please keep in mind that also the current perldocs have some pages about 
perl internals, so why not include some

insights about, parrot, pct and pugs, v6?

cheers
herbert, pharao of the docs


Use of revision number in Perl6 and Parrot

2008-01-17 Thread ajr

Is there anyone familiar with the use (if any) of the revision number in
the Perl 6 and Parrot code?

It looks as though it might be possible to simplify some processes, but
I'm having trouble tracking down evidence. If there's a maven on the
topic, an explanation or some references, (maybe out-of-band, to keep down
the noise), would save me some time.




--

Email and shopping with the feelgood factor!
55% of income to good causes. http://www.ippimail.com



[perl #49898] [PATCH] .chars method for Str

2008-01-17 Thread Ævar Arnfjörð Bjarmason


binshuKZzIEr8.bin
Description: 
Index: src/classes/Str.pir
===
--- src/classes/Str.pir	(revision 24949)
+++ src/classes/Str.pir	(working copy)
@@ -21,6 +21,11 @@
 $P0('Perl6Str', 'Str')
 .end
 
+.sub 'chars' :method
+$S0 = self
+$I0 = length $S0
+.return ($I0)
+.end
 
 .sub 'ACCEPTS' :method
 .param string topic


[perl #49902] [PATCH][perl6] small glossary clarification

2008-01-17 Thread via RT
# New Ticket Created by  Zev Benjamin 
# Please include the string:  [perl #49902]
# in the subject line of all future correspondence about this issue. 
# http://rt.perl.org/rt3/Ticket/Display.html?id=49902 >


May as well mention what Rakudo is in the glossary entry.


Zev
Index: languages/perl6/docs/glossary.pod
===
--- languages/perl6/docs/glossary.pod	(revision 24953)
+++ languages/perl6/docs/glossary.pod	(working copy)
@@ -61,6 +61,7 @@
 
 An abbreviation of "Rakuda-do," which, when translated from Japanese,
 means "The Way of the Camel". In Japanese, "Rakudo" means "Paradise."
+Rakudo is the name of the Perl 6 implementation that runs on parrot.
 For more info, see L.
 
 =item STD.pm


[perl #49886] [PATCH] languages/perl6 requires `=begin' to have a corrisponding ident. Remove that requirement

2008-01-17 Thread Ævar Arnfjörð Bjarmason


bin2lTUAakyKC.bin
Description: 
Index: src/parser/grammar.pg
===
--- src/parser/grammar.pg   (revision 24905)
+++ src/parser/grammar.pg   (working copy)
@@ -111,8 +111,8 @@
 token pod_comment {
 ^^ '=' <.unsp>?
 [
-| begin <.ws>  .*? \n
-  '=' <.unsp>? 'end' <.ws> $ \N* {*} #= block
+| begin <.ws> [  ]? .*? \n
+  '=' <.unsp>? 'end' <.ws> [ $ ]? \N*{*} #= block
 | \N*   {*} #= misc
 ]
 {*}

use v6-alpha;

module Main {

say '1..1';

say "ok", " " ~ "1";

}

=begin

=head1 AUTHORS

The Pugs Team E[EMAIL PROTECTED].

=head1 SEE ALSO

The Perl 6 homepage at L.

The Pugs homepage at L.

=head1 COPYRIGHT

Copyright 2007 by Flavio Soibelmann Glock and others.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

See L

=end


[perl #49900] [PATCH] Two arg substr implementation

2008-01-17 Thread Ævar Arnfjörð Bjarmason


bindC5wtFvE7f.bin
Description: 
Index: t/01-sanity/07-substr.t
===
--- t/01-sanity/07-substr.t	(revision 24949)
+++ t/01-sanity/07-substr.t	(working copy)
@@ -1,9 +1,13 @@
 use v6-alpha;
 
 
-say "1..1";
+say "1..3";
 
 my $string = "Pugs -- Perl6 User's Golfing System";
 my $substr = substr $string, 8, 5;
 
 if $substr eq "Perl6" { say "ok 1" } else { say "not ok 1" }
+
+my $str = 'not ok ';
+say substr( $str, 4 ) ~ "2";
+say substr( $str, 4 ), "3";
Index: src/builtins/string.pir
===
--- src/builtins/string.pir	(revision 24949)
+++ src/builtins/string.pir	(working copy)
@@ -186,7 +186,16 @@
 .sub 'substr'
 .param string x
 .param int start
-.param int len
+.param int len :optional
+.param int has_len :opt_flag
+.local pmc s
+
+if has_len goto end
+s = new 'Perl6Str'
+s = x
+len = s.'chars'()
+
+  end:
 $S0 = substr x, start, len
 .return ($S0)
 .end


Re: [perl #49886] [PATCH] languages/perl6 requires `=begin' to have a corrisponding ident. Remove that requirement

2008-01-17 Thread Larry Wall
On Thu, Jan 17, 2008 at 12:34:23PM -0800, Ævar Arnfjörð Bjarmason via RT wrote:

: Index: src/parser/grammar.pg
: ===
: --- src/parser/grammar.pg (revision 24905)
: +++ src/parser/grammar.pg (working copy)
: @@ -111,8 +111,8 @@
:  token pod_comment {
:  ^^ '=' <.unsp>?
:  [
: -| begin <.ws>  .*? \n
: -  '=' <.unsp>? 'end' <.ws> $ \N* {*} #= block
: +| begin <.ws> [  ]? .*? \n
: +  '=' <.unsp>? 'end' <.ws> [ $ ]? \N*{*} #= block
:  | \N*   {*} #= misc
:  ]
:  {*}

That is problematic, since it allows

=begin foo
=end

(Well, problematic unless you believe in that sort of thing...)
Of course, both grammar.pg and STD.pm are just filling in for the
missing S26 implementation there, so it's a stopgap in any case.

Larry


[perl #49894] [PATCH] .true method for all objects

2008-01-17 Thread Ævar Arnfjörð Bjarmason


binwFiSNZdAhZ.bin
Description: 


Re: [svn:perl6-synopsis] r14491 - doc/trunk/design/syn

2008-01-17 Thread Patrick R. Michaud
On Thu, Jan 17, 2008 at 01:18:32PM -0800, [EMAIL PROTECTED] wrote:
> +=item *
> +
> +The definition of C<.true> for the most ancestral type (that is, the
> +C type) is equivalent to C<.defined>.  

Would we normally consider prefix: to be defined in terms of
C<.true>, or vice versa?  Is there a prefix:, or is C
treated like an 'is export' trait on '.true' method?

Is there also a C<.not> method?

Pm



Re: [perl #49886] [PATCH] languages/perl6 requires `=begin' to have a corrisponding ident. Remove that requirement

2008-01-17 Thread Patrick R. Michaud
On Thu, Jan 17, 2008 at 05:36:43PM -0800, Larry Wall wrote:
> On Thu, Jan 17, 2008 at 12:34:23PM -0800, Ævar Arnfjörð Bjarmason via RT 
> wrote:
> 
> : Index: src/parser/grammar.pg
> : ===
> : --- src/parser/grammar.pg   (revision 24905)
> : +++ src/parser/grammar.pg   (working copy)
> : @@ -111,8 +111,8 @@
> :  token pod_comment {
> :  ^^ '=' <.unsp>?
> :  [
> : -| begin <.ws>  .*? \n
> : -  '=' <.unsp>? 'end' <.ws> $ \N* {*} #= block
> : +| begin <.ws> [  ]? .*? \n
> : +  '=' <.unsp>? 'end' <.ws> [ $ ]? \N*{*} #= block
> :  | \N*   {*} #= misc
> :  ]
> :  {*}
> 
> That is problematic, since it allows
> 
> =begin foo
> =end
> 
> (Well, problematic unless you believe in that sort of thing...)
> Of course, both grammar.pg and STD.pm are just filling in for the
> missing S26 implementation there, so it's a stopgap in any case.

Agreed.  Since neither S26 nor STD.pm currently allow =begin or
=end without an identifier, we won't implement it that way.  (Of
course, if the change is useful we could ask the perl6-language
gods to allow this.)

So, I'll close this ticket for now, and when/if the spec or STD.pm
changes we can do an update then.

Pm


[perl #49714] [PATCH] Extend perl6 spectest to fetch and execute S04-S29 tests

2008-01-17 Thread Jerry Gay via RT
applied as r24965.

it's causing a heck of a lot of failing tests. however, i'll leave them
in for a day or three, while we see what we can do to get them passing.

hint: getting 'fudge' working on rakudo would do us a world of good.
~jerry


[perl #49902] [PATCH][perl6] small glossary clarification

2008-01-17 Thread Jerry Gay via RT
applied with minor modifications as r24966.
~jerry


Re: [perl #49458] [PATCH] Fix compiler error & warning in nanoparrot example

2008-01-17 Thread chromatic
On Sunday 06 January 2008 22:40:50 Geoffrey Broadwell wrote:

> examples/c/nanoparrot.c can be compiled with any of three different
> runloops.  The default computed goto runloop compiles cleanly, but the
> switched and function runloops do not.  The attached patch gets rid of a
> compiler error when compiled for the switched runloop, and a warning
> when compiled for the function runloop.  All three runloops compile
> cleanly after the patch is applied on Debian/Linux/i386.

Thanks, applied as r24967.

-- c


Re: third PMC implementation task

2008-01-17 Thread chromatic
On Tuesday 08 January 2008 12:52:28 Allison Randal wrote:

> Would be a good PMC cleanup to get in place, if this code can be removed.

>  Original Message 
> Subject: Zombie code?
> Date: Wed, 2 Jan 2008 20:43:27 - (UTC)
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
>
>
> While trying to understand Parrot::Vtables.pm, I came across what seems
> to be some "zombie" code, possibly left after RT 48877.
>
> 1. Two references to src/pmc/null.pl, which does not appear to exist.

Removed in r24968.

> 2. The method "vtbl_embed", which is used only in
> parrot/tools/build/vtable_extend.pl That writes
> include/parrot/extend_vtable.h and src/extend_vtable.c, neither of which
> exist.

This is necessary; otherwise you can't call vtable entries on PMCs without 
knowing the internal details of PMCs.  Kept.

> 3. Some odd pod in the method around lines 368-372, which makes me think
> the expression that spans 367-379 would behave rather oddly if the method
> was ever used.

Fixed in r24968.

-- c