A new era for Temporal

2010-04-08 Thread Carl Mäsak
We (mberends and masak) just pushed a commit to S32::Temporal which completely replaces what we had before. The changes are rooted in hours of discussion on #perl6, and we feel rather more confident with what we have now than with what we had before. That said, discussion is very welcome. I do wa

Re: A new era for Temporal

2010-04-08 Thread Mark J. Reed
This looks much better. Thank you. When can we expect to see the new version implemented in Rakudo? Need any help on that front? On Thu, Apr 8, 2010 at 5:52 PM, Carl Mäsak wrote: > We (mberends and masak) just pushed a commit to S32::Temporal which > completely replaces what we had before. Th

Re: A new era for Temporal

2010-04-08 Thread Carl Mäsak
Mark (>): > This looks much better.  Thank you.  When can we expect to see the new > version implemented in Rakudo?  Need any help on that front? A preliminary version is already checked in, and works. It's not full-featured yet, but work is underway. Commits are appreciated, as always.

Re: A new era for Temporal

2010-04-09 Thread Dave Rolsky
On Thu, 8 Apr 2010, Carl Mäsak wrote: I do want to explicitly credit Dave Rolsky, whose work on the DateTime family of modules on CPAN has informed much of the current spec, sometimes to the point of verbatim copying. Thanks, but I'd hate to see you copy all my mistakes too! One thing I think

Re: A new era for Temporal

2010-04-09 Thread Moritz Lenz
Am 09.04.2010 15:33, schrieb Dave Rolsky: On Thu, 8 Apr 2010, Carl Mäsak wrote: I do want to explicitly credit Dave Rolsky, whose work on the DateTime family of modules on CPAN has informed much of the current spec, sometimes to the point of verbatim copying. Thanks, but I'd hate to see you c

Re: A new era for Temporal

2010-04-09 Thread Timothy S. Nelson
On Thu, 8 Apr 2010, Carl Mäsak wrote: We (mberends and masak) just pushed a commit to S32::Temporal which completely replaces what we had before. The changes are rooted in hours of discussion on #perl6, and we feel rather more confident with what we have now than with what we had before. That s

Re: A new era for Temporal

2010-04-09 Thread John Siracusa
Forgive me if this is a question the reveals how poorly I've been following Perl 6 development, but what's the deal with some methods using hyphen-separated words (e.g., day-of-week) while others use "normal" Perl method names (e.g., set_second)? -John

Re: A new era for Temporal

2010-04-10 Thread Xiao Yafeng
Is Int a proper type? I hope I can use basic operation within Date and hours in perl6 like: Date -1/24 + 1/24/60 + Date On Fri, Apr 9, 2010 at 10:00 PM, Moritz Lenz wrote: > Am 09.04.2010 15:33, schrieb Dave Rolsky: > > On Thu, 8 Apr 2010, Carl Mäsak wrote: >> >> I do want to exp

Re: A new era for Temporal

2010-04-11 Thread Moritz Lenz
Dave Rolsky wrote: > On Thu, 8 Apr 2010, Carl Mäsak wrote: > >> I do want to explicitly credit Dave Rolsky, whose work on the DateTime >> family of modules on CPAN has informed much of the current spec, >> sometimes to the point of verbatim copying. > > Thanks, but I'd hate to see you copy all my

Re: A new era for Temporal

2010-04-11 Thread Dave Rolsky
On Sun, 11 Apr 2010, Moritz Lenz wrote: I've planned to add such a module to the Perl 6 spec, but some comments on #perl6 suggested it should be kept out of core to prevent bloat. Still if the overall opinion is that Perl 6 should have such a module out of the box, I'll be happy to spec it. I

Re: A new era for Temporal

2010-04-12 Thread Mark J. Reed
On Sun, Apr 11, 2010 at 9:47 PM, Dave Rolsky wrote: > On Sun, 11 Apr 2010, Moritz Lenz wrote: > > I've planned to add such a module to the Perl 6 spec, but some comments >> on #perl6 suggested it should be kept out of core to prevent bloat. >> Still if the overall opinion is that Perl 6 should h

Re: A new era for Temporal

2010-04-12 Thread Mark J. Reed
On Mon, Apr 12, 2010 at 6:38 AM, Mark J. Reed wrote: > I think that having a standard, minimal API for this defined in core as a >> Date role would be ideal. > > > Agreed. In fact, I'd like to see DateTime be defined explicitly as a > superset (subrole) of Date, with a method for extracting just

Re: A new era for Temporal

2010-04-12 Thread Moritz Lenz
Am 12.04.2010 03:47, schrieb Dave Rolsky: On Sun, 11 Apr 2010, Moritz Lenz wrote: I've planned to add such a module to the Perl 6 spec, but some comments on #perl6 suggested it should be kept out of core to prevent bloat. Still if the overall opinion is that Perl 6 should have such a module out

Re: A new era for Temporal

2010-04-20 Thread Dave Rolsky
On Mon, 12 Apr 2010, Moritz Lenz wrote: Am 12.04.2010 03:47, schrieb Dave Rolsky: On Sun, 11 Apr 2010, Moritz Lenz wrote: I've planned to add such a module to the Perl 6 spec, but some comments on #perl6 suggested it should be kept out of core to prevent bloat. Still if the overall opinion is

expression of seconds (was Re: A new era for Temporal)

2010-04-09 Thread Darren Duncan
Dave Rolsky wrote: On a smaller point, I think second vs whole_second is the wrong Huffman coding. I'd think most people want the integer value. Well, whatever you call things, the most important thing is to keep the seconds count as a single number which can do fractions, or if you really mus

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

2010-04-09 Thread Darren Duncan
John Siracusa wrote: Forgive me if this is a question the reveals how poorly I've been following Perl 6 development, but what's the deal with some methods using hyphen-separated words (e.g., day-of-week) while others use "normal" Perl method names (e.g., set_second)? There are 2 answers to that

Re: expression of seconds (was Re: A new era for Temporal)

2010-04-09 Thread Jonathan Worthington
Darren Duncan wrote: Dave Rolsky wrote: On a smaller point, I think second vs whole_second is the wrong Huffman coding. I'd think most people want the integer value. Well, whatever you call things, the most important thing is to keep the seconds count as a single number which can do fractions

Re: expression of seconds (was Re: A new era for Temporal)

2010-04-09 Thread Darren Duncan
Jonathan Worthington wrote: Darren Duncan wrote: Dave Rolsky wrote: On a smaller point, I think second vs whole_second is the wrong Huffman coding. I'd think most people want the integer value. Well, whatever you call things, the most important thing is to keep the seconds count as a single

Re: expression of seconds (was Re: A new era for Temporal)

2010-04-09 Thread Jason Switzer
On Fri, Apr 9, 2010 at 3:06 PM, Jonathan Worthington wrote: > Though even clearer and same number of characters as whole_seconds is: > > $dt.seconds.round This makes more sense to me than the first example you listed because when dealing with time measurement, I rarely think of seconds that ar

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

2010-04-10 Thread Carl Mäsak
John (>): > Forgive me if this is a question the reveals how poorly I've been > following Perl 6 development, but what's the deal with some methods > using hyphen-separated words (e.g., day-of-week) while others use > "normal" Perl method names (e.g., set_second)? I'd just like to point out that t

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

2010-04-10 Thread Mark J. Reed
I'd much rather see a single consistent style throughout the setting than backwards compatibility with p5 naming conventions. If Temporal is the first setting module to use multiword identifiers, I vote for hyphens. They're easier on the fingers and the eyes; underscores have always felt like an

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

2010-04-10 Thread John Siracusa
On Sat, Apr 10, 2010 at 6:14 AM, Mark J. Reed wrote: > I'd much rather see a single consistent style throughout Yeah, that's was my main point/question. I wanted to know if it was it some intentional convention (e.g., "all methods that change the object state use hyphens, and all others use unde

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

2010-04-10 Thread Carl Mäsak
Mark (>>), John (>): >> I'd much rather see a single consistent style throughout > > Yeah, that's was my main point/question.  I wanted to know if it was > it some intentional convention (e.g., "all methods that change the > object state use hyphens, and all others use underscores") or if it > was

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

2010-04-10 Thread Damian Conway
Personally, I'd prefer to see the English conventions carried over to the use of general use of hyphen and underscore in identifiers in the core (and everywhere else). By that, I mean that, in English, the hyphen is notionally a "higher precedence" word-separator than the space (or than its intra-

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

2010-04-10 Thread John Siracusa
On Sat, Apr 10, 2010 at 5:25 PM, Damian Conway wrote: > Personally, I'd prefer to see the English conventions carried over to > the use of general use of hyphen and underscore in identifiers in > the core (and everywhere else). That's certainly an example of how hyphens might gain meaning in Perl

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

2010-04-10 Thread Mark J. Reed
In English, hyphens normally indicate an extra level of reification, where e.g. what is normally a phrase is used in a context that requires a single word: "The miller gave us the run of the mill." vs. "It was a run-of-the-mill event." As such, examples like "day?of?week" are somewhat infelicitous

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

2010-04-10 Thread Damian Conway
John Siracusa commented: > That's certainly an example of how hyphens might gain meaning in Perl > 6 names, but I don't think I can endorse it as a convention.  People > can't even use hyphens correctly in written English.  I have very > little faith that programmers will do any better in code Bu

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

2010-04-10 Thread John Siracusa
On Sat, Apr 10, 2010 at 7:17 PM, Damian Conway wrote: > And is it really so hard to teach: "use underscore by default and reserve > hyphens for between a noun and its adjective"? Perhaps it *is*, but > then that's a very sad reflection on our profession. I'm not sure if the intersection of people

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: underscores vs hyphens (was Re: A new era for Temporal)

2010-04-10 Thread Daniel Ruoso
Em Sáb, 2010-04-10 às 19:53 -0400, John Siracusa escreveu: > I'm having trouble imaging any convention that involves mixing word > separators being successful. But the convention Damian is proposing is simply "use underscores". Basically camelCase and with_underscores are conventions on "how to c

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

2010-04-10 Thread John Siracusa
On Sat, Apr 10, 2010 at 8:23 PM, Daniel Ruoso wrote: > Em Sáb, 2010-04-10 às 19:53 -0400, John Siracusa escreveu: >> I'm having trouble imaging any convention that involves mixing word >> separators being successful. > > But the convention Damian is proposing is simply "use underscores". > > Basic

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

2010-04-10 Thread Mark J. Reed
Agreed. Perl borrows vocabulary almost exclusively from English, but it is not English, and its conventions are not those of English. (And the conventions around hyphens that people are citing are quite specifically those of standard written English; other writing systems, even those using the sa

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

2010-04-11 Thread Conrad Schneiker
> From: Mark J. Reed [mailto:markjr...@gmail.com] [...] > Perl borrows vocabulary almost exclusively from English, but it is > not English, and its conventions are not those of English. (And the > conventions around hyphens that people are citing are quite specifically > those of standard written

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

2010-04-11 Thread Sundara Raman
On Sun, Apr 11, 2010 at 4:47 AM, Damian Conway wrote: > And is it really so hard to teach: "use underscore by default and reserve > hyphens for between a noun and its adjective"? Perhaps it *is*, but > then that's a very sad reflection on our profession. > If anything, it's a sad reflection on h

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

2010-04-11 Thread Jonathan Scott Duff
On Sat, Apr 10, 2010 at 5:14 AM, Mark J. Reed wrote: > I'd much rather see a single consistent style throughout the setting > than backwards compatibility with p5 naming conventions. > > If Temporal is the first setting module to use multiword identifiers, > I vote for hyphens. As another data

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

2010-04-11 Thread Damian Conway
Well, if we're not going to try to implement linguistically based hyphenation/underscoriation rules (and I'd still argue that hyphenating adjectives to nouns and underscoring everything else isn't exactly rocket science), then I'd suggest we reconsider a radically different proposal that was made o

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

2010-04-11 Thread Geoffrey Broadwell
On Sat, 2010-04-10 at 17:20 -0700, yary wrote: > Adjectives and nouns aren't English-only. So Damian's proposal is > multi-culti. One could argue that Perl's identifiers, keywords, etc > are based on English so that it is more difficult for a non-English > speaker to discern why underscore is used

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

2010-04-11 Thread John Siracusa
On Sun, Apr 11, 2010 at 10:54 AM, Damian Conway wrote: > Hyphen/underscore equivalence would allow those (apparently elite few) who > can correctly use a hyphen to correctly use the hyphen That's about the only advantage of this scheme that I can think of. The disadvantages, which affect everyone

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

2010-04-11 Thread Mark J. Reed
Egad, no to the equivalence. We'd be back in case-insensitive-language land, only without the benefit of even that dubious tradition. And at least for me, the beef with mixing hyphens and underscores is not that the great unwashed masses can't handle it, but that there will inevitably be cases wh

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

2010-04-11 Thread Matthew
I can't help but agree with Damian. I don't see much of a point in making a distinction between - and _. More specifically, if a user were to define a function (say, i-hate-camel-case()), it would not be good to let them be the same. Readability would suffer when examining someone's code and y

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

2010-04-11 Thread Mark J. Reed
Egad, no to the equivalence. We'd be back in case-insensitive-language land, only without the benefit of even that dubious tradition. And at least for me, the beef with mixing hyphens and underscores is not that the great unwashed masses can't handle it, but that there will inevitably be cases wh

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

2010-04-11 Thread Shawn H Corey
Damian Conway wrote: Well, if we're not going to try to implement linguistically based hyphenation/underscoriation rules (and I'd still argue that hyphenating adjectives to nouns and underscoring everything else isn't exactly rocket science), then I'd suggest we reconsider a radically different p

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

2010-04-11 Thread Darren Duncan
Damian Conway wrote: The relevant suggestion regarding hyphens vs underscores is: "...to allow both characters, but have them mean the same thing." That is, any isolated internal underscore can be replaced with an isolated internal hyphen (and vice versa), without changing the meaning of th

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

2010-04-11 Thread Daniel Ruoso
Em Dom, 2010-04-11 às 07:54 -0700, Damian Conway escreveu: > The relevant suggestion regarding hyphens vs underscores is: > "...to allow both characters, but have them mean the same thing." er... this smells like :: and ' in Perl 5... Which, while I find Acme::Don't amusing, cannot be stated a

Re: expression of seconds (was Re: A new era for Temporal)

2010-04-11 Thread Dave Rolsky
On Fri, 9 Apr 2010, Darren Duncan wrote: conceptual and a usability and a math point of view. If users only want the integer value, then they can just store the second as an integer in the first place. As for the name, well "whole_second" can be made shorter, or its Users will not always co

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

2010-04-11 Thread Dave Rolsky
On Sat, 10 Apr 2010, Mark J. Reed wrote: I'd much rather see a single consistent style throughout the setting than backwards compatibility with p5 naming conventions. Ditto! If Perl 6 style is hyphens, use hyphens everywhere. That transition from P5 DateTime to P6 will then be a simple s/_/-

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

2010-04-11 Thread Doug McNutt
${A-1} = 3.14159; $A = $A-1; $A = $A -1; $A-=2; $A = 123E-2; $A = Pi(); $B = sin ($A-1); $B = sin (${A}-1); $B = sin($A -1); -2**2 = -4 except when it comes out +4 as in MS Excel. _2**2 = +4 in some other languages that use _ as a unary minus operator. Will editors be bothered when I try to inclu

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

2010-04-11 Thread Darren Duncan
Doug McNutt wrote: ${A-1} = 3.14159; $A = $A-1; $A = $A -1; $A-=2; $A = 123E-2; $A = Pi(); $B = sin ($A-1); $B = sin (${A}-1); $B = sin($A -1); -2**2 = -4 except when it comes out +4 as in MS Excel. _2**2 = +4 in some other languages that use _ as a unary minus operator. Will editors be bothere

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

2010-04-11 Thread Richard Hainsworth
Damian Conway wrote: Personally, I'd prefer to see the English conventions carried over to the use of general use of hyphen and underscore in identifiers in the core (and everywhere else). By that, I mean that, in English, the hyphen is notionally a "higher precedence" word-separator than the sp

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

2010-04-12 Thread Peter Scott
Am I the only one who sees a hyphen and thinks "binary minus"? Just because the parser can disambiguate this use of it doesn't mean the reader's brain can do so as easily. (I assume we're talking about the same character, 0x2D, and not something from further afield in the Unicode tables, right

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

2010-04-12 Thread Moritz Lenz
Peter Scott wrote: > Am I the only one who sees a hyphen and thinks "binary minus"? Just > because the parser can disambiguate this use of it doesn't mean the > reader's brain can do so as easily. It's all a matter of practice. Since variables begin with sigils, and you should put whitespace a

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

2010-04-12 Thread Shawn H Corey
Darren Duncan wrote: See http://perlcabal.org/syn/S02.html#Names for your answers. Thanks for the link but nowhere in it does it state tha Perl 6 names are case sensitive. The best the do is this, which implies it is but doesn't state it. "Other all-caps names are semi-reserved. We may add

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

2010-04-12 Thread Matthew Walton
On Mon, Apr 12, 2010 at 1:22 PM, Shawn H Corey wrote: > Darren Duncan wrote: >> >> See http://perlcabal.org/syn/S02.html#Names for your answers. > > Thanks for the link but nowhere in it does it state tha Perl 6 names are > case sensitive.  The best the do is this, which implies it is but doesn't

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

2010-04-12 Thread Larry Wall
On Sun, Apr 11, 2010 at 03:47:18PM -0700, Darren Duncan wrote: : Damian Conway wrote: : >The relevant suggestion regarding hyphens vs underscores is: : > : >"...to allow both characters, but have them mean the same thing." : > : >That is, any isolated internal underscore can be replaced with an

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

2010-04-12 Thread Aaron Sherman
On Mon, Apr 12, 2010 at 2:23 PM, Larry Wall wrote: > On Sun, Apr 11, 2010 at 03:47:18PM -0700, Darren Duncan wrote: > : > : I see that making underscores > : and hyphens to be equivalent is akin to having case-insensitive > : identifiers, where "Perl","PERL","perl" mean the same thing. Rather >

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

2010-04-12 Thread Geoffrey Broadwell
On Mon, 2010-04-12 at 11:23 -0700, Larry Wall wrote: > The standard parser will likely be pointing out spelling errors and > conjecturing emendations for near misses. Whole-program analysis can > even do this for any method names that look wrongish. The difference > between Acme-X and Acme_X is n