Re: Checking for nil return

2020-12-31 Thread yary
-y On Wed, Dec 30, 2020 at 10:02 PM yary wrote: > This commit shows where Nil expanded from being "Absence of a value" to, > alternatively, "a benign failure". Unfortunately I haven't found discussion > on "benign failure" – semantics, use case, prio

Re: Checking for nil return

2020-12-30 Thread yary
pairing. > Now I need to think through why it (grumbled that it) is wrong. > (or not wrong: for performance reasons, it is good to support values > that can never be undefined) > > -- Ruud > > > On 2020-12-28 22:35, yary wrote: > > [...] > > Allowing Failure as a ret

Re: Checking for nil return

2020-12-28 Thread yary
nd I am curious about the reasoning behind it being defined as valid sub a( --> Int:D ) { return Nil } -y On Sun, Dec 20, 2020 at 7:18 PM Brad Gilbert wrote: > Nil is always a valid return value regardless of any check. > > This is because it is the base of all failures. > > O

Re: Checking for nil return

2020-12-20 Thread yary
ot completely sure due to the nature of Nil being a defined type object. -y On Sun, Dec 20, 2020 at 2:35 PM Joseph Brenner wrote: > yary wrote: > > Is this a known issue, or my misunderstanding? > > > >> subset non-Nil where * !=== Nil; > > (non-Nil) > >> s

Checking for nil return

2020-12-19 Thread yary
Is this a known issue, or my misunderstanding? > subset non-Nil where * !=== Nil; (non-Nil) > sub out-check($out) returns non-Nil { return $out } &out-check > out-check(44) 44 > out-check(Nil) Nil ^ Huh, I expected an exception on "out-check(Nil)" saying the return value failed the "returns" cons

Re: "temp" vs "my"

2018-10-03 Thread yary
Thanks! Knew I'd seen the concept of OUTER but couldn't remember the keyword. -y On Wed, Oct 3, 2018 at 5:51 AM, Timo Paulssen wrote: > you can refer to the outer $v as OUTER::('$v'), that ought to help :) > On 03/10/2018 08:10, yary wrote: > > Reading and pla

"temp" vs "my"

2018-10-02 Thread yary
Reading and playing with https://docs.perl6.org/routine/temp There's an example showing how temp is "dynamic" - that any jump outside a block restores the value. All well and good. Then I thought, what if I want a lexical temporary value- then use "my"- and this is all well and good: my $v = "or

Re: 3 kinds of yadda

2018-09-10 Thread yary
Semantically !!! is "if control flow hits here, it's an error" ... is "The implementation is elsewhere, or this is not yet implemented" at least that's my impression -y On Mon, Sep 10, 2018 at 12:04 PM, Parrot Raiser <1parr...@gmail.com> wrote: > There are 3 kinds of yadda, yadda operator: >

Is negative lookbehind behaving here?

2018-05-03 Thread yary
I want to match something anywhere but at the end of a string in one example, or anywhere but at the start of a string in another example. The "except at start" one has me stumped. Not sure if it's me or if I've tickled a bug. perl6 --version This is Rakudo Star version 2018.01 built on MoarVM ver

Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-14 Thread yary
I do often deal with "flat" text files full of metrics, and remotely sourced json, and XML. The data types are sometimes unexpected. -y On Wed, Mar 7, 2018 at 5:16 PM, Solomon Foster wrote: > On Sun, Mar 4, 2018 at 8:49 AM, yary wrote: > >> In that spirit, I'd expe

Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-04 Thread yary
The point of Rats is making Perl6 more correct and less surprising in common cases, such as $ perl6 > 1.1+2.2 3.3 > 1.1+2.2 == 3.3 True > 1.1+2.2 != 3.3 False vs any language using binary floating-point arithmetic DB<1> p 1.1+2.2 3.3 DB<2> p 1.1+2.2 == 3.3 DB<3> p 1.1+2.2 != 3.3 1 In that

Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-03 Thread yary
Still thinking this out. Does the default epsilon influence a Rat == Float comparison? If so, for that purpose, the most useful epsilon is one that maximizes its correctness.

Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-03 Thread yary
Or instead of 1/2**(32 or 64), re-asking these questions about epsilon: " Why so large? Why not zero? " What's justification for using 1/100,000 vs. something smaller vs. 0 "max possible precision?"

Re: (default) Real->Rat precision should match what compiler uses for literals

2018-03-03 Thread yary
Zeroing in on one point: > > A solution might be to instead provide a pragmatic, rather than > mathematical > > parameter: > > > > :$numbits = 64 > > > > This would say to keep as much precision as possible while making the > result > > fit in 64 bits. For example 2.147483647e0.Rat would res

Re: Naming debate- what's the location for it?

2018-02-20 Thread yary
A bit of a digression around marketing/evangelizing > When I wanted to learn DataScience, courses using R and Python were > readily available. Even though I had been using Perl for 20 years, I did > not even know where to start in the Perl ecosystem! > I've wondered why PDL isn't more popular, m

Re: Naming debate- what's the location for it?

2018-02-08 Thread yary
On Thu, Feb 8, 2018 at 2:15 PM, Aaron Sherman wrote: > ... > IMHO, 6 has always been the personal name, but it could be changed to > something that's "sixish" without being an explicit number. Normally, I'd > recommend Latin, but Perl Sex is probably not where anyone wants to go... > Greek: ExiP

Naming debate- what's the location for it?

2018-02-08 Thread yary
I recall coming across a post saying the Perl6 name is up for discussion - searched & found this post now https://6lang.party/post/The-Hot-New-Language-Named-Rakudo describes it. Is there a forum where the name's being discussed that I can read? Woke up this morning with a name proposal that seeme

Re: fixing infinities and ranges etc

2016-10-30 Thread yary
I'm not sure I entirely understand the proposal- does it change Inf aka ∞ ? Otherwise I like it, and prefer the X::NegInf and X::PosInf,spellings as being easy-to-understand & a good Huffman-encoding. Before/AfterEverything are also easy to understand, and would be as natural to use for sorting s

Re: can a method name contain a funny character?

2016-05-21 Thread yary
Thanks for the in-depth analysis. My misunderstanding was about what an identifier considers a number; I have no well-thought-out ideas on the subject of what an identifier ought to be. Having the docs mention that "number" means only characters with a Unicode Property GeneralCategory of Nd might

Re: can a method name contain a funny character?

2016-05-20 Thread yary
To be clear, I expect that "number" in "followed by zero or more word characters (alphabetic, underscore or number)" means "if Unicode thinks it's numeric, you can use it in an identifier after the first character." I don't expect that every numeric codepoint in Unicode must evaluate to number in

Re: can a method name contain a funny character?

2016-05-20 Thread yary
On Tue, Apr 12, 2016 at 6:12 PM, Brandon Allbery wrote: > I was explaining why some "symbols" are acceptable to the parser. Which one > is more appropriate is not my call, I was thinking about what exactly are valid identifiers in Perl6/rakudo's implementation. The docs

Re: A practical benchmark shows speed challenges for Perl 6

2016-03-30 Thread yary
On Wed, Mar 30, 2016 at 3:20 PM, Elizabeth Mattijsen wrote: > Thanks for your thoughts! > > I’ve implemented $*DEFAULT-READ-ELEMS in > https://github.com/rakudo/rakudo/commit/5bd1e . > > Of course, all of this is provisional, and open for debate and bikeshedding. Thanks! And that was fast! All

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

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: It's time to use "use v6.c"

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

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

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: 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

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: 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: [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: 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: 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-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

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-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

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: 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

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: 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

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: 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

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: 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: [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: 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: 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: [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

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: 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 );

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: 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: 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-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-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
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

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: 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

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

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

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"

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: 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: 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: 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: 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: 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-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 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: 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-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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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-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: 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: 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: 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: 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: 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: 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

  1   2   >