Re: Meditations on a Loop

2009-05-25 Thread yary
That's an enjoyable and educational read, thanks! There's one form under TMTOWTDI that I'd like to see, but can't figure out myself. It's the version analogous to this perl5 snippet- sub odd {$_ % 2} say grep odd,0..6; -where the line that filters the list mentions no variables at all, and "

Re: Meditations on a Loop

2009-05-26 Thread yary
On Tue, May 26, 2009 at 1:57 PM, Patrick R. Michaud wrote: > On Mon, May 25, 2009 at 12:37:34PM -0700, yary wrote: > How about...? > >    sub odd { ^$a % 2 } typo. "sub odd {$^a % 2}" works (caret goes between "$" and "a") >    say grep &odd, 0.

Re: Unexpected behaviour with @foo.elems

2009-05-26 Thread yary
I'm a relative beginner at perl6, but pretty good with perl5 (and C and a few others), so I read "for 0...@foo.elems" as saying "Give me a list with one item longer then @foo", not "give me the indexes of @foo". I can see users being tripped up by the old problem of "we start counting at 0 and not

Re: Unexpected behaviour with @foo.elems

2009-05-27 Thread yary
> Is it still a global in Perl 6? It's not even global in perl5.10. perldoc says: As of release 5 of Perl, assignment to $[ is treated as a compiler directive, and cannot influence the behavior of any other file. (That's why you can only

Re: The game of life

2009-05-28 Thread yary
If anyone wants to try tackling this, a longer APL one-liner is referenced on the APL wikipedia page and discussed in length here: http://catpad.net/michael/apl/ As an aside, APL was the first computer language I was exposed to. When I was around 7 years old my aunt (who lived in Boston near MIT,

Re: The game of life

2009-05-28 Thread yary
And a link explaining the shorter one-liner: http://aplwiki.com/GameOfLife

Re: Amazing Perl 6

2009-05-29 Thread yary
Back to the question of "cool things about perl6"- after showing some of the extended syntax and its expressiveness, put up a slide saying "it's still Perl". Show that much of the basics still work: > my @x=('a' .. 'z'); @x[3,4]=qw(DeeDee Ramone); say @x.splice(2,4).join(',') c,DeeDee,Ramone,f

Re: The game of life

2009-05-30 Thread yary
On Thu, May 28, 2009 at 5:58 PM, John M. Dlugosz <2nb81l...@sneakemail.com> wrote: > I came upon a copy of "A Programming Language" in a similar way.  My Dad > passed it on from a co-worker.  I don't recall how young I was, but it was a > very interesting read.  Perhaps this attracts youngsters bec

Anonymous multidimensional array

2009-06-01 Thread yary
How does one create an anonymous multidimensional array in p6? Not an array of arrays or a capture of captures... I'm guessing it involves Array.new(:shape) or something like :shape(2;2), and that it's not yet implemented in Rakudo. Is anonymous multidimensional array creation covered in the synop

Re: Anonymous multidimensional array

2009-06-02 Thread yary
On Mon, Jun 1, 2009 at 10:43 PM, John M. Dlugosz > And it should be an error if dimensions other than the highest are > unspecified.  How can it know how to shape it?  Use an explicit command to > shape up the argument in that case. I don't see why shape(2;*) is not a problem and shape(*;2) is a p

Re: Anonymous multidimensional array

2009-06-02 Thread yary
I haven't gotten deep into the shape/array specs and I need to... nonetheless On Tue, Jun 2, 2009 at 9:55 AM, Larry Wall wrote: > I don't see why we shouldn't use the capture shape of the value > by default all the time, and do linear reshaping only if the value > comes in as a flat list. This h

S03- Unicode feed operator, no prefix:<=>

2009-06-10 Thread yary
I'm about halfway through reading Synopsis 3 and have a couple comments/questions. Is there, should there be unicode synonyms for the feed operators? eg <== is also ⇐ ⇐LEFTWARDS DOUBLE ARROW ==> is also ⇒ ⇒RIGHTWARDS DOUBLE ARROW I don't see as obvious candidates for <<== and ==>>, maybe

Array rotate

2009-06-12 Thread yary
I am tickled pink to see an Array "rotate" method in the settings spec S032, as I was thinking of writing up a little discussion on the very topic. Has there been discussion on using array rotate on multi-dimensional arrays? Being able to pass in a vector as the amount to rotate would be useful. e

Multi-d array transforms (was Re: Array rotate)

2009-06-12 Thread yary
Putting this in a new thread, as I'd like to discuss it separately from refinements to Array.rotate On Fri, Jun 12, 2009 at 10:11 AM, Jon Lang wrote: > With a multi-dimensional array, a number of transforms can be considered: > > * you can rearrange the elements along a given dimension (e.g., rota

Re: Multi-d array transforms (was Re: Array rotate)

2009-06-12 Thread yary
I think any 1D op could be transformed to "do the right thing" on a multidimensional array, with some sort or hyperop or reduction transform. Rotate, reverse, even add/subtract can be told "do your thing along this vector" and return a usefully dimensioned result. Need to work on other things at t

Re: Array Dimensionality

2009-06-18 Thread yary
I think this proposal goes to far in the dwimmery direction- On Sat, Jun 13, 2009 at 12:58 PM, John M. Dlugosz<2nb81l...@sneakemail.com> wrote: > Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: >> >> So, how do I deal with a multidim array? Well, TIMTOWTDI... >> >> my @a = 1,[2,[3,4]]; >> say @

Re: Array Dimensionality

2009-06-18 Thread yary
Apologies for the long post with mistakes in it. I'm going to try again, biting off less. my @g[2;2]; @g[0;0]='r0c0'; @g[0;1]='r0c1'; @g[1;0]='r1c0'; @g[1;1]='r1c1'; @g[1] is due to S09: Multi-dimensional arrays, on the other hand, know how to handle a multidimensional slice, with one subslice

Re: XOR does not work that way.

2009-06-22 Thread yary
I had a bit of a problem when first encountering xor with more than two operands as well. It made sense after I thought about it linguistically instead of mathematically. When speaking people often use a string of "or"s to mean "pick one and only one of these choices, the the exclusion of all other

Re: Signature for the series operator

2009-06-26 Thread yary
S02 says- Anywhere you can use a single type you can use a set of types, for convenience specifiable as if it were an "or" junction: my Int|Str $error = $val; # can assign if $val~~Int or $val~~Str so would sub infix:<...>(Array|Scalar $values, Code $generator) be kosher? I'm w

Re: XOR does not work that way.

2009-07-02 Thread yary
On Thu, Jul 2, 2009 at 8:58 AM, TSa wrote: >... unless list associative operators somehow flatten the > parens away and therefore see a single list of three values instead of > two consecutive lists of two items. that's exactly what list associative does, it feeds an arbitrarily long list of value

Re: XOR does not work that way.

2009-07-02 Thread yary
On Thu, Jul 2, 2009 at 9:01 AM, yary wrote: > On Thu, Jul 2, 2009 at 8:58 AM, TSa wrote: >>... unless list associative operators somehow flatten the >> parens away and therefore see a single list of three values instead of >> two consecutive lists of two items. > &g

Re: Is there a way to bulky feed?

2009-07-09 Thread yary
On Wed, Jul 8, 2009 at 8:45 PM, Xiao Yafeng wrote: > Any thoughts? > First let's fix the whitespace in your post so it's easier to read- My question is: could I write below code in perl6: # 2 loops like for @a -> $b[0],$b[1] {;} my @a = <1 2 3 4>; my @b[2]; for @a ->@b {;} my @a = <1 2 3 4>;

Re: Is there a way to bulky feed?

2009-07-10 Thread yary
I understand now. Given a large list, you'd like to assign chunks of the list to an array, easily, while looping. In other words, you're looking for a way to abbreviate this: my $chunk_size=10_000; my @big=''..'mnop'; for ^...@big :by $chunk_size { my @chu...@big[$_..($_+$chunk_size,@big.end

Re: Huffman's Log: svndate r27485

2009-07-10 Thread yary
+1 on using ln() instead of log() Also, systems I know of that implement both log() and ln() default ln() with base e, as perl6 does, log() uses base 10.

Re: Parameter binding

2009-07-25 Thread yary
On Sat, Jul 25, 2009 at 2:04 PM, Patrick R. Michaud wrote: > On Thu, Jul 23, 2009 at 05:56:31PM +0200, TSa wrote: >> Hmm, it seems to be the case that the binding is defined to be a >> readonly binding to the variable. I consider this a bad thing. >> We should have my $x = 1; foo($x++,$x,$x++); to

Re: r28196 - docs/Perl6/Spec

2009-09-07 Thread yary
This spec subtly alters the meaning of "...". Whereas "yada" used to mean "this is not yet implemented, complain if executed" it now adds "but don't complain if it is a class fully implemented elsewhere". Allowing two implementations of a class iff one of them has a yada opens up maintenance issue

Re: r28196 - docs/Perl6/Spec

2009-09-07 Thread yary
or example: > > class Rat { ... }; I can agree with that so long as the "yada" is the only token inside the brackets. On the other hand why not go along with C convention and allow class Rat; to pre-declare a class, or p5 convention use class 'Rat'; -y On Mon,

Re: Cobra & Ioke Programming Languages

2009-09-16 Thread yary
Perl is being actively developed for the Parrot VM. LLVM is another interesting option and if someone or some group would like to take it on, it would be a welcome alternate implementation. What parts in particular of Cobra and ioke look useful to you? Looking at Cobra's intro slide- * Cobra is a

Re: Cobra & Ioke Programming Languages

2009-09-16 Thread yary
This is an interesting subpage under Cobra- http://cobra-language.com/docs/quality/ it actually bears a little on recent discussions about self-documenting code. I'm a Perl6 beginner so I'm making comments with expectation that others will correct where I'm wrong * Doc Strings Perl6's vision of "

Re: S26 - The Next Generation

2009-09-17 Thread yary
On Thu, Sep 17, 2009 at 1:05 AM, Damian Conway wrote: > Aaron Sherman asked: ... >> I'd very much like to establish that at default optimization levels for >> execution, this information is not guaranteed to be maintained past the >> creation of the AST. > > Unfortunately, it is. Perl 6 defines th

Re: Cobra & Ioke Programming Languages

2009-09-17 Thread yary
Matthew Walton wrote >Yes, Perl 6 does - it is not backwards compatible with Perl 5. That so? I thought Perl6 was supposed to recognize and execute perl5 code. That statement itself implies that perl6 and perl5 are different languages, and I'm not too interested in arguing over semantics. I am cur

Re: generality of Range

2009-10-04 Thread yary
I'm confused between using ranges to generate a lazy list and using them as criteria to match against. These exclude continuous (non-countable) types- ... > 2. There must be a successor function, so that given an object from > the given domain, say a, successor(a) returns one and only one >

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

2009-10-12 Thread yary
... > Also, the domain should define how to compare objects and could provide > details about whether the set is finite, countable or uncountable. ... Sounds like a role "Domain" that provides methods (off the top of my head)- ordering - returns Nil if the domain is unordered, or a method impleme

Re: Language status

2009-12-10 Thread yary
> I'm looking forward to Perl 6, and I'm looking into the spec right > now, since that to me is the important bit of a language (I know, > I'm bizarre). Not at all bizarre, P6 language spec development is the most important bit going on in the language right now. Well, that plus all the interestin

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

2009-12-11 Thread yary
On Fri, Dec 11, 2009 at 12:31 PM, wrote: ... > -It is a compiler error to use a bare C without arguments. > +The compiler will warn you if use a bare C without arguments. >  (However, it's fine if you have an explicit argument list that evaluates to >  the empty list at runtime.) > > +    print;

Re: Comments on S32/Numeric#Complex

2009-12-16 Thread yary
> 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? -y

Re: Custom errors on subsets?

2010-01-04 Thread yary
On Mon, Jan 4, 2010 at 5:15 AM, Ovid wrote: > Given this code: > >subset Filename of Str where { $_ ~~ :f }; > >sub foo (Filename $name) { >say "Houston, we have a filename: $name"; >} ... > Obviously the error message can use some work, but how would I customize that > error

Re: One-pass parsing and forward type references

2010-02-01 Thread yary
A slight digression on a point of fact- On Mon, Feb 1, 2010 at 9:32 AM, Larry Wall wrote: ... > You are correct that the one-pass parsing is non-negotiable; this is > how humans think, even when dealing with unknown names. It's common for people to read a passage twice when encountering somethin

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

2010-04-07 Thread yary
2010/4/6 Larry Wall : >    Set(Read | Write)   # bogus, R|W is really 3 sets, R, W, and RW! >    Set(Read & Write)   # okay, can only represent RW Set(A | B) doesn't seem so bogus to me, if what you want is the power set- not the original posters intent, but reasonable in other contexts. Though it

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

2010-04-08 Thread yary
On Thu, Apr 8, 2010 at 2:31 PM, wrote: > +month (for example April 31st) or in that non-leap year (for example February > +29th 1996). 1996 *was* a leap year! Use 2006 (or 2010, or... etc) if you want a Feb with 28 days.

Re: Temporal.pod truncate

2010-04-09 Thread yary
On Thu, Apr 8, 2010 at 7:26 PM, Mark J. Reed wrote: > I think that :to should stay as-is; it truncates to whatever the .week > method returns, and that's Monday-based. It would be too inconsistent for it > to do anything else.   Asking for the latest prior Sunday or any other > weekday is a useful

Re: underscores vs hyphens (was Re: A new era for Temporal)

2010-04-10 Thread yary
On Sat, Apr 10, 2010 at 4:53 PM, John Siracusa wrote: > I'm not sure if the intersection of people who speak English and > people who program is better or worse than average when it comes to > grammar, but I do know (from editing my share of writing) that the > average is very bad and, further, th

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

2010-04-12 Thread yary
Tangentially, I'm a little surprised there isn't a random stream factory in the core. They're useful for reproducible testing. With a global random number generator, even if you seed it, another module can call "rand" and alter the sequence you get from your "rand" calls. I think something like "sr

Re: Temporal.pod truncate

2010-04-13 Thread yary
=== indeed truncating to any day of the week can be implemented by user trivially by adding/subtracting a constant number of days from the Monday returned. No, it's not a constant. $sun = DateTime.new('2010-04-11').trunc( :to ) # 2010-04-11 $mon = DateTime.new('2010-04-11').trunc(

Re: r31054 -[S03] suggestions from dataweaver++

2010-06-02 Thread yary
And while we're at it with expanding examples, can we use string concatenation instead of addition? It makes following what's happening easier. eg, +1 on that prior post. -y

Re: Perl 6 in non-English languages

2010-06-23 Thread yary
If Perl 5 can support Lingua::Romana::Perligataand let you type " benedictum factori sic mori cis classum. instead of bless sub{die}, $class; then Perl 6 should be able to do it even better. I think it would be implemented thro

Re: Perl 6 in non-English languages

2010-06-24 Thread yary
Reminds me of an article of yore from The Perl Journal "Localizing Your Perl Programs" http://interglacial.com/tpj/13/ which discusses the reasoning behind Locale::Maketext the point of which is that the "values" you're looking up should be able to be functions, to handle some edge cases where not

Re: Filesystems and files [Was: Re: The obligation of free stuff: Google Storage]

2010-06-30 Thread yary
Sounds like a sound generalization to make. On Wed, Jun 30, 2010 at 1:29 AM, Richard Hainsworth wrote: > This then means that there is an implicit > $*FS.connect(); > that makes the local system available to the program. "mount" is the jargon to make a filesystem available, looking backwards, t

Re: r31630 -S02 : add initial formats for Blob (or Buf) literals

2010-07-12 Thread yary
On Sun, Jul 11, 2010 at 6:11 PM, Darren Duncan wrote: ... > > There is also still the need to cover something that looks like a list of > integers, for the general case of a Blob/Buf literal, and yet it should have > an appearance more like that of a scalar/number/string/etc than of an > array/etc

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

2010-07-15 Thread yary
On Thu, Jul 15, 2010 at 9:21 AM, Mark J. Reed wrote: > By analogy, I'd say week-of-year should work as well. Oof, is there a generally accepted for numbering weeks within a year? A month's boundaries' always coincides with a day's boundary, but a year only occasionally begins/ends on a week bound

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

2010-07-15 Thread yary
On Thu, Jul 15, 2010 at 2:13 PM, Brandon S Allbery KF8NH wrote: > -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 > d

Re: Suggested magic for "a" .. "b"

2010-07-16 Thread yary
On Fri, Jul 16, 2010 at 9:40 AM, Aaron Sherman wrote: > For example: > > "Ab" .. "Be" > > defines the ranges: > > and > > This results in a counting sequence (with the most significant character on > the left) as follows: > > > > Currently, Rakudo produces this: > > "Ab", "Ac", "Ad", "Ae", "Af"

Re: multi-character ranges

2010-07-21 Thread yary
On Wed, Jul 21, 2010 at 3:47 PM, Jon Lang wrote: > ... When comparing two strings, establishing an order between them is > generally straightforward as long as both are composed of letters from > the same alphabet and with the same case; but once you start mixing > cases, introducing non-alphabet

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread yary
On Wed, Jul 28, 2010 at 8:34 AM, Dave Whipp wrote: > To squint at this slightly, in the context that we already have 0...1e10 as > a sequence generator, perhaps the semantics of iterating a range should be > unordered -- that is, > > for 0..10 -> $x { ... } > > is treated as > > for (0...10).pic

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread yary
> Swapping the endpoints could mean swapping inside test to outside > test. The only thing that is needed is to swap from && to ||: > > $a .. $b # means $a <= $_ && $_ <= $b if $a < $b > $b .. $a # means $b <= $_ || $_ <= $a if $a < $b I think that's what "not", "!" are for!

Re: Suggested magic for "a" .. "b"

2010-07-28 Thread yary
On Wed, Jul 28, 2010 at 2:29 PM, Aaron Sherman wrote: > > The more I look at this, the more I think ".." and "..." are reversed. ".." > has a very specific and narrow usage (comparing ranges) and "..." is > probably going to be the most broadly used operator in the language outside > of quotes, co

Re: Suggested magic for "a" .. "b"

2010-07-29 Thread yary
On Thu, Jul 29, 2010 at 5:15 AM, Leon Timmermans wrote: > On Thu, Jul 29, 2010 at 3:24 AM, Darren Duncan > wrote: >> Some possible examples of customization: >> >> $foo ~~ $a..$b :QuuxNationality # just affects this one test > > I like that > >> $bar = 'hello' :QuuxNationality # applies anyw

Re: Array membership test?

2010-07-29 Thread yary
On Thu, Jul 29, 2010 at 4:46 PM, Mark J. Reed wrote: > $x ~~ any(@array) I think this came up recently, and that's the way! -y

Re: Array membership test?

2010-07-30 Thread yary
On Fri, Jul 30, 2010 at 2:22 PM, Aaron Sherman wrote: > If you really want odd, try: > >  say [1,2,3].first: * === True; > Result: 1 > > and > >  say [5,2,3].first: * === True; > Result: Rakudo exits silently with no newline Looks like a side effect of True being implemented as an enum with value

Re: Natural Language and Perl 6

2010-08-02 Thread yary
This is getting more and more off topic, but if you want some lojban pasers, start at http://www.lojban.org/tiki/tiki-index.php?page=Dictionaries,+Glossers+and+parsers -y On Mon, Aug 2, 2010 at 3:58 PM, Carl Mäsak wrote: > Jason (>): >> No specific tool is best suited for natural language pro

Re: 8ecf53: [Containers] split pick into pick and roll

2010-09-16 Thread yary
> The last added paragraph says (emphasis mine): > > +The default metaphor for _picking_ is that you're pulling colored > +marbles out a bag and then putting them back. (For "picking without > replacement" see C instead.) > +Rolling requires no temporary state. > > This is confusing to me. It is su

Re: Tweaking junctions

2010-10-23 Thread yary
In general I like where this is going but need a little hand holding here- I'm not an expert on junctions or anything perl6- > So I'm going to go on to propose that we create a fifth class of > Junction: the "transjunction", with corresponding keyword C. It seems that by these definitions "every"

Lists vs sets

2010-10-25 Thread yary
+1 on this On Mon, Oct 25, 2010 at 4:56 PM, Jon Lang wrote: > As for the bit about sets vs. lists: personally, I'd prefer that there > not be quite as much difference between them as there currently is. > That is, I'd rather sets be usable wherever lists are called for, with > the caveat that ther

multi vars

2010-10-27 Thread yary
>From S12- which I'm just reading due to a blog post from jwrthngtn, I haven't thought this through- --- You can have multiple multi variables of the same name in the same scope, and they all share the same storage location and type. These are declared by one proto declaration at the top, in which

Re: Implementations until Perl 6.0.0 released?

2010-11-27 Thread yary
Roughly speaking, "will TIMTOWTDI apply to the language itself indefinitely?" = yes. Perl 5 is a language defined by an implementation, Perl 6 is a language defined by a syntax and documentation. While there's no predicting what will happen, as of now it looks like there will be a few implementati

Setting private attributes during object build

2012-02-01 Thread yary
I wrote my first perl6 over the weekend, needing some help on #perl6. And now after finishing some lunchtime thoughts I wanted to post here on my main sticking point. If one wants to set a private attribute, one must define a "submethod BUILD". If one wants to use any argument in the constructor o

Re: Setting private attributes during object build

2012-02-01 Thread yary
On Wed, Feb 1, 2012 at 3:24 PM, Jonathan Lang wrote: > Why must we use 'submethod BUILD' instead of 'method BUILD'? > Is it some sort of chicken-and-egg dilemma? from S12: "Submethods are for declaring infrastructural methods that shouldn't be inherited by subclasses, such as initializers ... onl

Re: Setting private attributes during object build

2012-02-01 Thread yary
On Wed, Feb 1, 2012 at 5:41 PM, Carl Mäsak wrote: ... >Getting back to the topic of the original post: I think "blessall" is >a bad name for what's proposed, and I don't see a fantastically large >need for that functionality. What's wrong with just defining a BUILD >submethod in the class? Limiti

Re: Setting private attributes during object build

2012-02-01 Thread yary
Looking back at my paltry code, what I ended up doing was having a BUILD submethod that just listed all my attributes, private and public, and an empty block, essentially turning "bless" into "blessall". Which makes submethod BUILD looks like boilerplate, a magic invocation, repeated in my classes.

Re: Setting private attributes during object build

2012-02-02 Thread yary
but I was mistaken on that point. ~/rakudo $ perl6 > class A{has $.b; has $!c; submethod BUILD(:$b,:$c,:$x){say "b=$b c=$c x=$x"}} > A.new(b=>4,c=>5,x=>6) b=4 c=5 x=6 >If the complaint is that yary wanted to pass positional args to a >constructor, then I have no pr

Re: Setting private attributes during object build

2012-02-02 Thread yary
I think I get this better now. Currently: Default "new" passes its capture (named args) to bless. Bless passes capture (all args) to the default BUILDALL>BUILD. Default BUILD initializes only public attributes. My thought: Default "new" passes only named args matching public attributes to bless.

Re: Not-so-smart matching (was Re: How to make a new operator.)

2012-03-25 Thread yary
I also like "agreement", "conformance"... In a situation like this, I reach for a thesaurus- very useful when looking for just the right name for a variable/method name/way to describe a concept. Here's a grab bag to start with: accord, agree, conformance, conformation, conformity, congruence, con

Re: The .trans method and Least Surprise

2012-07-13 Thread yary
Speaking as a non-p6-coder "proposal sounds good to me" though the spec raises some other questions. >The tr/// quote-like operator now also has a method form called > trans(). Its argument is a list of pairs. You can use anything > that produces a pair list: > > $str.trans( %mapping.pairs );

perl6-language@perl.org

2013-05-06 Thread yary
Typo: "theses operator" -> "these operators" -y On Mon, May 6, 2013 at 10:23 AM, GitHub wrote: > Branch: refs/heads/master > Home: https://github.com/perl6/specs > Commit: 90fffbad2868a1c3b3151c79a805f9834a4902e2 > > https://github.com/perl6/specs/commit/90fffbad2868a1c3b3151c79a8

Re: [perl6/specs] e85286: [S17]: Add references to hyperops, feeds, and junc...

2013-06-06 Thread yary
The commit has a link to a paper about unifying event loops & threads doesn't server the paper anymore. Looks like you can get it at http://www.cis.upenn.edu/~stevez/papers/LZ06b.pdf -y On Thu, Jun 6, 2013 at 3:53 PM, GitHub wrote: > Branch: refs/heads/master > Home: https://github.com/per

Re: Are set operations needed?

2013-07-18 Thread yary
And regardless of homotopy type theory being able to supplant set theory, with the spirit of "there's more than one way to do it", set ops are still a welcome tool. Also in that spirit, would you like to write up a summary of HoTT alternatives to common set ops, or post a link to a HoTT summarzing

Re: Commensurability as Key

2013-08-20 Thread yary
I'll bite... this concept of "commensurablity" is not one I grasp from your email. "functions are (sugarably) degenerate (many to 1) relations and procedures are (sugarably) degenerate (state-transition) functions." Perl & many other languages don't have a strong distinction between functions & pr

Re: [perl6/specs] 126dd3: Mark ".exists" and ".delete" as deprecated, use ":...

2013-10-01 Thread yary
I suspect there are copy-paste errors on the "delete" sections of the new text: ... the +normal way to test for existence is to apply the C<:delete> adverb to a +subscripting operation. The ":delete" adverb tests for existence? -y On Mon, Sep 30, 2013 at 6:09 AM, GitHub wrote: > Branch: refs

Re: The invocation operators .* and .+

2015-06-17 Thread yary
A couple years ago I wrote a little Perl6 in response to a challenge, and it took me a while to figure out BUILD, BUILDALL, and new(). Learning the object model meant reading what was available on the web plus some time on the #perl6 IRC channel. I managed to get it all working properly for my litt

Re: The invocation operators .* and .+

2015-06-17 Thread yary
On Wed, Jun 17, 2015 at 1:29 PM, Aristotle Pagaltzis wrote: > * yary [2015-06-17 17:10]: >> Perl6's "TEARDOWN" > > Sorry for the confusion. It’s not in Perl 6. I invented .teardown for > this example because I didn’t want to call it .destroy – that’s all. That&#

Re: Language design

2015-06-20 Thread yary
I like the explanation of how Rats solve a class of rounding errors, 0.3 - (0.2 + 0.1) equals exactly 0 for example. On the other hand, it's still a compromise that's shifting closer to correctness, fixing a bunch of potential bugs, but not all in that class: Rakudo: > say 2 - (sqrt 2) ** 2 -4.440

Rationalizing numeric types

2015-06-22 Thread yary
Thinking over my programming career, there were a few occasions I had to spend time working around floating point errors, and it was a nuisance. There were even fewer times when I worked with transcendental numbers- programs dealing with geometry or tones or logarithmic scales- and those times, flo

Re: Types for Perl 6: request for comments

2015-06-24 Thread yary
I'm reading it a bit at a time on lunch break, thanks for sending it along, it's educational. My comments here are all about the example on the top of page 5, starting with the minutest. First a typo, it says "subC" where it should say "sumC" multi sub sumB is ambiguous, due to your use of ";;" t

Anonymous multi-subs

2015-06-24 Thread yary
Now that I've thought about it for 90 seconds (not fully-formed idea), if one were to have an anonymous multi-sub, it ought to be constructed from a list of *signature*, *body *pairs. And/or, any non-finalized sub could have a method to add another *signature, body* to its dispatch list. apologie

Re: Anonymous multi-subs

2015-06-25 Thread yary
On Wed, Jun 24, 2015 at 7:17 PM, Brent Laabs wrote: I'll just note that you can fake anon multi subs with lexical subs like this: my $sub = do { proto foo (|) { * } multi foo (Int $x) { $x + 1 } multi foo (Str $y) { $y ~ 'a' } &foo; } say $sub("hello"); I like that, and I suspe

Re: Types for Perl 6: request for comments

2015-06-27 Thread yary
These two variations on Brent's work the same as the original- what subtle differences happen by adding "anon" or "my" to the declarations? my $sub_anon = do { anon proto foo (|) { * } multi foo (Int $x) { $x + 1 } multi foo (Str $y) { $y ~ 'a' } &foo; } my $sub_my = do { my

Re: Types for Perl 6: request for comments

2015-06-27 Thread yary
The anon does something. For example this code prints "bob" my $routine = proto bar (|) { * }; multi bar (Int $x) { $x - 2 } multi bar (Str $y) { $y ~ 'b' } say $routine('bo'); but change the first line to "my $routine = anon proto bar (|) { * };" and you get an error Cannot call 'bar'; none of

What's the intent of "anon proto"/"anon multi"?

2015-06-30 Thread yary
Rakudo (both "star 201503" & rakudo-moar 7b5256) complains about "anon multi", saying "Cannot use 'anon' with individual multi candidates. Please declare an anon-scoped proto instead" in response to "anon multi foo (Int $x) { $x + 1 };" Given that message, I created an "anon proto foo" and assigne

Re: Types for Perl 6: request for comments

2015-06-30 Thread yary
Section 3.2's example does not fail for the given reason "This tries to access the c instance variable of the argument $b thus yielding a run-time error" - instead Perl6 more correctly complains that it was expecting a ColPoint, but got a Point instead. Indeed one cannot generally replace a subtype

Re: Types for Perl 6: request for comments

2015-06-30 Thread yary
Now that I've read ahead to 3.4, the "multi method solution" shown can be a little simpler, just need to add "multi" to the original "equal" methods, see attached. -y On Tue, Jun 30, 2015 at 4:16 PM, yary wrote: > Section 3.2's example does not fail f

Re: Types for Perl 6: request for comments

2015-07-01 Thread yary
On Wed, Jul 1, 2015 at 6:03 AM, Giuseppe Castagna < g...@pps.univ-paris-diderot.fr> wrote: > On 30/06/15 22:30, yary wrote: > > Now that I've read ahead to 3.4, the "multi method solution" shown can be > a little simpler, just need to add "multi" to t

Re: [perl6/specs] 614b6f: doc with/without

2015-08-10 Thread yary
"with", "without" look awesome. -y On Sat, Aug 8, 2015 at 2:38 PM, GitHub wrote: > Branch: refs/heads/master > Home: https://github.com/perl6/specs > Commit: 614b6f36e1cae4c787e378bc6ab2afa1f86de1f0 > > https://github.com/perl6/specs/commit/614b6f36e1cae4c787e378bc6ab2afa1f86de1f0 > A

Re: Exploit the versioning (was Re: Backwards compatibility and release 1.0)

2015-10-15 Thread yary
Short answer: everything must declare which semantics it expects- everything in Panda/CPAN at least. And we already knew it, just need to do it. Full post: This thread points to a bigger problem, which has a solution that is both cultural and technical. Perl5 has a colossal code corpus, humbling

Re: Backwards compatibility and release 1.0

2015-10-15 Thread yary
On 10/13/2015 03:17 PM, Moritz Lenz wrote: >... We have 390+ modules, and hand-waving away all > trouble of maintaining them seems a bit lofty. > ... a large percentage of the module updates are done by group of > maybe five to a dozen volunteers. ... 5 people updating 70% of 390 > modules. Modules

Re: Rationale for $!

2016-01-27 Thread yary
On Wed, Jan 27, 2016 at 11:00 AM, Felipe Gasper wrote: > Could it not be: > > try my $f = open(...) or die … > Don't need a "try" there to make it work. An exception object/failure is false, so "my $f = open(...) or die" will assign the exception to $f, which is false, causing the "die" to execu

It's time to use "use v6.c"

2016-02-06 Thread yary
this morning I installed the 2016.01 R*. Now I'm at the NYC perl6 study group, and a helpful neighbor asked me to start up p6doc. It gave me an error about EVAL being dangerous, and after opening a ticket & adding "use MONKEY-SEE-NO-EVAL" to my source, I got "Undeclared name:CompUnitRepo used a

Re: It's time to use "use 6.c"

2016-02-06 Thread yary
Thanks all... I expect hiccups... just venting to help (future coders and current self)... while we're on this topic a) lwp-download.pl doesn't have a "use 6". Since Windows ignores the shebang, it invokes perl5 which is registered to handle "pl" files, and gives a bunch of syntax errors. If it di

Re: It's time to use "use v6.c"

2016-02-07 Thread yary
"panda --force install p6doc" fixed it for me!

Blogging on Perl6 anonymous proto/multi

2016-02-14 Thread yary
Back in June of last year some discussion about multi-subs got me thinking and posting about anonymous proto/multi routines here. It's been bubbling in the back of my mind since then, and as my Valentine to the language, I've posted my thoughts at http://blogs.perl.org/users/yary/2016/

Re: A practical benchmark shows speed challenges for Perl 6

2016-03-30 Thread yary
Cross-posting to the compiler group- On Wed, Mar 30, 2016 at 8:10 AM, Elizabeth Mattijsen wrote: > If you know the line endings of the file, using > IO::Handle.split($line-ending) (note the actual character, rather than a > regular expression) might help. That will read in the file in chunks o

  1   2   >