Re: how typish are roles

2006-10-30 Thread TSa

HaloO,

Jonathan Lang wrote:

Larry Wall wrote:

But I'm still somewhat set against the notion of using logical ops to
do set theory.  (Even if you put parens around them.)


Understandably so.  Perhaps (u) and (n) would be better ASCII
equivalents for the union and intersection operators...


Hmm, I think using the dualism between set operations and
boolean operations is a good thing. Note that there is an
isomorphism between , || and ! for the logical side and
(), (|) and (!) for sets---DeMorgan etc. We could even
introduce low precedence versions (and), (or) and (not).
Well, and of course (^) and (xor) corresponding to ^^ and
xor. They all form nice mnemonics for each other.


Regards, TSa.
--


Re: where constraints as roles (was Re: how typish are roles)

2006-10-30 Thread TSa

HaloO,

Jonathan Lang wrote:

At its core, a type is nothing more than a constraint on the objects
that a given variable is allowed to handle; this would put Cwhere
clauses at the center of the type system, with roles coming in a very
close second due to the implicit use of .does() in the compact
syntax.


Great idea! I like the unification of everything typish under the
umbrella of (type) constraints. These predicates then need to be
amenable to subsumption and entailment forming the dispatch lattice.
Of course the sublanguage for where clauses has to be a restricted
subset of full Perl 6. Otherwise you can't do machine proofs. This
view is shared by mmd-draft.txt, it states that conceptually all
dispatch relevant informations are predicates.

Hmm, having regular expressions in where clauses already raises
the question if one can treat them programatically. E.g. a
'where /^aa.*bb$/' is strictly more specific than 'where /^a.*b$/'.
But can that be calculated in a deterministic fashion? Would
dispatch at least work on a case by case basis? Or would we get
ambiguity errors because of principal incomparability of the two
clauses? IOW, I fear this could only be put to work with two subset
declarations

  subset ab of Str where /^a.*b$/;
  subset aabb of ab where /^aa.*bb$/;

and the notion that the second subset by virtue of constraining
the possible values further produces a more specific subtype for
dispatch. That is nominal subtyping.

BTW, the above example is a good case for introducing the subtype
relation operator : because we have aabb : ab : Str but do we
also have aabb.does(ab) and ab.does(Str)? Could we also state that
aabb () ab () Str?


Regards, TSa.
--


Re: where constraints as roles (was Re: how typish are roles)

2006-10-30 Thread Jonathan Lang

TSa wrote:

IOW, I fear this could only be put to work with two subset
declarations

   subset ab of Str where /^a.*b$/;
   subset aabb of ab where /^aa.*bb$/;

and the notion that the second subset by virtue of constraining
the possible values further produces a more specific subtype for
dispatch. That is nominal subtyping.


Perl 6 already uses nominal subtyping: S02 - Types are officially
compared using name equivalence rather than structural equivalence.
There's further elaboration which addresses many of the concerns
involved with using nominal subtyping, so I'd suggest reading the
section in question before commenting.


BTW, the above example is a good case for introducing the subtype
relation operator : because we have aabb : ab : Str but do we
also have aabb.does(ab) and ab.does(Str)? Could we also state that
aabb () ab () Str?


Regards, TSa.
--




--
Jonathan Dataweaver Lang


beginner's question

2006-10-30 Thread Richard Liu
Hi,
   
  G'day!
   
  I am new to the Perl language. As a university student, I want to use perl to 
build some codes to work as tracing and automatic analysing tool with my data 
file in Linux environment. Could you kindly teach me which IDE tools should I 
use (freeware and shareware better :-) ) and  what kind of debugger tools 
should I go through.
   
  Any comments are truly appreciated. Thanks in advance!
   
  Richard


-
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail.

Re: beginner's question

2006-10-30 Thread Jonathan Scott Duff
On Mon, Oct 30, 2006 at 08:09:56AM -0800, Richard Liu wrote:
   I am new to the Perl language. As a university student, I want to
   use perl to build some codes to work as tracing and automatic
   analysing tool with my data file in Linux environment. Could you
   kindly teach me which IDE tools should I use (freeware and shareware
   better :-) ) and what kind of debugger tools should I go through.

   Any comments are truly appreciated. Thanks in advance!

Hi Richard!  This mailing list is for discussion and development of
the Perl6 language.  Since this language is still being designed, you
probably want to know about Perl5 resources.  A good place to start
would be http://learn.perl.org/.  Also, you might want to try on IRC.
There's #perl on the freenode network and #perlhelp on efnet.

hope this helps,

-Scott
--
Jonathan Scott Duff [EMAIL PROTECTED]


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

2006-10-30 Thread larry
Author: larry
Date: Mon Oct 30 12:18:19 2006
New Revision: 13350

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

Log:
1st whack at applying dwimmy hypers to hashes.


Modified: doc/trunk/design/syn/S03.pod
==
--- doc/trunk/design/syn/S03.pod(original)
+++ doc/trunk/design/syn/S03.podMon Oct 30 12:18:19 2006
@@ -12,9 +12,9 @@
 
   Maintainer: Larry Wall [EMAIL PROTECTED]
   Date: 8 Mar 2004
-  Last Modified: 16 Oct 2006
+  Last Modified: 30 Oct 2006
   Number: 3
-  Version: 72
+  Version: 73
 
 =head1 Changes to Perl 5 operators
 
@@ -877,6 +877,34 @@
 Beyond all that, array of scalar types are known at compile time not to
 need recursive hypers, so the operations can be vectorized aggressively.
 
+Hypers may be applied to hashes as well as to lists.  In this case
+dwimminess says whether to ignore keys that do not exist
+in the other hash, while non-dwimminess says to use all keys that are
+in either hash.  That is,
+
+%foo «+» %bar;
+
+gives you the intersection of the keys, while
+
+%foo »+« %bar;
+
+gives you the union of the keys.  Asymmetrical hypers are also useful;
+for instance, if you say:
+
+%outer »+» %inner;
+
+only the %inner keys that already exist in %outer will occur in the result.
+Note, however, that you want
+
+%outer »+=« %inner;
+
+in order to pass accumulated statistics up a tree, assuming you want %outer
+to have the union of keys.
+
+Unary hash hypers and binary hypers that have only one hash operand
+will apply the hyper operator to just the values but return a new
+hash value with the same set of keys as the original hash.
+
 =head2 Reduction operators
 
 The fourth metaoperator in Perl 6 is the reduction operator.  Any


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

2006-10-30 Thread Larry Wall
Arguably I've got the dwimminess backwards on this.  It seems like

%outer «+=» %inner

ought to dwim that I want the union of keys.  In that view the standard
non-dwimmy behavior is to ignore keys that are not in the other hash,
and dwimmery consists of using keys even if they aren't in the other hash.
On the other hand, it seems odd that the big end of a hyper would imply
fewer keys.  Obviously it doesn't make much difference whether we write

%foo «+=» 1

or 

%foo »+=» 1

since the key set has to be considered fixed in any event.

Well, as usual, I can argue it both ways, and will doubtless flipflop
on the issue a couple of times yet... :)

Larry