Re: Bag / Set ideas - making them substitutable for Arrays makes them more useful

2010-11-13 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/7/10 23:19 , Jon Lang wrote:
 1 -- 2 -- 3
 
 Would be a Bag containing three elements: 1, 2, and 3.
 
 Personally, I wouldn't put a high priority on this; for my purposes,
 
Bag(1, 2, 3)
 
 works just fine.

Hm. Bag as [! 1, 2, 3 !] and Set as {! 1, 2, 3 !}, with the outer bracket by
analogy with arrays or hashes respectively and the ! having the mnemonic of
looking like handles?  (I have to imagine there are plenty of Unicode
brackets to match.)

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzfCfcACgkQIn7hlCsL25W5DACgzX15js/a8QRcE64QIvAax0kc
b1AAn0G+eXfNN9+spB7vvybnAnbn1nFI
=EZJL
-END PGP SIGNATURE-


Re: Tweaking junctions

2010-10-23 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/22/10 13:00 , Dave Whipp wrote:
 Damian Conway wrote:
 I've been thinking about junctions, and I believe we may need a small
 tweak to (at least) the jargon in one part of the specification.
 
 When this issue has been raised in the past, the response has been that
 junctions are not really intended to be useful outside of the narrow purpose
 for which they were introduced.

It occurs to me:  If their purpose is that narrow, why are they wasting
conceptual space in the core language?

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzC5gsACgkQIn7hlCsL25Wp8ACbBzcg2kACC/hmtTD1GUGe2lD2
2ucAmgNSPb5F6T3SqqHMvvG7UzFR9M3D
=1x5F
-END PGP SIGNATURE-


Re: Ruby Fibers

2010-10-16 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/15/10 10:22 , B. Estrade wrote:
 Pardon my ignorance, but are continuations the same thing as 
 co-routines, or is it more primitive than that? Also, doesn't this
 really just allow context switching outside of the knowledge of a
 kernel thread, thus allowing one to implement tasks at the user level?

Continuations are lower level; coroutines are one of many things you can
implement with them.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky5xRIACgkQIn7hlCsL25VNgQCgoaK28S7W2C6mMBrU9kpdmBUM
8UMAmQGaT/46BzW2nNXOsX/nf546QgoE
=0ee6
-END PGP SIGNATURE-


Re: [perl6/specs] 58fe2d: [S12] spec setting and getting values of attribute...

2010-09-30 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 9/30/10 16:46 , Moritz Lenz wrote:
 1) please don't abuse MONKEY_TYPING for anything that might look like
 dangerous

If Perl 6 is still Perl then in some sense it implies that dangerous is
accepted practice.  :)  That said...

 2) I find .perl very, very valuable in real world debugging; I don't
 want to make it its usage any harder.

I'd suggest slightly different behavior for .perl:  output everything but
with a ... so people have to do (a little) work to abuse it.  Otherwise,
though, I think I go in the direction of if this is indeed Perl then
`private' just means `do a little more work to get at it'.  At most,
perhaps .perl would dump only public state unless some debug option were set.

As for serializeability, I think .perl is being used for two different
things and we need to separate them.  If it's there for debugging, you want
private data in some recognizeable form and you want placeholders for things
like filehandles; if for serialization, then private state can only be
exported as the class itself desires (probably as method calls to initialize
it), requiring a class to provide such serialization routine, and things
like filehandles get skipped if the class doesn't provide a serialization
for them (which it usually wouldn't).

(IIRC the point of calling it perl was that it was to provide a Perl
expression which would evaluate to the object, hence serialization.  So
maybe we need .debug or .dump that follows different rules?)

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkylZDgACgkQIn7hlCsL25VuWQCgyt1JQFqDbCMSlETTRXPuBOgi
teIAoNea/SlGildEnAuPztkAnhwL/Xzt
=mywt
-END PGP SIGNATURE-


Re: [perl6/specs] 58fe2d: [S12] spec setting and getting values of attribute...

2010-09-30 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/1/10 00:31 , Brandon S Allbery KF8NH wrote:
 As for serializeability, I think .perl is being used for two different
 things and we need to separate them.  If it's there for debugging, you want

Addendum, since as I reread my message it looks a little scatterbrained:  if
.perl is for serialization then ... gets added to an object which can't be
directly serialized due to private data, filehandles, etc.  Dump what we can
and ... the rest, perhaps (so the object could be used as is if it's
accessed lazily and only the dumpable parts are used).

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkylZSYACgkQIn7hlCsL25XcigCgm8dZfmMCclB2HUxx1P4sVk5D
GOUAoJ6Z5jmVGEDZyzD7JaKA4qRUhKi8
=lvOW
-END PGP SIGNATURE-


Re: [perl6/specs] 761178: remove some some duplicate words words

2010-09-09 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 9/8/10 14:24 , Patrick R. Michaud wrote:
 On Wed, Sep 08, 2010 at 04:02:10PM +0400, Richard Hainsworth wrote:
 I do want the diffs back: its the only way I have to keep at least
 some idea of what is changing any why.
 
 We know that a lot of people would like to see the diffs available
 through the commit messages, but afaik none of us actively maintaining
 the github archive quite know how to make that happen.  Something
 beyond please bring diffs back would be very helpful to us here.

Someone earlier suggested something starting with fork this project
(github-utils, IIRC); I poked and found myself looking at what appears to be
Rails.  And I've already got one Rails project making me cross-eyed (I know
Ruby but not Rails, so no idea where to start).

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyJMDgACgkQIn7hlCsL25XwyQCeNTiMPDlPH+rmtUQ3sIZP9C2f
FAYAn38SKAsjeEn0AS2r7A24wOBinglT
=As9K
-END PGP SIGNATURE-


Re: [perl6/specs] 761178: remove some some duplicate words words

2010-09-07 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 9/7/10 08:17 , nore...@github.com wrote:
 Commit: 7611788411e5aff5f3ae150e2da9929ee546d6d8
 
 http://github.com/perl6/specs/commit/7611788411e5aff5f3ae150e2da9929ee546d6d8

It was nicer when these contained the actual diffs like they used to,
instead of forcing me to go poke at the tree.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyGY/0ACgkQIn7hlCsL25WxpgCeLjHf3FHIZzpEzy57AWOq/QbS
KhUAoJPWUxCmDuEbtjZfrGRNy4/o3Red
=h6TB
-END PGP SIGNATURE-


Re: Buf.pm: FIFO and grammar

2010-08-13 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/13/10 22:03 , Aaron Sherman wrote:
 On Fri, Aug 13, 2010 at 8:11 PM, Jon Murray perlsm...@gmail.com wrote:
 
 My understanding from synopses was that you get the Perl 5 behaviour if
 you omit the signature on your function declaration (though I
 unfortunately can't check as I don't have Rakudo installed):

 sub foo { @_[0] = 1 }
 my $a = 0;
 foo($a);
 say $a; # 0


 
 Nope. In fact, as you indicated in the comment you left in, that prints 0
 just like the first example. In neither case is $a modified. In Perl 5, on
 the other hand, the passed value can be modified:
 
 $ ./perl6 -e 'sub foo { @_[0] = 1 } ; my $a = 0; foo($a); say $a'
 0
 $ perl -le 'sub foo { $_[0] = 1 } my $a = 0; foo($a); print $a'
 1
 
 You might well be correct about how it's supposed to work, but that's
 certainly not the current behavior.

As I read the spec, is ref should work (with some caveats).  I have no
idea if Rakudo currently implements it.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxl+sYACgkQIn7hlCsL25Vh2wCeNZuQy7zhWqxYM/I87DBaSkDr
FzkAoIdwWGAR6r3y498xLUr2TBNduy9H
=FkBh
-END PGP SIGNATURE-


Re: How are unrecognized options to built-in pod block types treated?

2010-08-04 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 8/4/10 21:26 , Darren Duncan wrote:
 jerry gay wrote:
 are there codepoints in unicode that may be either upper-case or
 lower-case, depending on the charset?  if so, then there's ambiguity
 here, depending on the user's locale.  i suspect not, but languages
 are strange beasts, and i don't know the answer.
 
 Just say that names consisting entirely of either ASCII-range uppercase
 letters or ASCII-range lowercase letters are reserved, and that names having
 either both of those or any of those plus non-ASCII letters are not reserved.
 
 The only way I see this being a problem is if we forsee that we might want
 to have official names going out of the ASCII repertoire, which I would
 recommend we don't.

For the first, you're also excluding scripts that lack the notion of case:
Hebrew and Arabic, and all of the ideograms, etc.

As to the latter, Perl 6 already has «» and ASCII equivalent ; I would
expect similar would be possible and supported in this context.

(Yes, I know, I'm not helping.  Only thing that occurs to me is something
like x-foobie:.)

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxaNEIACgkQIn7hlCsL25VyawCeJDcFIYePVqVXs/ICYOXPTdCM
4EsAnAl4FWfDNVXBrBEyVkcRLRdrUq+X
=9TYE
-END PGP SIGNATURE-


Re: Smart match isn't on Bool

2010-07-31 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 7/31/10 03:33 , Moritz Lenz wrote:
 In this code:
 
 sub test() { True };
 
 given 0 {
 when test() { say OH NOEZ }
 }
 
 I don't think it's unreasonable to expect the output to be OH NOEZ.

I think there's a confusion about what given/when is doing.  Naïvely(?), I
expect it to be shorthand where the value for when is matched against the
one for given, thus your example would be (pseudocode) if 0 == True and
expecting OH NOEZ *would* be unreasonable.

Is given/when trying to do too many things at once?

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxUOJsACgkQIn7hlCsL25WPlwCeJKwKQWDl+qaNbJMyAOcZ5UXf
R2EAn1AQBqB5hZIFmqymcaqSSGJdx9GJ
=cmZ6
-END PGP SIGNATURE-


Re: Smart match isn't on Bool

2010-07-31 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 7/31/10 11:17 , Mark J. Reed wrote:
 What if you say 'when test($_)'?  Or just 'when test'?  How do you
 smart match on a function: call the func with the target as argument
 and use the return value, or call it without any argument and compare
 the return value to the target?  Does arity matter?  Or whether the
 function is declared to return a Boolean value/called in a Boolean
 context?

As I understand the spec:

  given expr  sets $_ to expr
  when test()   calls test with no argument
  when test($_) calls test with the topic
  when testuses the function object test

It seems like this leaves $_ in an odd place, no longer really a topic,
just a sort of shorthand which is sometimes implied (see for example .foo
as calling method foo() of $_) and sometimes not (given/when).

when as currently specced seems like it's just a synonym for if.
Overgeneralization seems to have left $_ and when in a rather muddy spot.
 I feel like if the point of given/when is an overly general case statement
(as it currently seems to be), then using $_ is a Huffmanization waste
(surely $^a is good enough?) and confuses what $_ is supposed to mean, and
if the point is to be a general case statement then when expr block
should smartmatch expr against $_ instead of evaluating it with $_
available as a shorthand/topic.  Thus the confusion in the message that
started this thread:  most people expect the latter behavior, but are
getting the former which feels like a Huffmanization failure in addition to
confusing the question of implicit vs. explicit topicalization/$_.  (Am I
making any sense here?  I know what I'm trying to say, but am unsure that I
am describing it sensibly.)

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxURYEACgkQIn7hlCsL25X/4QCfT3xbqtyY9sJ8UvT0VycKqetf
nYgAnR5dw7sDNsMj6hSnwHYT90TzFxia
=u4Hj
-END PGP SIGNATURE-


Re: Smart match isn't on Bool

2010-07-31 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 7/31/10 12:56 , David Green wrote:
 a boolean IS useful. The fact that this question keeps coming up,
 even on the p6l list, seems to demonstrate that the helpful way
 isn't completely natural or obvious (at least, not to everyone).

Thank you; *that* is the real point I was trying to make.  That, and that
special-casing one particular type is *not* actually helpful; it means I
must remember a special case, when one of the goals of Perl 6 was supposedly
to eliminate all the special cases in Perl 5, helpful or no.

(Maybe make it more concrete?  There's another discussion going on about how
a .. b should behave.  Arguably it is an argument about helpfulness
versus purity... and the decision is clearly in the direction of purity.
Why, then, is *this* in the direction of helpfulness at the expense of
purity?  It's just another arbitrary decision I have to remember instead of
a general rule.)

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxUX4UACgkQIn7hlCsL25X1DACeIQryF49L/90FRDuYUQraRlW/
7UEAniG4lw5FhhnfNIDKqg+QZTolzFlc
=DDaL
-END PGP SIGNATURE-


Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-07-31 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 7/31/10 14:23 , Carl Mäsak wrote:
 a. Allow this form of encapsulation breakage.
 b. Disallow detaching of certain methods.
 c. Disallow attaching of certain anonymous methods.
 
 I must confess I don't particularly like either option. I'm by no
 means an OO expert. It would be interesting to hear your views on
 this.

The whole concept of detaching and attaching methods seems suspect to me; in
particular, attaching a method from a class not declared to be related reeks
of monkey patching.  As such, I'd only allow it when monkey patching is enabled.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxUbRAACgkQIn7hlCsL25URzACfeQwHqlQWs4IL6RdSCkkI1inr
BasAoM0LyLl19dylqoOcMjCfk3kvC9j3
=FyAF
-END PGP SIGNATURE-


Re: Breaking encapsulation by detaching a private-variable-accessing method from one object and calling it on another

2010-07-31 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 7/31/10 14:38 , Stefan O'Rear wrote:
 On Sat, Jul 31, 2010 at 02:36:02PM -0400, Brandon S Allbery KF8NH wrote:
 The whole concept of detaching and attaching methods seems suspect to me; in
 particular, attaching a method from a class not declared to be related reeks
 of monkey patching.  As such, I'd only allow it when monkey patching is 
 enabled.
 
 Methods are just functions.
 
 $object.$method(@args)
 
 is simply sugar for
 
 $method($object, @args)
 
 so disallowing it is not quite that simple.

That would seem to make it worse (type conformability on the first
positional parameter; does declaring a method not implicitly declare the
type of its positional parameter to be the class that declared it, or a
subclass thereof?) --- but I think you addressed that in your other response.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAkxUbtAACgkQIn7hlCsL25WOkwCgvq2SevYoVtGWSio0q7lVDxWy
Qt8AmM8FijA51vxGjylUwuCq1+zpF9k=
=XroU
-END PGP SIGNATURE-


Re: Unwanted warnings (was Re: Something wrong with str.reverse)

2010-07-31 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 7/31/10 23:26 , David Green wrote:
 On 2010-06-18, at 10:48 am, Larry Wall wrote:
0123; # warns
0123; # ok!   # suppresses this warning here
0123; # OK!   # suppresses this warning from now on

 Though I'm hesitant to use comment syntax for that.  A statement prefix 
 might be more appropriate.  We've currently reserved quietly for simple 
 run-time warning suppression, but that's kinda long, and not defined for 
 compile-time warnings yet.  Admittedly, it would be rather amusing to have 
 to shout at Perl 6 to make it shut up:
 my $x = QUIETLY 0123;
 
 Call it sh?  (for suppression handler, of course)

I am amusedly imagining borrowing PLEASE from Intercal. :)

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxU96sACgkQIn7hlCsL25XZ3QCdHjdXi9XgbyxGsOeqM6rzoK6p
kzsAoKlbd+CgLIfNhTpzcqP99nTIkKsh
=ZHRo
-END PGP SIGNATURE-


Re: Suggested magic for a .. b

2010-07-30 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 7/29/10 08:15 , Leon Timmermans wrote:
 On Thu, Jul 29, 2010 at 3:24 AM, Darren Duncan dar...@darrenduncan.net 
 wrote:
  $foo ~~ $a..$b :QuuxNationality  # just affects this one test
 
 I like that
 
  $bar = 'hello' :QuuxNationality  # applies anywhere the Str value is used
 
 What if you compare a QuuxNationality Str with a FooNationality Str?
 That should blow up. Also it can lead to action at a distance. I don't
 think that's the way to go.

It's half right;  the coding set should be part of the type.  Explicit
conversion is probably a good idea too.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxS09sACgkQIn7hlCsL25U69wCdFeqshkDQx24C6QT7Q7XlmF85
zmcAoK7969GXHUwhF9bZ+NPv8xy3qR5m
=vFdg
-END PGP SIGNATURE-


Re: Suggested magic for a .. b

2010-07-28 Thread Brandon S Allbery KF8NH
 On 7/28/10 8:07 PM, Michael Zedeler wrote:
 On 2010-07-29 01:39, Jon Lang wrote:
 Aaron Sherman wrote:
 In smart-match context, a..b includes aardvark.
 No one has yet explained to me why that makes sense. The continued
 use of
 ASCII examples, of course, doesn't help. Does a .. b include
 æther?
 This is where Germans and Swedes, for example, don't agree, but
 they're all
 using the same Latin code blocks.
 This is definitely something for the Unicode crowd to look into.  But
 whatever solution you come up with, please make it compatible with the
 notion that aardvark..apple can be used to match any word in the
 dictionary that comes between those two words.
 The key issue here is whethere there is a well defined and meaningful
 ordering of the characters in question. We keep discussing the nice
 examples, but how about apple .. ส้ม?

I thought that was already disallowed by spec.


Re: series operator issues

2010-07-22 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 7/22/10 11:18 , Jon Lang wrote:
 Second, I'm trying to think of a simple and intuitive way to write up
 a series expression for:
 
triangle numbers: 0, 1, 3, 6, 10, 15, 21, etc.
square numbers: 0, 1, 4, 9, 16, 25, 36, etc.
factorials: 1, 1, 2, 6, 24, 120, 720, 5040, etc.

I don't think anyone seriously expects the series operator to be a dwimmy OEIS.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxJLGkACgkQIn7hlCsL25X2jACeIwN4EBe96dS4WEBm1Ik14dQW
JNwAoJaASMvMGVickzIgdBDclNM2KhJq
=9ej6
-END PGP SIGNATURE-


Re: r31696 -[S32/Temporal] Permit day-of-month on Dates.

2010-07-15 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 7/15/10 12:21 , Mark J. Reed wrote:
 By analogy, I'd say week-of-year should work as well.

Wasn't the week stuff punted to a non-core module because there are too many
differences in how it's handled (week starts on Sunday in the US and Israel
and Monday elsewhere, differing notions of what first week of the year
means, etc.)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw/eegACgkQIn7hlCsL25UjvQCgn2pBiV9738xD3pw3UHna15/C
vW8An2GrniNl9AWg//l/Jx4foXqOXDMF
=RbhI
-END PGP SIGNATURE-


Re: The obligation of free stuff: Google Storage

2010-06-10 Thread Brandon S. Allbery KF8NH

On Jun 10, 2010, at 07:22 , Leon Timmermans wrote:

I agree it should be similar to normal FS interactoin to make matters
as intuitive as possible, but I horrified by the idea of overloading
open() that way. That's a PHP mistake I wouldn't like seeing repeated.
If you want open to do something that's not really opening a file, you
should be explicit about it.



Out of curiosity and at a tangent:  do you feel the same about FUSE?   
Gnome-VFS?


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Proposal for a new Temporal time-measurement paradigm

2010-04-22 Thread Brandon S. Allbery KF8NH

Minor nit:

On Apr 21, 2010, at 04:57 , Richard Hainsworth wrote:
If a calendar system, eg., Chinese, Muslim and Jewish, defines days  
in the same way, eg., starting at midnight and incorporating leap  
seconds, for a time-zone, then the naming of the days is done by


The Jewish, Muslim, and Baha`i (and, technically at least, Christian)  
religious calendars use sunset as the start of the day.  Only Western  
Christianity and Baha`i use the Gregorian corrections; Orthodox  
Christianity and the other aforementioned calendars are Julian.   
(Actually, the Baha`i calendar seems unclear on this; everything I can  
find suggests that it's still an open issue for them, but for the  
moment at least it's tied to the Gregorian calendar.)


The Jewish calendar doesn't recognize leap seconds; all time  
measurements are variable, with the day and night separately divided  
into 12 sha`ot composed of 60 dakot whose lengths vary as the length  
of the day/night changes throughout the year.  Sunrise and sunset are  
usually defined as when the leading (resp. trailing) edge of the solar  
disk crosses the horizon.  (Some communities use a variation where  
sunrise is considered to be first light and sunset the end of  
twilight; *usually* these are taken as the sun being 16° below the  
eastern horizon and 7.5° below the western.  However, there's a lot of  
variation between communities, and very little of this is fixed; one  
opinion sets the start of night as 1 1/4 sha`ot *before* sunset!)


Islam has some other sticking points in this area:  some communities  
define the start of a new month based on local time, while others base  
it on observations at Mecca, with the result that the calendar can  
vary by a day even in the same location.  (This got some discussion in  
the context of Iraqi sectarian violence a few years back.)   
Additionally, while Jews use a fixed calculation of when the new moon  
occurs, Muslims still base the start of the month on direct  
observation of the new moon, so the calendar can again be off by a day.


All of which suggests that it may not actually be possible to come up  
with a mechanism suitable for representing all of these calendars.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: A common and useful thing that doesn't appear to be easy in Perl 6

2010-04-07 Thread Brandon S. Allbery KF8NH

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Apr 7, 2010, at 00:52 , Larry Wall wrote:

more syntactic and/or semantic sugar.  It's just a bit awkward, after
you say:

  enum Permissions Read Write Exec;
  subset Perms of Set of Permissions;

that the name of the single-member sets are

   Perms(Read)
   Perms(Write)
   Perms(Exec)



I'm not sure that is a problem; if nothing else, it looks a lot like a  
namespace.


- --
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH


-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)

iEYEARECAAYFAku88H0ACgkQIn7hlCsL25UMygCghfC0kT1tW+1TmVNsmFkK+Dt1
e6MAnRl5U0F+LS/7pztfqA2IZToDBvGG
=4KcO
-END PGP SIGNATURE-


Re: You never have privacy from your children in Perl 6

2010-03-27 Thread Brandon S. Allbery KF8NH

On Mar 27, 2010, at 15:43 , Darren Duncan wrote:
My own take on 'trusts' is that I consider its main purpose is to  
let programmers *avoid* contrivances when they want to define  
something that would otherwise be a single class but is split into  
multiple classes for better elegance.  For example, say you want to  
define a graph of some kind, and for elegance you have a separate  
container and node and side classes, even though conceptually these  
are all integrated parts of a whole.  Say in this case your  
container class has a


This sounds like a hackaround for an incomplete implementation of ADTs.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r29976 - docs/Perl6/Spec

2010-03-09 Thread Brandon S. Allbery KF8NH

On Mar 9, 2010, at 18:10 , Timothy S. Nelson wrote:
	Algol 68 is notorious as a failure.  Let's hope things are  
different here.



As a programming language, it was a failure, in large part because it  
was a bit too forward-looking for the available compiler technology.   
(It's still a bit tough, but a lot easier than it was in the late 60s,  
and there is an open source Algol 68 compiler.)  However, it shaped an  
entire generation of programming languages, and the URL I posted  
earlier demonstrates that language design that ignores Algol 68 is  
prone to reinvent its concepts, poorly.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r29976 - docs/Perl6/Spec

2010-03-08 Thread Brandon S. Allbery KF8NH

On Mar 8, 2010, at 06:23 , Carl Mäsak wrote:

commitbot (), Brandon ():
+has $!age is ref;   # BUILD will automatically use ref  
binding, not copy


Perl6 isn't done until it has reinvented Algol 68?


Unaware of what Algol 68 represents in programming language history, I
perused Wikipedia's article on Algol 68:


Actually, I was riffing on the 'is ref' stuff, since Algol68 did some  
interesting things with the ref keyword (and the way the language  
report described it was somewhat less than clear).  And as such, it  
was a joke gone awry.


(And as to it being complex, I'm tempted to invoke PL/I.  It's less  
complex than most people think; it was just described *really poorly*.)


Chew on this article instead of Wikipedia:  
http://www.cowlark.com/2009-11-15-go/


http://en.wikipedia.org/wiki/ALGOL_68 (]):
] ALGOL 68 has been criticized, [...] for abandoning the simplicity of
] ALGOL 60 [and instead] becoming a vehicle for complex or overly
] general ideas, and doing little to make the compiler writer's task  
easy,

] [...]


The former sounds like the whining of a Scheme user; the latter, a  
holdover from ancient times.  (What would the folks who complained  
about it not making compiler writers' lives easy have said about C++?)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r29976 - docs/Perl6/Spec

2010-03-08 Thread Brandon S. Allbery KF8NH

On Mar 8, 2010, at 11:04 , Carl Mäsak wrote:

commitbot (), Brandon (), Mark (), Carl ():
+has $!age is ref;   # BUILD will automatically use ref  
binding, not copy


Perl6 isn't done until it has reinvented Algol 68?


[...]

I'm not sure what exactly the repercussions of doing attribute
initialization with 'is ref' are apart from that. Brandon, if your
oblique reference to Algol 68 meant something more than what I
uncovered above, feel free to enrich the discussion by sharing what
you know about the possible consequences of spec'ing things this  
way.


I imagine Brandon was more referring to pass-by-reference, which was
introduced into procedural HLLs by Algol-68.


Oh! It was that simple.


Right.  And just a joke, not a complaint about the language.


Meanwhile, the uncanny similarities between Perl 6 and Algol 68
continue to strike me:


And *that* is why I'm cracking Algol 68 jokes here.  :)

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r29976 - docs/Perl6/Spec

2010-03-07 Thread Brandon S. Allbery KF8NH

On Mar 7, 2010, at 09:42 , pugs-comm...@feather.perl6.nl wrote:
+has $!age is ref;   # BUILD will automatically use ref binding,  
not copy



Perl6 isn't done until it has reinvented Algol 68?

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r29768 - docs/Perl6/Spec

2010-02-19 Thread Brandon S. Allbery KF8NH

On Feb 17, 2010, at 17:18 , Smylers wrote:

pugs-comm...@feather.perl6.nl writes:

Author: lwall
+++ docs/Perl6/Spec/S02-bits.pod2010-02-17 19:15:34 UTC (rev 29768)

+rhyme((1,2),3,:miceblind)   # rhyme has 2 arguments


Should that say 3 arguments?  (If not, please can somebody clarify  
what

the 2 arguments are.)


(1,2) and 3.  Named arguments (mice in this case) are handled  
separately.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Temporal seems a bit wibbly-wobbly

2010-02-19 Thread Brandon S. Allbery KF8NH

(re subject:  does it go `Ding!' when there's Stuff?)

On Feb 20, 2010, at 00:30 , Larry Wall wrote:
but an astronomer?  But no, many millions of computers have to  
accommodate
to the convenience of a very few people.  And most computers still  
don't

know how to do even that accommodation, since POSIX time is blissfully
unaware of leap seconds...

Sorry, you pushed one of my hot buttons.  Grrr!  :)



Not just yours; quite a few of us wish NTP would return to the demesne  
of mad scientists and astronomers, to be replaced by a saner (i.e. non- 
leap-second) version of SNTP.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Gripes about Pod6 (S26)

2010-02-12 Thread Brandon S. Allbery KF8NH

On Feb 12, 2010, at 19:57 , Timothy S. Nelson wrote:

On Wed, 10 Feb 2010, Jon Lang wrote:

John Gabriele wrote:

Personally, I've always thought that Perl has a very natural feel to
it, and deserves a doc markup format that's also natural: [Markdown]
(and [Pandoc]'s Markdown has just the right additions, IMO).

[Markdown]: http://daringfireball.net/projects/markdown/
[Pandoc]: http://johnmacfarlane.net/pandoc/


I definitely prefer Markdown's approach to inline markup over POD's
approach: e.g., _italic_ strikes me as much more legible than
Iitalic.


	That's one of the things that's always annoyed me with Markdown; I  
think it should be *bold*, /italic/, and _underline_.



There's a school of thought, common among printing/publishing types,  
that insists that underline was intended solely to replace italics  
when they couldn't be represented (i.e. no fonts, as with ASCII  
terminals and printers).  Thus Markdown's use of _italic_.  (See also  
nroff.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r29540 - docs/Perl6/Spec

2010-01-16 Thread Brandon S. Allbery KF8NH

On Jan 16, 2010, at 01:47 , pugs-comm...@feather.perl6.nl wrote:

-=head1 Regexes are now first-class language, not strings
+=head1 Regexes are now a first-class language, not strings



I'm not sure if that's the correct reading, or ...now first-class  
language [elements].  Or possibly using language as a collective  
concept (compare `$phrase' is now acceptable language in a natural  
language context).


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Comments on S32/Numeric#Complex

2009-12-16 Thread Brandon S. Allbery KF8NH

On Dec 16, 2009, at 19:46 , Dave Whipp wrote:

yary wrote:

At 00:15 +0100 12/17/09, Moritz Lenz wrote:
Not quite, .abs returns one of the polar coordinates (the  
magnitude), so

only a method is missing that returns the angle.

Any ideas for a good name?
Would a method called phi with a unicode synonym φ be too  
obtuse?


Anything wrong with .angle?



I was thinking, if you want a short name to match .abs, try .dir.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r28751 - docs/Perl6/Spec

2009-10-11 Thread Brandon S. Allbery KF8NH

On Oct 11, 2009, at 06:36 , Mark J. Reed wrote:
That's not grammatical; you've just created a run-on sentence.  Why  
not

leave it as a colon?


Or semicolon.  I agree comma seems wrong.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Synopsis 02: Range objects

2009-08-27 Thread Brandon S. Allbery KF8NH

On Aug 27, 2009, at 17:48 , Jon Lang wrote:
On Thu, Aug 27, 2009 at 2:36 PM, Mark J. Reedmarkjr...@gmail.com  
wrote:
I think $a = $^x = $b is short enough, and lets you choose  
between 

and = on both ends and without having to remember how many dots each
maps to.


How many dots?


.. vs. ... operators, I presume.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: S26 - The Next Generation

2009-08-17 Thread Brandon S. Allbery KF8NH

On Aug 17, 2009, at 14:27 , Moritz Lenz wrote:

ll 99:
   followed by a valid identifierN
   A valid identifier is a sequence of alphanumerics and/or
   underscores, beginning with an alphabetic or underscore




Is there a good reason to deviate from Perl 6's definition of an
identifier? For the sake of consistentcy I'd just say that the Perl  
6 rules

apply.


It occurs to me that *if* you are executing/evaluating (part of) the  
source, then it could be argued that an identifier should be defined  
by whatever language the parser ends up running, which might not be  
perl6.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: S26 - The Next Generation

2009-08-17 Thread Brandon S. Allbery KF8NH

On Aug 17, 2009, at 14:34 , raiph mellor wrote:

However it seems we have to pay a price: each act of rendering a Pod
file actually means executing the program that's being documented (at
least the BEGIN blocks and other stuff that happens at compile time),
with all the security risks implied. So we'll need a *very* good
sandbox. Is that worth it?


From the spec:

  However, during parsing and initialization under K-doc, the
  interpreter only executes those CBEGIN, CCHECK, and
  CINIT blocks (and equivalents, such as Cuse statements
  and subroutine declarations) that are preceded by the special
  prefix: CDOC



Nonetheless, DOC INIT { system rm -rf . } (or etc.) would be  
unfortunate.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Filename literals

2009-08-14 Thread Brandon S. Allbery KF8NH

On Aug 14, 2009, at 16:17 , Mark J. Reed wrote:
On Fri, Aug 14, 2009 at 3:35 PM, Darren  
Duncandar...@darrenduncan.net wrote:

Under Mac OS X, all drives, root or otherwise, are accessible under
'/Volumes/drive-name/...', and Unix in general lets you mount  
drives
anywhere.  I imagine Windows supports more ways of denoting drives  
than the

drive letter.


Nope.  Have to use the drive letter.  But / is understood as a synonym
for \ by the Windows API.



UNC drive specs should work as well, i.e.. \\MYHOST\C\... (or swap / for
\).

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Testing Perl 6 analog to Perl 5's tie.

2009-08-02 Thread Brandon S. Allbery KF8NH

On Aug 2, 2009, at 13:10 , Moritz Lenz wrote:

Kyle Hasselbacher wrote:

My patchwork readings lead me to believe I could test Perl 6's
tie-like feature with something like the below code, which I don't
expect to even compile, what with '???' in places.  My question is:
am I on the right track?  Obviously there are details I haven't  
nailed

down, and any guidance would be appreciated.


I think the you're on the right track, but I'm not sure about some  
details.
For one it scares me to think that we do a full-blown multi dispatch  
on

every FETCH/STORE operation, which might become quite expensive.


Last I heard the assumption was that the compiler would optimize way  
most such calls.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Reusing code: Everything but the kitchen sink

2009-07-12 Thread Brandon S. Allbery KF8NH

On Jul 12, 2009, at 20:15 , David Green wrote:

  sub nighttime (Canine $rover) { $rover.bark if any(burglars()); }

(...)
3) $rover acts like a Canine, but the rest of the original $dogwood  
arg (the Tree parts) are still there; they just aren't used unless  
somehow explicitly brought out; for example, by casting $rover to a  
Tree, or by passing it to some other function that is looking for a  
Tree object.  This is how I'd like it to work, because that's the  
most flexible.


If you haven't declared it as such, this strikes me as a bad thing.   
Perhaps some kind of declarative syntax that lets you declare that you  
can take a Dogwood, such that you get an added argument which is undef  
(for a non-Dogwood) or a Dogwood (or Tree?)?


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Re-thinking file test operations

2009-07-09 Thread Brandon S. Allbery KF8NH

On Jul 9, 2009, at 18:22 , Moritz Lenz wrote:
Somehow the current file test syntax, 'filename' ~~ :e, looks like a  
not

well-though-out translation of Perl 5's syntax, -e 'filename'.


That would be because it is; originally the filetests were perl5- 
style, but pugs refused to parse them because you can't combine  
operator and word characters in a single token.  (I admit to wondering  
if pugs' parse problems were enough of a reason to change them,  
especially now that pugs is pretty much dead.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: YAPC::EU and Perl 6 Roles

2009-07-07 Thread Brandon S. Allbery KF8NH

On Jul 7, 2009, at 07:34 , Jonathan Worthington wrote:

Jon Lang wrote:

I believe that the official word is to say:

 class PracticalJoke does Bomb does Spouse {
   method fuse () { Bomb::fuse }
   method explode () { Spouse::explode }
 }


This way won't work, because:

* It's doing a sub call to something that's a method
* The lookup won't work unless the method has our (package) scope *
* Even in that case, the invocant isn't being passed so you'll get a  
wrong number of parameters error



I was trying to figure out how to do it with nextsame, but that's not  
looking very simple.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: YAPC::EU and Perl 6 Roles

2009-07-07 Thread Brandon S. Allbery KF8NH

On Jul 7, 2009, at 08:13 , Jonathan Worthington wrote:

Brandon S. Allbery KF8NH wrote:
I was trying to figure out how to do it with nextsame, but that's  
not looking very simple.


On the other hand, if they were multis then they get added to the  
multi candidate list and therefore you can nextsame into them. Again  
from Rakudo:


 role R { multi method b() { say lol in role } }
 class C does R { multi method b() { say oh hai in class;  
nextsame } }

 C.new.b
oh hai in class
lol in role



But even then that's only half of it; we want a() from one role and  
b() from another, when both roles do a() and b().  Looks painful to me.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: XOR does not work that way.

2009-06-24 Thread Brandon S. Allbery KF8NH

On Jun 22, 2009, at 19:12 , Minimiscience wrote:

On Jun 22, 2009, at 5:51 PM, Damian Conway wrote:

Perl 6's approach to xor is consistent with the linguistic sense of
'xor' (You may have a soup (x)or a salad (x)or a cocktail), and  
also

with the IEEE 91 standard for logic gates.


I don't think natural language -- especially the abomination that is  
English -- is the best guide for understanding logical operations  
(why, yes, I *do* speak Lojban; how did you know?).


Except, of course, that Perl is all about natural language concepts,  
not mathematical or logical concepts; and I don't think very many  
natural languages care about either mathematical logic or Lojban-like  
linguistic precision.


(Granted, that last part may make full perl6 interesting.)

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Illustration of stuff we've been discussing

2009-05-31 Thread Brandon S. Allbery KF8NH

On May 28, 2009, at 10:27 , John M. Dlugosz wrote:

Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote:

Em Qui, 2009-05-28 às 00:24 -0500, John M. Dlugosz escreveu:


Please see http://www.dlugosz.com/Perl6/web/info-model-1.html
and talk to me about it.



The illustratino is cool, but it doesn't take into account the
possibility of:

@a[0] := $x;

Where in the synopses does it say anything like that is  
possible?  := is applied to a _name_.



The usual example in the Synopses is with a hash instead of an array,  
but the same principle applies:


 %ax := $y;

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Amazing Perl 6

2009-05-31 Thread Brandon S. Allbery KF8NH

On May 27, 2009, at 13:59 , Daniel Carrera wrote:
Wow... That's a foldl! In a functional language, that would be  
called a fold. It's very popular in Haskell.


I like that Perl 6 seems to be taking steps in the direction of  
functional languages. First lazy lists (0..Inf) and now a fold. :-D



One of the early P6 prototypes was written in Haskell, and there's  
been a lot of notions lifted from it.  (OTOH being an old phart I know  
[OP] @list as op/list :)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Amazing Perl 6

2009-05-31 Thread Brandon S. Allbery KF8NH

On May 27, 2009, at 15:42 , Daniel Carrera wrote:

Mark J. Reed wrote:
Note that of the examples given, only Perl 6 and Common Lisp do two  
things

that help immensely simplify the result:
1. reference the built-in * operator directly, without having to  
wrap it in

a lambda expression;
2. actually name the function !


Yes, very neat. Haskell does that too, but I don't know if you can  
make the function a postfix in Haskell.



Not in H98, but ghc allows it as a degenerate form of section.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Amazing Perl 6

2009-05-31 Thread Brandon S. Allbery KF8NH

On May 27, 2009, at 18:05 , John M. Dlugosz wrote:

And APL calls it |¨ (two little dots high up)



buh?  Metaoperator / (+/LIST).

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Amazing Perl 6

2009-05-31 Thread Brandon S. Allbery KF8NH

On May 28, 2009, at 06:43 , Jon Lang wrote:

What I'm wondering is how the list knows to feed two items into '[+]'.
While 'infix:+' must accept exactly two arguments, '[+]' can accept
an arbitrarily long (or short) list of arguments.



I thought that at first too, then remembered a discussion about  
generalizing the meaning of square brackets and how [op] fell out of  
it automatically to take a reference to an operator without using the  
infix:op syntax.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Amazing Perl 6

2009-05-31 Thread Brandon S. Allbery KF8NH

On May 29, 2009, at 15:43 , John M. Dlugosz wrote:

Care to try ☃ ?  That's alt-meta-hyper-doublebucky-cokebottle.



*puzzled as to why OSX Character Map thinks that's related to 雪*

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Amazing Perl 6

2009-05-31 Thread Brandon S. Allbery KF8NH

On May 29, 2009, at 21:50 , Timothy S. Nelson wrote:
some Linux programs support it too.  Unfortunately my e-mail program  
(Pine) seems to have some trouble with unicode -- I may have to look  
at alternatives after 14 years of use :(.



http://www.washington.edu/alpine/

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Amazing Perl 6

2009-05-31 Thread Brandon S. Allbery KF8NH

On May 29, 2009, at 22:40 , Timothy S. Nelson wrote:

On Fri, 29 May 2009, John M. Dlugosz wrote:
Ah yes, on the PC historically you hold down the ALT key and type  
the code with the numpad keys.


	At least when I used it, this was a decimal, rather than hex  
number, and had to be preceded by a 0 (zero).



I see ALT+ a lot in Windows stuff, and have used it a few times  
(that is, while holding Alt type + and 4 hex digits).


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: renaming or adding some operators

2009-05-31 Thread Brandon S. Allbery KF8NH

On May 29, 2009, at 22:33 , Jon Lang wrote:

also is an ordered, short-circuiting version of  (and thus
all).  For some time now, I've wanted an analog for '|' and 'any' -
but the only name I can think of for it would be 'else', which has
some obvious clarity issues.


I have seen x (alt. y) used in print, so maybe alt?

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: renaming or adding some operators

2009-05-31 Thread Brandon S. Allbery KF8NH

On May 30, 2009, at 15:38 , Larry Wall wrote:

Perhaps something like

   use *;

should pull in all the Unicode operators.  Which if course means that
any golfing would start with

   *;



⨷ perhaps?  It only makes sense that a Unicode operator be used to  
pull in all of Unicode.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Unicode in 'NFG' formation ?

2009-05-18 Thread Brandon S. Allbery KF8NH

On May 18, 2009, at 09:21 , Mark J. Reed wrote:

If you're doing arithmetic with the code points or scalar values of
characters, then the specific numbers would seem to matter.  I'm



I would argue that if you are working with a grapheme cluster  
(grapheme), arithmetic on individual grapheme values is undefined.   
What is the meaning of ord(\c[LATIN LETTER T WITH DOT ABOVE, COMBINING  
DOT BELOW]) + 1?  If you say it increments the base character (a  
reasonable-looking initial stance), what happens if I add an amount  
which changes the base character to a combining character?  And what  
happens if the original grapheme doesn't have a base character?


In short, I think the only remotely sane result of ord() on a grapheme  
is an opaque value meaningful to chr() but to very little, if  
anything, else.  If you want to represent it as an integer, fine, but  
it should be obscured such that math isn't possible on it.   
Conversely, if you want ord() values you can manipulate, you must work  
at the codepoint level.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Unicode in 'NFG' formation ?

2009-05-18 Thread Brandon S. Allbery KF8NH

On May 18, 2009, at 14:16 , Larry Wall wrote:

On Mon, May 18, 2009 at 11:11:32AM +0200, Helmut Wollmersdorfer wrote:

3) Details of 'life-time', round-trip.


Which is a very interesting topic, with connections to type theory,
scope/domain management, and security issues (such as the possibility
of a DoS attack on the translation tables).


I find mysef wondering if they might need to be standardized anyway;  
specifically I'm contemplating Erlang-style services.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Unicode in 'NFG' formation ?

2009-05-18 Thread Brandon S. Allbery KF8NH

On May 18, 2009, at 21:54 , Larry Wall wrote:

On Mon, May 18, 2009 at 07:59:31PM -0500, John M. Dlugosz wrote:

No, a few million code points in the Unicode standard can produce an
arbitrary number of unique grapheme clusters, since you can apply as
many modifiers as you like to each different base character.  If you
allow multiples, the total is unbounded.

A small program, which ought to go into the test suite g, can  
generate

4G distinct grapheme clusters, one at a time.


That precise behavior is what I was characterizing as a DoS  
attack.  :)
So in my head it falls into the Doctor-it-hurts-when-I-do-this  
category.



If you're working with externally generated Unicode, you may not have  
that option.  I've gotten some bizarre combinations out of Word in  
Hebrew with nikudot, then saved as UTF8 text (so bizarre, in fact,  
that in the end I used gedit on FreeBSD).


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Getting rid of want()

2009-03-31 Thread Brandon S. Allbery KF8NH

On 2009 Mar 31, at 17:04, Moritz Lenz wrote:
We had a discussion on #perl6 tonight about how to implement want(),  
and

basically came to no conclusion. Then I came up with the idea that any
lazy implementor will come up with: drop it from the language.


Hm, I was under the impression that want() had already been dropped,  
and subs return captures.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: $?OS change

2009-03-02 Thread Brandon S. Allbery KF8NH

On 2009 Mar 2, at 6:19, Timothy S. Nelson wrote:

On Mon, 2 Mar 2009, Chris Dolan wrote:

On Mar 2, 2009, at 12:04 AM, Timothy S. Nelson wrote:
	Hi.  I note that we have $?OS, $?VM, and $?DISTRO (and their $*  
counterparts).  I'd like to recommend that we eliminate $?OS, and  
replace it with $?KERNEL (ie. Linux) and maybe $?ARCH (ie. i386).   
Thoughts?


User-space code cares much more deeply about the operating system  
than the kernel, largely thanks to libc or the equivalent.  For  
example, BSD systems can be built on a number of different  
kernels.  Mac OS X is in principle FreeBSD on Mach, but there are a  
huge number differences from plain FreeBSD that have nothing to  
do with Mach.  Instead, it would be even more useful to represent $? 
OS.family, $?OS.version.major, $?OS.version.minor, etc.  Linux  
distros often support switching kernel versions out from under the  
OS.


So how about we define things as follows for Mac:
-   Kernel = FreeBSD
-   Arch = Mach
-   Distro = Mac OS X


Actually, given the above you want:

- Kernel = Mach (or Darwin)
- Arch = PPC or x86-64
- Distro = Mac OS X - with compatibility = FreeBSD

(as FreeBSD itself on i386 or x86-64 does Linux, at least if the  
linuxulator is configured)


Not sure if we want to deal with compatibility, but in addition to the  
abovementioned FreeBSD-Linux compatibility role, x86-64 does i386  
(arch), SuSE does Red Hat (distro; each SuSE version has compatibility  
with a particular Red Hat version), Ubuntu does Debian (distro), there  
is a core BSD API set which is supported by all the BSDs and a  
larger API set that is done by NetBSD, FreeBSD, and Dragonfly BSD,  
etc.  There is even some compatibility at the kernel level, but as  
previously noted the kernel details aren't actually that useful to  
Perl so probably not worth it.


Note also that some of these may be ranges, especially as noted above  
for compatibility roles.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Comparing inexact values (was Re: Temporal changes)

2009-02-26 Thread Brandon S. Allbery KF8NH

On 2009 Feb 26, at 13:00, Jon Lang wrote:

I'm not sold on the notion that Num should represent a range of values


Arguably a range is the only sane meaning of a floating point number.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Comparing inexact values (was Re: Temporal changes)

2009-02-26 Thread Brandon S. Allbery KF8NH

On Feb 26, 2009, at 14:27 , Jon Lang wrote:

Jon Lang wrote:
Brandon S. Allbery wrote:

Jon Lang wrote:
I'm not sold on the notion that Num should represent a range of  
values


Arguably a range is the only sane meaning of a floating point number.


Perhaps; but a Num is not necessarily a floating point number - at
least, it shouldn't always be.


But that's not the point; it's can be that matters, not must be.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




Re: r25490 - docs/Perl6/Spec

2009-02-24 Thread Brandon S. Allbery KF8NH

On 2009 Feb 22, at 22:47, pugs-comm...@feather.perl6.nl wrote:

+$?PUGS_VERSION # Pugs version (not canonical)
+$*PUGS_HAS_HSPLUGINS # True if Pugs was compiled with support  
for hsplugins

+ # (not canonical)


These should not be part of the standard.  But while Pugs is free to  
keep providing them, I would suggest the more general:


 $?PERL6_IMPLEMENTATION (pugs, rakudo, ...)
 $?PERL6_IMPL_VERSION
 $?PERL6_IMPL_FEATURES (it's possible this should be part of %?CONFIG)

(BTW, why is a this impl compiled with support for not a ? twigil?   
It's not going to change at runtime.)


+There were threads on p6l about unifying all variables which  
concern the OS or
+the VM ($*UID, $*PROGRAM_NAME, etc.) into two variables, $?ENV  
(compile-time
+environment) and $*ENV (runtime environment). Larry did like the  
idea, but


%?PERL6_ENV
%*PERL6_ENV

BTW, I also agree with the earlier observation that $*OUT vs. $*DEFOUT  
(etc.) both violates Huffman coding and encourages use of the wrong  
one.  $*OUT vs. $*STDOUT (meanings inverted relative to the above)  
maybe?


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r25490 - docs/Perl6/Spec

2009-02-24 Thread Brandon S. Allbery KF8NH

On 2009 Feb 23, at 22:43, Timothy S. Nelson wrote:

On Mon, 23 Feb 2009, jason switzer wrote:
On Sun, Feb 22, 2009 at 9:47 PM, pugs-comm...@feather.perl6.nl  
wrote:

+$*PROGRAM_NAME # name of the program being executed


How does this differ from $*EXECUTABLE_NAME?


Good question.  Anyone?


I would assume $*PROGRAM_NAME is the script, and $*EXECUTABLE_NAME is  
the name of the interpreter.  Or the same as $*PROGRAM_NAME if it has  
been compiled to native code?  Not sure this is useful, which suggests  
you don't so much want $*EXECUTABLE_NAME as $?PERL6_IMPLEMENTATION  
(see my earlier message).



+?ROUTINE  # current sub or method (itself, see S06)
+@?ROUTINE  # current subs or methods (themselves)


I'm sure this is a typo for $?ROUTINE. Besides, I think $?SUB makes  
more

sense.


Well, Larry says this in S02:

   ?ROUTINE   Which routine am I in?
   @?ROUTINE   Which nested routines am I in?
   ?BLOCK Which block am I in?
   @?BLOCK Which nested blocks am I in?


?ROUTINE is a CODE ref to the current routine.  @?ROUTINE is an array  
of CODE refs.  I assume if you want a name you can invoke a method on  
?ROUTINE to retrieve it (may return undef if it's an anonymous CODE  
ref).



+ $* and $# have been deprecated half of forever and are gone.  $[
+ is a fossil that I suppose could turn into an evil pragma, if we
+ try to translate it at all.  (Frees up * twigil for $*FOO syntax.)


I'm not even sure this makes sense to me. Is this saying that $*  
and $# are

largely not in use anymore (in perl6)?


	Read the section on twigils in S02.  Hopefully things will make  
more sense after that.  It says that $* is no longer a separate  
variable, but is used for $*OSNAME, $*VM, and the like.


The perl5 $*, $#, $[ have been deprecated for a long time, and are not  
in perl6 at all.  (And I would strongly discourage any attempt to  
support $[ by pragma.  But @Larry.grep: allb...@ece.cmu.edu is  
Failure :)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Temporal changes

2009-02-24 Thread Brandon S. Allbery KF8NH

On 2009 Feb 23, at 8:34, Ruud H.G. van Tol wrote:

Martin D Kealey wrote:

Ah, we want a noun that isn't readily confused as an adjective.
Suitable terms might include: Instant Jiffy Juncture Moment  
Occasion Snap Tick ...


Once :)


Then?

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r25445 - docs/Perl6/Spec/S32-setting-library

2009-02-21 Thread Brandon S. Allbery KF8NH

On 2009 Feb 20, at 12:21, Daniel Ruoso wrote:

Em Sex, 2009-02-20 às 10:40 -0600, Dave Rolsky escreveu:

On Fri, 20 Feb 2009, Daniel Ruoso wrote:

If we're going to use an epoch, it should be the Operating System's
epoch. Anything else will lead to confusion and disorder ;P

And which OS epoch would that be?


The one where the program is being run.

The only way of being actually cross platform is to providing more
semantics to the value, choosing an arbitrary epoch that is not  
going to

be consistent with the epoch used in the OS is simply being annoying.



Strongly disagree:  Perl6 is a high level language; it should not  
force me to operate at a level where the OS's version of time is  
visible, but should always present a higher level abstraction.  I  
should *never* have to work with a time_t unless there is some  
particular reason I need it (e.g. some network protocol or binary file  
format demands it), then there can be an FFI call from a library to  
obtain it or generate a Perl6 time from it.


Quite frankly I won't miss time_t.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Perl's internal time (was: Re: r25445 - docs/Perl6/Spec/S32-setting-library)

2009-02-21 Thread Brandon S. Allbery KF8NH

On 2009 Feb 20, at 14:36, Chris Dolan wrote:
UTC: TAI with an offset, as corrected for the actual revolution of  
the

Earth: usually 60 seconds in a minute, but occasionally 59 or 61.  60
minutes in every hour (so 3599, 3600, or 3601 seconds), 24 hours in
every day (86399, 86400, or 86401 seconds).


Yes, just as I said: a constant offset between each of the proposed


Read again; a leap second was added at the end of last year, that's  
not exactly constant.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: Exegesis 7/format() question

2009-02-19 Thread Brandon S. Allbery KF8NH

On 2009 Feb 17, at 1:54, Timothy S. Nelson wrote:
	Hi all.  According to S29, the Perl 5 format() function is  
obsolete, and it says See Exegesis 7.  According to Exegesis 7,  
there will be a Form.pm which implements similar functionality, but  
has to be used.  My questions are:

1.  Is the Form.pm module discussed anywhere in the specs?
2.	This seems to imply that the Form.pm module will be included as  
part
	of the standard Perl distribution, but not used by default.  Is  
this

the case?  I presume this is also true of the IO roles.  Is there
somewhere a list of all the modules that will be part of the standard
Perl6 distro?



I may be out of date, but last I'd heard Form.pm had been neither  
documented nor specced (much less written) and was expected not to  
make the initial Perl6 release.


(It would be difficult to spec given that IO is only just being  
specced now and nothing is firm yet.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: The use of roles in S16 (Was: Re: r25328 - docs/Perl6/Spec)

2009-02-17 Thread Brandon S. Allbery KF8NH

On 2009 Feb 16, at 22:44, Timothy S. Nelson wrote:
	So you can have a stream handle which does IO::Writeable, but will  
throw an error on any attempt to write?  Anyway, you've answered my  
question in the other e-mail.


Not sure what you're getting at, but the obvious example is a  
writeable handle on a full filesystem.  I don't think we want Perl  
deciding to remove IO::Writeable because the fs happens to be full at  
the instant it's opened.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r25328 - docs/Perl6/Spec

2009-02-15 Thread Brandon S. Allbery KF8NH

On 2009 Feb 15, at 22:50, Timothy S. Nelson wrote:

On Sat, 14 Feb 2009, Leon Timmermans wrote:

+=item sysopen


I vote for sysopen (and all other sys functions) to be wiped out of  
existence.


Disagree -- I think these belong in IO::Unbuffered.  Maybe we could  
make that optional, though


I think sysopen etc. should go away, instead allowing open() to  
specify unbuffered.  In general anything that exposes a system file  
descriptor is an abstraction violation (unless in a module which is  
intended to do so; IO::Posix?).


The original intent behind sysopen() was to allow system file  
descriptor mode flags to be used; this was a workaround for perl5's  
open being insufficiently flexible.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r25328 - docs/Perl6/Spec

2009-02-14 Thread Brandon S. Allbery KF8NH

On 2009 Feb 14, at 12:01, Leon Timmermans wrote an unending refrain of:

Why should this do POSIX? What about non-POSIX operating systems?



I think the point here is that on POSIX systems that gets you ioctl()  
and fcntl(), and on non-POSIX systems either they don't exist or they  
throw runtime errors.  Aside from my earlier suggestion that non-POSIX  
systems generally have similar functions for which we should consider  
a common rubric, I'm not sure if this (does IO::POSIX) is backwards  
or if my/our(?) understanding of does is backwards, or possibly  
tangential.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r25182 - docs/Perl6/Spec

2009-02-06 Thread Brandon S. Allbery KF8NH

On 2009 Feb 6, at 6:24, Daniel Ruoso wrote:

Em Sex, 2009-02-06 às 02:07 -0500, Brandon S. Allbery KF8NH escreveu:

I would think fcntl() is just the Unix version of a more general

concept, which is probably wider than POSIX.


Maybe this wider concepts can be expressed in their own roles, as
already been suggested here, as we have IO::Readable and  
IO::Writeable.

IO::Flock is something that looks right to me, where IO::Linux26 does
IO::Flock (even if IO::POSIX doesn't).

(I use flock as an example because I'm not sure how fcntl applies to a
non-posix OS, since that's the name of a POSIX function).


fcntl = file descriptor control/configuration.  While the name itself  
is POSIX, the range of possible actions described by it is larger than  
that.


(Yes, one could just compose roles with individual actions, thus  
making fcntl() disappear altogether.  But you will not be thanked by  
someone who has to work out exactly which roles s/he needs to  
implement for a given IO-like object, nor by the unfortunate tasked  
with porting perl5 code.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r25182 - docs/Perl6/Spec

2009-02-05 Thread Brandon S. Allbery KF8NH

On 2009 Feb 4, at 11:45, Aaron Crane wrote:

FWIW, I prefer the traditional spelling, writable.  Google suggests
that writeable is more common on the web, though; 4.8 versus 3.7
Mghits.


I have to admit that writable suggests to me that you can serve a  
writ on it; an unlikely case for even Perl6 I/O. :)



+=head2 IO::POSIX
+
+Indicates that this object can perform standard posix IO operations.


I don't like that wording, but getting it right seems tricky.  The
problem is that I don't think you mean for IO::POSIX to contain
methods corresponding to POSIX-ish read(2), write(2), given that
methods of those names exist in other roles.  But those are precisely
what I'd think of as most obviously falling into the category of
standard POSIX I/O operations.


Do we want/need to deal with POSIX conformance levels?


* It seems a little odd to put an flock method in an IO::POSIX role,
 given that POSIX specifies fcntl(F_SETLK) in place of traditional
 BSD-ish flock().  I'd be in favour of having .fcntl in IO::POSIX, but
 with an additional role providing .flock (IO::Flock, presumably).



I would think fcntl() is just the Unix version of a more general  
concept, which is probably wider than POSIX.  As such, we may want to  
think about what is suitable for this.  (I can see some ioctl() stuff  
fitting here, and possibly even some of setsockopt(), from the POSIXy  
end.  I also have the impression that {,Open}VMS has some interest  
here.)  Locking would then be a separate interface, even though on  
POSIX it uses the same system call as fileDescriptorConfigure or  
whatever the general call here is named.


Likewise POSIX pathconf() seems like a specific variant of a more  
general interface based on paths instead of file descriptors.   
Although I'm not sure what else would fit in here (ignoring something  
like pioctl() that only a small subset of Perl6 users would care  
about)... but that's quite possibly because I'm not very familiar with  
non-Unix/POSIX options.


Even given this, if we want compatibility we might provide stuff in  
IO::POSIX (IO::VMS, IO::Windows, whatever) which translates to these  
calls.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r25182 - docs/Perl6/Spec

2009-02-05 Thread Brandon S. Allbery KF8NH

On 2009 Feb 4, at 12:56, Leon Timmermans wrote:
On Wed, Feb 4, 2009 at 4:37 PM,  pugs-comm...@feather.perl6.nl  
wrote:

+=item method IO dup()


Do we really want that? POSIX' dup does something different from what
many will expect. In particular, the new file descriptors share the
offset, which can result in some really confusing situations.


In IO::POSIX?  Yes; you're asking for POSIX semantics, if that isn't  
what you want, IO::POSIX is not where you should be.  If there's  
something more general out there, it can be dup() in some other  
namespace than IO::POSIX.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: r25102 - docs/Perl6/Spec

2009-02-01 Thread Brandon S. Allbery KF8NH

On 2009 Jan 30, at 11:30, Larry Wall wrote:

So I'm open to suggestions for what we ought to call that envelope
if we don't call it the prelude or the perlude.  Locale is bad,
environs is bad, context is bad...the wrapper?  But we have dynamic
wrappers already, so that's bad.  Maybe the setting, like a jewel?
That has a nice static feeling about it at least, as well as a feeling
of surrounding.

Or we could go with a more linguistic contextual metaphor.  Argot,
lingo, whatever...



setting, frame, stage, neighborhood, gestalt?

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part


Re: [PATCH] Add .trim method

2009-01-13 Thread Brandon S. Allbery KF8NH

On 2009 Jan 12, at 15:17, Ovid wrote:



בָּרוּךְ שֵׁם כְּבוֹד מַלְכוּתוֹ  
לְעוֹלָם וָעֶד.


If you can't see that in your client, that's Hebrew from http://www.i18nguy.com/unicode/shma.html 
 and means Hear O Israel, the Lord is our God, the Lord is One.


Actually that's the response: blessed be the name of the glory of His  
kingdom for ever and ever (and your guess is as good as anyone else's  
as to the actual meaning of that :)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




Re: r24769 - docs/Perl6/Spec

2009-01-05 Thread Brandon S. Allbery KF8NH

On 2009 Jan 5, at 11:54, pugs-comm...@feather.perl6.nl wrote:

+ our Str multi method perl (Object $o)
+
+Returns a perlish representation of the object, so that calling  
Ceval

+on the returned string reproduces the object as good as possible.


My inner English teacher cringes in pain.  It should be accurately,  
or possibly completely; good just doesn't fit there.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




Re: use semantics

2009-01-04 Thread Brandon S. Allbery KF8NH

On 2009 Jan 4, at 8:53, Carl Mäsak wrote:

Now, I can precompile the B module to PIR without a problem, but when
I compile the A module, Rakudo/Parrot aborts because it runs the code
in B and dies.

$ parrot languages/perl6/perl6.pbc --target=pir --output=B.pir B.pm

$ parrot languages/perl6/perl6.pbc --target=pir --output=A.pir A.pm
Remember, remember, the fifth of November
current instr.: 'die' pc 14950 (src/builtins/control.pir:204)
[...]

Just wondering if this is reasonable behaviour. It does confuse me a  
bit.



I believe you'll find perl5 does the same thing.  Point of use is to  
load potentially syntax/semantics-changing stuff when it will work;  
for active code you want a runtime load instead.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




Re: Recommended Perl 6 best practices?

2008-12-20 Thread Brandon S. Allbery KF8NH

On 2008 Dec 20, at 13:39, Carl Mäsak wrote:

Maybe this counts as a best practice, or maybe it's more of a
pattern. In a recent piece of code, I found a way to exploit code
blocks to act like return statements with side effects. The
resulting code became very clean, so I decided to blog about the way
it works.



Hm, couldn't you also do that with a sub that explicitly throws a  
return exception to the caller Routine?


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




Re: 6PAN idea

2008-12-16 Thread Brandon S. Allbery KF8NH

On 2008 Dec 16, at 23:00, Timothy S. Nelson wrote:
	One thing I've been working on recently is a (Perl 5) object that  
models package metadata.  In theory, it should be able to model the  
metadata from a .rpm, a .deb, a CPAN package, or whatever.  Then you  
read the data using a metadata input class, and write it using a  
metadata output class. This would mean that eg. CPAN metadata  
could be turned into RPM metadata, but also vice versa.  Debian  
would naturally be convertible into either of these.


	The model isn't CPAN-specific, but relying on such a setup would  
save work for everyone.


Thoughts?



You might want to look at alien first, to get an idea of what can be  
done --- and what can't.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




Re: Roles and IO?

2008-12-11 Thread Brandon S. Allbery KF8NH

On 2008 Dec 11, at 20:16, Leon Timmermans wrote:

One main problem with filehandles is that are rather diverse. The only
operation that all of them have in common is close. Reading versus


Be glad Xenix is dead.  There were filehandles which didn't even  
support close() (they were actually handles for shared memory and  
semaphores).


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




Re: Files, Directories, Resources, Operating Systems

2008-12-09 Thread Brandon S. Allbery KF8NH

On 2008 Dec 9, at 19:56, Aristotle Pagaltzis wrote:

* Aristotle Pagaltzis [EMAIL PROTECTED] [2008-12-10 01:10]:

Well go on.


Btw, I just realised that it can be read as sarcastic, which I
didn’t intend. I am honestly curious, even if skeptical. I am
biased, but I am open to be convinced.



BTW you can run into this issue even only considering Unix/POSIX:   
POSIX ACLs, AFS, NFSv4.


I can see the point of a very simple base API with system-dependent  
extensions, but am likewise skeptical that one can be designed that  
isn't useless.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: Files, Directories, Resources, Operating Systems

2008-12-09 Thread Brandon S. Allbery KF8NH

On 2008 Dec 9, at 21:11, Charles Bailey wrote:

It may well be that a fine-grained interface isn't practical, but
perhaps there are some basics that we could implement, such as

- set owner of this thing
- (maybe) set group of this thing


Group is problematic; I don't recall Windows having group ownership  
(as distinct from group ACLs), and AFS PTS groups are very different  
from Unix groups.


As I said, I'm all in favor of such an API, just skeptical that a  
useful one can be devised.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: S16: chown, chmod

2008-11-24 Thread Brandon S. Allbery KF8NH

On 2008 Nov 24, at 10:36, dpuu wrote:

On Nov 23, 3:56 pm, [EMAIL PROTECTED] (Brandon S. Allbery KF8NH)
wrote:

I think you're seeing something other than what we are.  Checking any
external resource before operating on it introduces a race condition
which can allow an attacker to swap resources on you, so the item you
(in this case) chown() isn't the one you tested.


If the chown is restricted then it's going to fail anyway, assuming
that the underlying Unix function fails. If chown can succeed
incorrectly then there's nothing that P6 can do to prevent that. My


Still misunderstanding, I think.  Yes, it will fail anyway, but in the  
general case you're checking to see if as a privileged process it is  
safe to operate on a given file.  In such case the correct thing to do  
is relinquish privilege and then simply do the operation, trapping any  
error --- not testing and then doing it.


(I grant this isn't quite the same thing --- unless you're trying to  
decide if your root process should chown() a file on behalf of an  
unprivileged process.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: S16: chown, chmod

2008-11-24 Thread Brandon S. Allbery KF8NH

On 2008 Nov 24, at 10:45, dpuu wrote:

PS. From S16, q{ ...  On POSIX systems, you can detect this condition
this way:
   use POSIX qw(sysconf _PC_CHOWN_RESTRICTED);
   $can_chown_giveaway = not sysconf(_PC_CHOWN_RESTRICTED);
}

From this I inferred that the purpose of this assignment was to do a
check -- I apologize if I misinterpreted it -- and would suggest that
we should either get rid of that text, or else reword to suggest not
using it in bad ways.


The latter, I think; it can be useful to know whether the system  
permits or not (although you also need to use pathconf() to check if  
the filesystem in question allows it or not), but using it as a  
*security* check is a bad idea.  OTOH Perl has historically not said  
much about doing that kind of thing.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: S16: chown, chmod

2008-11-23 Thread Brandon S. Allbery KF8NH

On 2008 Nov 23, at 18:35, dpuu wrote:

On Nov 23, 2:33 pm, [EMAIL PROTECTED] (Aristotle Pagaltzis) wrote:

The API you propose does not seem to me to shorten code at all
and is likely to lead to problematic code, so it seems like a
bad idea. Interfaces should be designed to encourage people to
do things correctly and to make it hard to even think about the
nearly certainly wrong way.


I'm going to both agree and disagree. I agree that the specific
example of chown.is_restricted is a bad idea, but only because the
POSIX API I was wrapping is itself flawed. In general I would continue


I think you're seeing something other than what we are.  Checking any  
external resource before operating on it introduces a race condition  
which can allow an attacker to swap resources on you, so the item you  
(in this case) chown() isn't the one you tested.  (In this case, if  
you're chown()ing to root, an attacker might substitute a shell for  
the file you tested.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: S16: chown, chmod

2008-11-22 Thread Brandon S. Allbery KF8NH

On 2008 Nov 21, at 13:20, Larry Wall wrote:

On Fri, Nov 21, 2008 at 09:57:30AM -0800, dpuu wrote:
: On Nov 21, 9:16 am, [EMAIL PROTECTED] (Larry Wall) wrote:
:  Please feel free to whack on the spec
: The definition of Cchown includes the statement that it's not
: available on most system unless you're superuser; and this can be
: checked using a POSIX incantation. I was wondering if it would be
: reasonable to provide this as a method on the chown function, so  
that


This won't work; _PC_CHOWN_RESTRICTED is per filesystem.   
(_POSIX_CHOWN_RESTRICTED is global but insufficient.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: S16: chown, chmod

2008-11-22 Thread Brandon S. Allbery KF8NH

On 2008 Nov 21, at 14:13, Dave Whipp wrote:
The restriction of chown to the superuser is a property of the OS,  
not the files. The example from the pod is:


man pathconf

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: MAIN conflict in S06?

2008-11-14 Thread Brandon S. Allbery KF8NH

On 2008 Nov 14, at 12:14, Larry Wall wrote:

On Thu, Nov 13, 2008 at 07:19:31PM -0600, Patrick R. Michaud wrote:
: S06:2362 says:
:
: You can get the current routine name by calling C? 
ROUTINE.name.
: (The outermost routine at a file-scoped compilation unit is  
always

: named CMAIN in the file's package.)
:
: Is this the same MAIN that is described later in
: Declaring a MAIN subroutine?  It seems like that
: section describes MAIN subroutines that are lexically
: nested within the mainline code of the outermost
: file-scoped compilation unit, and it seems a little
: confusing if both are called MAIN.
:
: I'm guessing that the statement at S06:2362 is an artifact of
: an earlier draft that didn't have the section on MAIN subroutines,
: but I'm wanting to verify that this is the case (or seek further
: clarification if it isn't).

That's correct.  We could fix it two ways.  Either the mainline code
gets a consistent new name, or the outermost scope is redefined to  
an INIT

if there is a user-defined MAIN.  I can argue it both ways.



WHat *is* the outermost scope in that case?  When is code in that  
scope executed?  I could see this as being a hack to allow a module to  
be used either directly as a main, or used; the former ignoring top  
level scope code, the latter ignoring MAIN.  I think Python has  
something similar.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: File test ops as string methods

2008-11-07 Thread Brandon S. Allbery KF8NH

On 2008 Nov 7, at 17:49, Mark J. Reed wrote:

I'm sure this has been hashed out somewhere I wasn't looking, but i
would really prefer for pathname ops not to be mixed in to the Str
class.  Maybe they could be put in a Pathname subclass of Str, with a
simple literal syntax or short unary operator to build such a thing
from a string?



I'm inclined to agree that Str is the wrong place for them.  I could  
see Str being autoconverted to some kind of File class which had them,  
though.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: XPath grammars (Was: Re: globs and trees in Perl6)

2008-10-02 Thread Brandon S. Allbery KF8NH

On Oct 2, 2008, at 10:36 , Timothy S. Nelson wrote:

On Thu, 2 Oct 2008, Timothy S. Nelson wrote:
	Now that Perl6 is in the mix, though, I think that the best way to  
do it is to make roles that model eg. Nodes, Plexes (Documents),  
Elements, and the like, and then have operators on them do all the  
work (like my idea of using a slash for a combined feed and call  
code operator).  I could be wrong, but it seems to me that we could  
get something that's somewhat like XPath this way, without having  
to worry about defining an XPath grammar or anything.


	I'm talking to myself here :).  The guys on IRC convinced me that  
the way to go might be something like a grammar, but that does trees  
and tree transformations instead of a text input stream.  See the  
IRC log for details :).


I'm trying to find Trey to get his example, but I was under the pretty  
strong impression that rules could be treated as higher level entities  
in a pattern, thus allowing you to e.g. drill down into an XML  
document without needing to specify explicit paths.  WHich is what I  
recall his example doing,


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: globs and trees in Perl6

2008-10-01 Thread Brandon S. Allbery KF8NH

On 2008 Oct 1, at 22:14, Timothy S. Nelson wrote:
	Hi all.  I've enjoyed(?) reading over the February/March thread  
entitled Musings on operator overloading.  I've brought a few  
thoughts along; if they're old news, please tell me

here to do more reading on it :).


The Perl6 way to do this is grammars; using an XML grammar to pull  
data out of an XML document is one of Larry's favorite examples.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: globs and trees in Perl6

2008-10-01 Thread Brandon S. Allbery KF8NH

On 2008 Oct 1, at 22:23, Timothy S. Nelson wrote:

On Wed, 1 Oct 2008, Brandon S. Allbery KF8NH wrote:

On 2008 Oct 1, at 22:14, Timothy S. Nelson wrote:
	Hi all.  I've enjoyed(?) reading over the February/March thread  
entitled Musings on operator overloading.  I've brought a few  
thoughts along; if they're old news, please tell me

here to do more reading on it :).


The Perl6 way to do this is grammars; using an XML grammar to pull  
data out of an XML document is one of Larry's favorite examples.


	Ok, great.  While I see how this does a great job of converting the  
string of data into a plex, it doesn't solve the problem of  
selecting the data from the plex in a glob-like (or XPath-like)  
fashion, which is what I'm talking about here.  Have I missed  
something that will do that?



I could have sworn there was a short and elegant example of using a  
grammar to extract arbitrary information from an XML document, but I  
don't see it in the documentation.  I recall Trey Harris showing such  
an example on IRC but not in a logged channel; maybe he'll see this  
message and jump in, or if not I'll see if I can get him to write  
another example.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: Why no is ro? (Re: Subroutine parameter with trait and default.)

2008-09-24 Thread Brandon S. Allbery KF8NH

On 2008 Sep 24, at 17:45, David Green wrote:

On 2008-Sep-23, at 5:27 pm, Michael G Schwern wrote:

David Green wrote:
Happily, brevity often aids clarity.  The rest of the time, it  
should be up to one's editor; any editor worth its salt ought to  
easily auto-complete ro into readonly.


Eeep!  The your IDE should write your verbose code for you  
argument!  For that one, I brine and roast an adorable hamster.


Fair enough.  As long as you remember to share with the rest of us!!


I would argue that if you need your editor to expand verbose language  
constructs to make the language usable or to express common idioms,  
then the language has a design deficiency.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: adverbial form of Pairs notation question

2008-09-06 Thread Brandon S. Allbery KF8NH

On 2008 Sep 6, at 13:57, Larry Wall wrote:

But basically I think NIL is a mild form of failure anyway, so it's
fine with me if () is a form of failure that is smart enough to be


I'm thinking () is the non-scalar (list, array, capture, maybe hash)  
version of undef, which acts like a value unless you have warnings  
turned on; and undef is managed as a kind of unthrown exception  
already, thus so should ().


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: Allowing '-' in identifiers: what's the motivation?

2008-08-12 Thread Brandon S. Allbery KF8NH


On 2008 Aug 12, at 20:39, Austin Hastings wrote:

Actually, I proposed some years ago allowing separable verbs --  
function/method/operator names with spaces in them, that could in  
fact bracket or intersperse themselves with other parameters.


This would be a way of writing if ... elsif ... else ... for  
example.


If you can define circumfix operators, and an operator can be a word  
token, then we already have this, I'd think.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: List of captures, why?

2008-08-09 Thread Brandon S. Allbery KF8NH


On 2008 Aug 8, at 23:12, John M. Dlugosz wrote:


Brandon S. Allbery KF8NH allbery-at-ece.cmu.edu |Perl 6| wrote:

On 2008 Aug 8, at 23:06, John M. Dlugosz wrote:

Why is 3;3;3 a list of captures rather than a list of lists?
IIRC it has to do with providing enough information for slices and/ 
or * to work in multiple dimensions.

So how does a * work in multiple dimensions?



Grah.  There was a discussion about multidimensional arrays which  
culminated in the decision to make array indices captures, but I can't  
find it now.  IIRC the issue was that a list of multidimensional array  
indices might only be resolveable at runtime, so there had to be a way  
to preserve Whatevers (aka *), so they had to be captures because  
anything else would resolve the Whatevers too early.


Hopefully someone with a clearer memory than me (damn drugs...) will  
remember what this was about and clarify (or explain where I went  
wrong).


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




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

2008-08-08 Thread Brandon S. Allbery KF8NH


On 2008 Aug 8, at 10:59, [EMAIL PROTECTED] wrote:


Modified: doc/trunk/design/syn/S06.pod
=
=
=
=
=
=
=
=
==
--- doc/trunk/design/syn/S06.pod(original)
+++ doc/trunk/design/syn/S06.podFri Aug  8 07:59:12 2008
@@ -2490,10 +2490,10 @@
=head2 Quasiquoting

In aid of returning syntax tree, Perl provides a quasiquoting
-mechanism using the quote Cq:code, followed by a block intended to
+mechanism using the quote Cquasi, followed by a block intended to
represent an AST:

-return q:code { say foo };
+return quasi { say foo };

Modifiers to the C:code adverb can modify the operation:


Is that last now the quasi adjective?

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: Quick question: (...) vs [...]

2008-08-08 Thread Brandon S. Allbery KF8NH


On 2008 Aug 8, at 22:53, John M. Dlugosz wrote:


What is the difference between (1,2,3) and [1,2,3] ?



IIRC one is a list, the other a reference to a list --- which in perl6  
will be hidden for the most part. so practically speaking the  
difference is minimal.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: Code-only forms?

2008-08-02 Thread Brandon S. Allbery KF8NH


On 2008 Aug 2, at 12:57, Larry Wall wrote:


On Thu, Jul 31, 2008 at 05:56:14AM -0500, John M. Dlugosz wrote:

In S04, Other similar Code-only forms ...
What does that mean?


It is feebly attempting to say that, because these are control flow
functions, the argument is really a thunk that the function has
control of when and how it's executed, much like in the constructs:

   $x  thunk
   $x || thunk
   $x ?? thunk !! thunk


Haskell demonstrates that this is simply lazy application.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




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

2008-07-16 Thread Brandon S. Allbery KF8NH

Minor typo:

On 2008 Jul 16, at 15:56, [EMAIL PROTECTED] wrote:


+(again, conceptually at the entry to the outer lexical scope, but
+possible deferred.)

sub foo {


possibly

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




Re: Complex planes

2008-07-16 Thread Brandon S. Allbery KF8NH


On 2008 Jul 16, at 18:48, Jon Lang wrote:


Moritz Lenz wrote:

Principle of least surprise:

Suppose sqrt(1) returns any(1, -1):
if sqrt($x)  0.5 { do something }

I can see the big, fat WTF written in the face of programmer who  
tries
to debug that code, and doesn't know about junctions. It just won't  
DTRT.


This is closely related to my original point.  In particular, if
you're unwilling to have sqrt return junctions of distinct values, you
don't really want to mess with junctions of a single complex value on
different planes, either.


I suggest that the base library not bother with any of this; if  
someone wants it they can load a FullComplex module or something like  
that.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH




  1   2   >