Re: r25102 - docs/Perl6/Spec

2009-01-31 Thread Nicholas Clark
On Fri, Jan 30, 2009 at 11:11:42AM -0600, Patrick R. Michaud wrote:
 On Fri, Jan 30, 2009 at 08:30:25AM -0800, Larry Wall wrote:
  So anyway, just because other languages call it a prelude doesn't
  mean that we have to.  Perl is the tail that's always trying to
  wag the dog...
  
  What is the sound of one tail wagging?
 
 For my dog Sally, the sound of one tail wagging is regularly
 used to indicate that she believes I'm in desperate need of taking
 her on a walk.

An ailment that she believes you suffer from frequently? At least several times
a day?

whack, whack, whack is the sound of Chili wagging her tail, if a wall
happens to get to close. The black alarm clock sometimes can go off before
6am, if she determines that it's already time for breakfast (or exercise).

Chili: http://chili.pavlovic.at/2007_09/medium/DSC00035_medium.html

Nicholas Clark


Normalization of metaops

2009-01-31 Thread Mark Lentczner
The concept of which metaops can apply to which other ops is looking  
pretty clear.


The goal, as I understand it from Larry, is that while in general,  
metaops should be allowed, we want to disallow them where they either  
make no sense, or are very unlikely to be what the programmer thought  
they were doing.


In addition, it seems to me that since metaops should be applicable to  
user created ops, the particular tests the parser performs must be  
well defined because users will be annotating their operators to get  
them to have the right metaop applicability.


I propose the following:


Rop infix -- infix
Xop infix -- infix
op  prefix -- prefix
op  postfix -- postfix
op  infix -- infix

- the inner op should be value like, that is things
  like == and .= and ^ff^ don't ever really make sense here
- these should test for :value

[op]infix -- prefix
op= infix -- infix

- the inner op needs to be associative, and needs to produce a value
  of similar type to its arguments
- these should test for :iso
- [op] has an explicit provision for chained operators
- so [op] should support :assoc(chain) if the op is :value

!op infix -- infix

- the inner op must return a value that makes sense when used in a
  boolean context, and hence when negated
- this should test for :bool

The current levels would then have:

%methodcall
%autoincrement   :value
%exponentiation  :value :iso
%symbolic_unary  :value
%multiplicative  :value :iso
%additive:value :iso
%replication :value :iso
%concatenation   :value :iso
%junctive_and:value :iso
%junctive_or :value :iso
%named_unary :value
%nonchaining :value
%chaining:value :bool
%tight_and   :value :iso
%tight_or:value :iso
%conditional
%item_assignment
%loose_unary :value
%comma
%list_infix  :value :iso
%list_assignment
%list_prefix
%loose_and   :value :iso
%loose_or:value :iso
%sequencer

Two exceptions to these lists:
sym, gets :value and :iso
sym% gets :bool as well

I'm not so happy with these names, :boolish? :simple? I just don't  
know...


This does explicitly remove a few classes of operator from being used  
in hyper, reverse and cross: Such things as the sequencer ops,  
assignment, and method call.  Testing with the current form of STD.pm  
(r25127), not all of those things parse anyway.


I almost have a patch against STD.pm ready to go that implements this  
and passes teststd...  What do you think? Post it here? Check it in?   
This is a goofy idea, drop it?


- MtnViewMark





r25138 - docs/Perl6/Spec

2009-01-31 Thread pugs-commits
Author: particle
Date: 2009-02-01 01:26:46 +0100 (Sun, 01 Feb 2009)
New Revision: 25138

Modified:
   docs/Perl6/Spec/S06-routines.pod
   docs/Perl6/Spec/S19-commandline.pod
Log:
[spec] spelling, grammar, and other clarifications; TimToady++

Modified: docs/Perl6/Spec/S06-routines.pod
===
--- docs/Perl6/Spec/S06-routines.pod2009-01-31 21:53:33 UTC (rev 25137)
+++ docs/Perl6/Spec/S06-routines.pod2009-02-01 00:26:46 UTC (rev 25138)
@@ -2742,8 +2742,8 @@
 -n :name
 -n=value   :namevalue
 -nvalue:namevalue # only if not declared Bool
--n=spacy value   :name«'spacy value'»
--n='spacy value'   :name«'spacy value'»
+-n=spacey value  :name«'spacey value'»
+-n='spacey value'  :name«'spacey value'»
 -n=val1,'val 2',etc:name«val1 'val 2' etc»
 
 # Long names
@@ -2751,10 +2751,10 @@
 --name=value   :namevalue # don't care
 --name value   :namevalue # only if not declared Bool
 
---name=spacy value   :name«'spacy value'»
---name spacy value   :name«'spacy value'»
---name='spacy value'   :name«'spacy value'»
---name 'spacy value'   :name«'spacy value'»
+--name=spacey value  :name«'spacey value'»
+--name spacey value  :name«'spacey value'»
+--name='spacey value'  :name«'spacey value'»
+--name 'spacey value'  :name«'spacey value'»
 --name=val1,'val 2',etc:name«val1 'val 2' etc»
 --name val1 'val 2' etc:name«val1 'val 2' etc» # only if declared @
 --  # end named argument processing
@@ -2762,16 +2762,16 @@
 # Negation
 --/name:!name
 --/name=value  :namevalue but False
---/name=spacy value  :name«'spacy value'» but False
---/name='spacy value'  :name«'spacy value'» but False
+--/name=spacey value :name«'spacey value'» but False
+--/name='spacey value' :name«'spacey value'» but False
 --/name=val1,'val 2',etc   :name«val1 'val 2' etc» but False
 
 # Native
 :name  :name
 :/name :!name
 :name=value:namevalue
-:name=spacy value:name«'spacy value'»
-:name='spacy value':name«'spacy value'»
+:name=spacey value   :name«'spacey value'»
+:name='spacey value'   :name«'spacey value'»
 :name=val1,'val 2',etc :name«val1 'val 2' etc»
 
 Exact Perl 6 forms are okay if quoted from shell processing:

Modified: docs/Perl6/Spec/S19-commandline.pod
===
--- docs/Perl6/Spec/S19-commandline.pod 2009-01-31 21:53:33 UTC (rev 25137)
+++ docs/Perl6/Spec/S19-commandline.pod 2009-02-01 00:26:46 UTC (rev 25138)
@@ -37,7 +37,7 @@
 
 =item *
 
-Common options have a short, single-letter name, and allow clustering
+Common options have a short, single-character name, and allow clustering
 
 =item *
 
@@ -101,11 +101,11 @@
 
 =item *
 
-The most common options have a single-letter short name
+The most common options have a single-character short name
 
 =item *
 
-Single-letter options may be clustered with the same syntax and semantics
+Single-character options may be clustered with the same syntax and semantics
 
 =item *
 
@@ -239,14 +239,8 @@
 
 =item *
 
-Options must begin with one of the following symbols: C  -- - :  .
+Options must begin with one of the following symbols: C--, C-, or C:.
 
-=for consideration
-[That you are using  ...  P6 syntax as meta notation is not clear.
-Reads as if  and  are also allowed.  Suggest
-'C--', 'C-', or 'C:'
-instead.  --law]
-
 =item *
 
 Options are case sensitive. C-o and C-O are not the same option.
@@ -263,24 +257,20 @@
 
 =item *
 
-Single-letter options may be clustered. C-ab means C-a -b. When a
-single-letter option which requires a value is clustered, the option may
+Single-character options may be clustered. C-ab means C-a -b. When a
+single-character option which requires a value is clustered, the option may
 appear only in the final position of the cluster.
 
 =item *
 
 Options may be negated with C/, for example C--/name, C:/name, C-/n.
-Each single-letter option in a cluster must be negated separately
-(e.g. C-a/n/o is the same as C-a -/n -/o.)
+Negated single-character options cannot appear in a cluster.  In practice,
+negated options are rare anyway, as most boolean options default to False.
 
-=for consideration
-[I'd just outlaw clustering of negatives as too confusing visually.
-Most options are (or should be) born false anyway, so the need is minimal. 
--law]
-
 =item *
 
 Option names follow Perl 6 identifier naming convention, except C' is not
-allowed, and single-letter options may be any letter or number.
+allowed, and single-character options may be any 

Re: Normalization of metaops

2009-01-31 Thread Larry Wall
On Sat, Jan 31, 2009 at 01:21:57PM -0800, Mark Lentczner wrote:
 Two exceptions to these lists:
   sym, gets :value and :iso
   sym% gets :bool as well

Also note that = is :value :iso despite being lumped with assignment.
I consider = to be equivalent to . in Lisp, so [=] is essentially
just an S-expr in disguise.

 I'm not so happy with these names, :boolish? :simple? I just don't  
 know...

I think :iso is fine, unless someone wants to weigh in with something
from group theory.

As for :bool, that is a bit more problematic if it can be construed as
a strict type check.  We want to express the concept of something that
can be used as a boolean.  :truthy maybe?  :iffy?

 This does explicitly remove a few classes of operator from being used in 
 hyper, reverse and cross: Such things as the sequencer ops, assignment, 
 and method call.  Testing with the current form of STD.pm (r25127), not 
 all of those things parse anyway.

As long as we can make explicit exceptions, that seems okay.  And we
will have exceptions as long as we lump disimilar operators together
in the same precedence level like item assignment and =.

Seems like unaries should also be labeled :iso if they return the same
type, even though we don't have a use for it yet.

 I almost have a patch against STD.pm ready to go that implements this  
 and passes teststd...  What do you think? Post it here? Check it in?   
 This is a goofy idea, drop it?

Seems fine, and I think I like the simplicity; go ahead and check it
in unless someone can spot a difficulty.  We can always fix anything
that goes haywire, or split one of the categories again if necessary.

Larry