There's been rumblings on this list lately about making Perl perform more
Logic based programming functions, a la Prolog. Having done some work
with Prolog in academia, I fully understand why this is desirable.
It occurs to me that underlying functionality of Prolog is moderately
similar to the P6R
Luke Palmer <[EMAIL PROTECTED]> wrote:
> I think we should replace our multimethod system with a more general
> pattern matcher, a "variadic multimethod" system of sorts. Multimethods
> need to be variadic anyway, because we want pugs's quicksort example to
> work.
I'd not say replace. The dispa
Matt Diephouse <[EMAIL PROTECTED]> wrote:
> Here's a first pass at that. I've changed it to:
>- make use of the shortcuts for calling subroutines
>- use ".sub"
>- use ".local"
Thanks, applied.
leo
Leopold Toetsch writes:
> Luke Palmer <[EMAIL PROTECTED]> wrote:
>
> > I think we should replace our multimethod system with a more general
> > pattern matcher, a "variadic multimethod" system of sorts. Multimethods
> > need to be variadic anyway, because we want pugs's quicksort example to
> > w
Luke Palmer wrote:
But we always have enough knowledge to optimize the hell out of this,
and they're not not handwavy "we can probably" optimizations. They're
real, and they're pretty darn easy.
I fully agree. But I like to add that a single 'where' on general
types like Int, Str or even Any can s
Rod Adams writes:
> Indeed, a great deal of logical testing can be performed with the
> current P6RE definition.
>
> For instance:
>
>rule Equal ($x, $y) {{ $x ~~ $y or fail }};
>rule Substr (Str $str, Str $in) {{ $in ~~ /<$str>/ or fail }};
>rule IsAbsValue (Num $x, Num $y) {
>
Thomas Sandlaà writes:
> Luke Palmer wrote:
> >But we always have enough knowledge to optimize the hell out of this,
> >and they're not not handwavy "we can probably" optimizations. They're
> >real, and they're pretty darn easy.
>
> I fully agree. But I like to add that a single 'where' on genera
Darren Duncan <[EMAIL PROTECTED]> wrote:
> A question: Would "has PkgNameArray @.tmpl_set_nms;" do what I
> expect, where the array as a whole is the sub-type, or would it make
> an array where each element is the sub-type?
I think this declares an array of PkgNameArrays, but "has
@.tmpl_set_nms i
HaloO Luke,
you wrote:
[..] The *method* is the one that knows everything,
not the object. So definitions on subtypes of general types only check
for those subtypes when dispatching to the methods defined in them.
I stand corrected. Lax usage of Any is fair. Defining subtypes
of general types and
I was trying to implement unary * (list flatten or "splat" operator) in
pugs yesterday, and I came to the conclusion that I really don't grok
how context works in Perl6 (I also really don't grok Haskell, but this
is another story...).
if I understand correctly, all these are equivalents:
my @
Aldo Calpini skribis 2005-03-09 12:12 (+0100):
> my @a = 1,2,3;
> my $a = 1,2,3;
These are
(my @a = 1), 2, 3;
(my $a = 1), 2, 3;
if I understand precedence correctly. (S03)
> my $a = [EMAIL PROTECTED];
> my $a = *(1,2,3); # or is this a syntax error?
> my $a = *(list 1,2,3);
>
Rod Adams wrote:
It seems to me that there are several advantages to making a group of
multi with the same short name a single object, of type
MultiSub|MultiMethod, which internally holds references to the all the
various routines that share that short name.
It doesn't have to be junctive becaus
Hi,
I am getting following error when I try to convert my gcov output files
to Devel::Cover output format.
[EMAIL PROTECTED] src]$ cover
Reading database from /home/manishs/tcpflow-0.21/src/cover_db
Argument "\x{2f}\x{30}..." isn't numeric in addition (+) at
/usr/lib/perl5/site_perl/5.8.0/i386-lin
Luke Palmer wrote:
Rod Adams writes:
Or you could avoid the global modifier and write your tests in <( )>
blocks instead... after all, that's what it's there for.
I *knew* I had seen a syntax for that before... I just didn't see it
when I scanned S05 for it.
I still want the :z modifier for
Thomas Sandlaß wrote:
Rod Adams wrote:
It seems to me that there are several advantages to making a group of
multi with the same short name a single object, of type
MultiSub|MultiMethod, which internally holds references to the all
the various routines that share that short name.
It doesn't hav
On Wed, Mar 09, 2005 at 05:16:31PM +0530, Manish Sapariya wrote:
> Hi,
> I am getting following error when I try to convert my gcov output files
> to Devel::Cover output format.
>
> [EMAIL PROTECTED] src]$ cover
> Reading database from /home/manishs/tcpflow-0.21/src/cover_db
> Argument "\x{2f}\x{
Indeed curious. The first version was the gzip file, but utf8 encoded.
Double weird that it would only happen once. Did you do it the same way
both times, Jarkko?
On Mon, Mar 07, 2005 at 08:40:19AM -0800, Larry Wall wrote:
> Here are some alternatives you don't seem to have considered:
[...]
> my Str sub greeting (Str $person) is export {
> "Hello, $person";
> }
>
> my Str
> sub greeting (Str $person) is export {
> "Hello,
Juerd wrote:
my @a = 1,2,3;
my $a = 1,2,3;
These are
(my @a = 1), 2, 3;
(my $a = 1), 2, 3;
if I understand precedence correctly. (S03)
right, sure. I vaguely remember something about comma instead of parens
being the list constructor, but maybe it was just in my fantasy.
and thanks for
My apologies.
The error is at line 390.
[EMAIL PROTECTED] src]$ cover
Reading database from /home/manishs/CodeCoverage/tcpflow-0.21/src/cover_db
Argument "\x{2f}\x{30}..." isn't numeric in addition (+) at
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Devel/Cover/DB.pm
line 390.
I was tr
1) ICU should be optional
If configured --without-icu the Makefile shouldn't contain ICU stuff,
and function calls to ICU (mainly in string_primitives) should be
wrapped inside #if PARROT_HAS_ICU.
2) complete src/encoding.c
encoding registering, lookup, deinit, and opcodes can follow the scheme
On Tue, Mar 08, 2005 at 10:29:30PM -0800, Darren Duncan wrote:
> [...]
>
> By using subtypes in this way, I could remove a lot of explicit input
> checking code from my methods, which is great. Also, the "where
> clause" is not being repeated for every argument or attribute or
> variable decla
Aldo Calpini writes:
> my @a = [1,2,3]; # or does it make @a[0] = (1,2,3)?
Yes, @a[0] = [1,2,3];
> and I have absolutely no clue about the following:
>
> my *$a = @a;
> my *$a = [EMAIL PROTECTED];
> my *$a = (1,2,3);
> my *$a = [1,2,3];
Those are all illegal. You need to use binding
Rod Adams writes:
> >
> >You could do all of this with a library of rules.
> >
> > / $:= )> /
> >
> >
> I don't think this does what I want. In this, &generate returns a rule
> or string of some kind, matches the string being tested, captures what
> matches, and then binds the capture to $.
Rod Adams writes:
> I wasn't intending it to be junctive. I was just noting that you needed
> separate holders for subs and methods, since you shouldn't be able to
> stuff a method into a multi sub.
Keep in mind that the two following definitions are equivalent:
class A { method foo () {...
The test file t/pmc/pmc.t is full of Perl* tests. These should be
factored out into t/pmc/perl*.t.
The file itself should contain just common PMC functionality tests, like
the range or type checks.
Thanks,
leo
Hi all,
reading [AS]02 left me a bit unclear on list construction. Specifically,
as comma still seems to be the list constructor, what do these produce:
my $a = (1, 2); # a List object of 1, 2?
my $a = (1); # Int 1?
my $a = (1,); # List of 1?
my ($a)
On Tue, Mar 08, 2005 at 10:29:30PM -0800, Darren Duncan wrote:
: The biggest change is that, upon a re-reading Synopsis 12 (and 9)
: that was inspired by your above comment, I created some subtypes
: which I now use everywhere; the declarations and some examples of use
: are:
:
: subtype KeyN
On Wed, Mar 09, 2005 at 02:15:56PM +0200, wolverian wrote:
: On Mon, Mar 07, 2005 at 08:40:19AM -0800, Larry Wall wrote:
: > Here are some alternatives you don't seem to have considered:
:
: [...]
:
: > my Str sub greeting (Str $person) is export {
: > "Hello, $person";
: > }
: >
On Wed, Mar 09, 2005 at 09:13:27AM -0800, Larry Wall wrote:
: sub foo ( Int $bar where { $_ == 0 } ){ ... }
Well, I'm not sure about that syntax. It might have to be either
sub foo ( Int where { $_ == 0 } $bar ){ ... }
or
sub foo ( $bar of Int where { $_ == 0 } $bar ){
Luke Palmer wrote:
Keep in mind that the two following definitions are equivalent:
class A { method foo () {...} }
multi sub foo (A $a) {...}
Except for attribute access, I think.
For public attrs the accessor is not used and private ones are available:
class A
{
has $.pub = "pub";
ha
On Wed, Mar 09, 2005 at 05:56:25PM +0200, wolverian wrote:
: Hi all,
:
: reading [AS]02 left me a bit unclear on list construction. Specifically,
: as comma still seems to be the list constructor, what do these produce:
:
: my $a = (1, 2); # a List object of 1, 2?
Same as
my $a
Larry Wall wrote:
and it seems to me that you could simplify all that to just
subtype KeyName of Str where { m/^\w+$/ }
If that succeeds, you know it's defined and non-null.
My view is that typing strings by means of patterns should always
exhaust the string as the above pattern does. I can ima
On Tue, Mar 08, 2005 at 05:49:54PM -0800, chromatic wrote:
: On Tue, 2005-03-08 at 17:39 -0800, Larry Wall wrote:
:
: > On Tue, Mar 08, 2005 at 03:23:14PM -0800, chromatic wrote:
:
: > : I could make the argument that it should be possible to decorate an
: > : object with a role. If that means g
On Wed, Mar 09, 2005 at 06:51:43PM +0100, Thomas Sandlaß wrote:
: Larry Wall wrote:
: >and it seems to me that you could simplify all that to just
: >
: >subtype KeyName of Str where { m/^\w+$/ }
: >
: >If that succeeds, you know it's defined and non-null.
:
: My view is that typing strings by
On Wed, Mar 09, 2005 at 12:22:37PM +0100, Juerd wrote:
: > my $a = [EMAIL PROTECTED];
: > my $a = *(1,2,3); # or is this a syntax error?
: > my $a = *(list 1,2,3);
: > my $a = *[1,2,3];
:
: I hope this will emit some kind of too-many-arguments warning in
: addition to assigning 1 to $a.
N
On Wed, Mar 09, 2005 at 06:19:25AM -0600, Rod Adams wrote:
: I was thinking more along the lines of :
:
:use MMD::Pattern;
:
:our &func is MMD::Pattern;
:
:multi func (...) {...}
:multi func (... ...) {...}
:multi func (... ... ...) {...}
:
:multi func2 (...) {...}
:
On Wed, Mar 09, 2005 at 08:56:22AM -0700, Luke Palmer wrote:
: I was decently insane last night. This generator stuff probably isn't
: going anywhere. It's too abstract, and not precise enough, to be a
: truly powerful part of the language.
I suspect it's another one of the many things we just t
# New Ticket Created by Bernhard Schmalhofer
# Please include the string: [perl #34391]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org/rt3/Ticket/Display.html?id=34391 >
Hi,
the example 'thr-primes.imc' should not use the PerlUndef PMC, as the Perl
At 10:03 AM -0800 3/9/05, Larry Wall wrote:
On Wed, Mar 09, 2005 at 06:51:43PM +0100, Thomas Sandlaß wrote:
: Larry Wall wrote:
: >and it seems to me that you could simplify all that to just
: >
: >subtype KeyName of Str where { m/^\w+$/ }
: >
: >If that succeeds, you know it's defined and non-
Larry Wall wrote:
On Wed, Mar 09, 2005 at 06:19:25AM -0600, Rod Adams wrote:
: I was thinking more along the lines of :
:
:use MMD::Pattern;
:
:our &func is MMD::Pattern;
:
:multi func (...) {...}
:multi func (... ...) {...}
:multi func (... ... ...) {...}
:
:multi func2
Larry Wall wrote:
I suspect it's another one of the many things we just try to
stay within hailing distance of without trying to solve for 6.0.0.
That's cool.
I was just relaying the observation that the P6RE was fairly close to
being able to implement Logical Programming, which several people
--- Rod Adams <[EMAIL PROTECTED]> wrote:
> I was just relaying the observation that the P6RE was fairly close to
> being able to implement Logical Programming, which several people
> seem to be trying to get into Perl in some fashion or another.
When I get a chance to talk to someone about logic p
Darren Duncan wrote:
I didn't say that per se. I said "non-core". As far as I know, Test.pm
is a core module.
Indeed, hooray!
So when can we expect a port of Rosetta? ;-)
Sam.
Ovid wrote:
--- Rod Adams <[EMAIL PROTECTED]> wrote:
I was just relaying the observation that the P6RE was fairly close to
being able to implement Logical Programming, which several people
seem to be trying to get into Perl in some fashion or another.
When I get a chance to talk to someone
At 11:31 AM +1300 3/10/05, Sam Vilain wrote:
Indeed, hooray!
So when can we expect a port of Rosetta? ;-)
Sam.
In somewhere between 2 weeks and 2 months.
I still have to make some significant changes to the Perl 5 version
and get feedback on that, prior to translating it.
However, its main depen
--- Rod Adams <[EMAIL PROTECTED]> wrote:
> But come to think of it, it almost definitely makes more sense to
> port Prolog or some other LP engine to Parrot, and then intermingle
the
> languages at that level. I don't think very many of us have fully
> grasped what Parrot can do for Perl yet.
I'
At 9:08 AM -0800 3/9/05, Larry Wall wrote:
My other quibble is that you seem to be prone to stating things in the
negative for at least two of your three tests here:
subtype KeyName of Str where { $_.defined and $_ ne '' and $_ !~ m/\W/ }
and it seems to me that you could simplify all that to j
On Tue, Mar 08, 2005 at 10:30:36PM -0500, Randy W. Sims wrote:
> What about the "resource aquisition is initialization" approach?
Oh ick no. Means on every subroutine entry you have to call a magic,
mysterious TB method.
> package TB;
> sub new { bless { level => \my $level }, shift }
> sub obt
On Tue, Mar 08, 2005 at 10:11:09PM -0500, Michael Graham wrote:
> Well, all I was going to do was try to shave a few seconds off the
> running time of my test suite (which is now climbing up to the 10 minute
> mark). I figured I could do the mod_perl thing: preload all my modules
> and do most of
Autrijus,
While I like the current Pugs banner, it's basically a variation of the
Hugs banner. So I put my years of art school training to work, and some
help from FIGlet I created a new banner.
__
/ \ __ \
\ \ \/\ \ __ __ __ __ (P)erl6
\ \ __/ \ \/\ \/\ __ \/\ __
See also http://use.perl.org/~LTjake/journal/23570 =)
-scott
On 0, Stevan Little <[EMAIL PROTECTED]> wrote:
> Autrijus,
>
> While I like the current Pugs banner, it's basically a variation of the
> Hugs banner. So I put my years of art school training to work, and some
> help from FIGlet I cr
On Wed, Mar 09, 2005 at 09:39:35PM -0500, Stevan Little wrote:
> While I like the current Pugs banner, it's basically a variation of the
> Hugs banner. So I put my years of art school training to work, and some
> help from FIGlet I created a new banner.
Thanks, committed as r567 with a little tw
Robert wrote:
>>Indeed curious. The first version was the gzip file, but utf8 encoded.
>
>
> Double weird that it would only happen once. Did you do it the same way
> both times, Jarkko?
>
Yup. Mac OS X, Thunderbird, Attach file, the same file.
--
Jarkko Hietaniemi <[EMAIL PROTECTED]> http
Steven Schubiger wrote:
I'll try, although I've never worked on the core before, but I have
a broad knowledge concerning perl guts and implementation.
WRT both mails: select one task that is familar to you, having some
knowledge of Parrot core is really helpful, then look into the
referenced file
What is the current status of the development of the Parrot and the Perl
6 compiler written in Perl? I hope that producing a Perl 6 compiler
written in Perl 6 and the Parrot VM is still a high priority and is
being actively developed as the premier compiler and VM for the Perl 6
language. A Per
A status report ...
I have now ported and committed the whole Locale::KeyedText test
suite to Perl 6, and made a bunch of improvements to the Perl 6
version of that module itself.
As of now, I see nothing further that needs doing with this module in
the short term, except for inevitable small f
57 matches
Mail list logo