Re: clarifying the spec for 'ref'

2006-08-28 Thread Richard Hainsworth
With regard to the 'square' 'isa' 'rectangle' or vice versa question, surely it is for the programmer to decide depending on the situation. Though the problem is how to define criteria for trapping problems at compile time. Regarding classes and roles, and in fact multiple inheritance in

Classes / roles as sets / subsets

2006-08-29 Thread Richard Hainsworth
Originally this posting was written in response to the 'ref' spec thread. I included char diagrams that got screwed up, so I made a png diagram instead (attached) and I re-edited the posting to refer to attached diagram, and then added some more comments. Hope everyone can 'see' the png. I

Trying to use Perl5 modules

2006-09-10 Thread Richard Hainsworth
I am trying to find out how to use (in perl6) perl5 modules that contain subroutines. Here are two scripts from standard modules. Both work in perl5, but I cant find a way to use them using pugs (I am using the Debian package with version 6.2.10-4build1 on GNU/Linux/Ubuntu) start of perl5

Re: Trying to use Perl5 modules

2006-09-13 Thread Richard Hainsworth
::SomeSubModule; our aPublicSub := SomeModule::SomeSubModule.can('aPublicSub'); and so on for all the sub's in the module. Regards, Richard Trey Harris wrote: In a message dated Mon, 11 Sep 2006, Richard Hainsworth writes: I am trying to find out how to use (in perl6) perl5 modules that contain

Index of terms

2006-09-17 Thread Richard Hainsworth
It would be useful to have a consolidated global index into the synopses, etc. Also, I noticed in a thread someone asked a question that arose because some topics are covered in more than one synopsis. This problem might eased if a single index had links for all documents in a single place.

Trying to make a new operator

2006-09-17 Thread Richard Hainsworth
I tried to make a new growth operator. The code was (32 + 48).say; sub infix:+ ($left,$right) { return 100 * ($right/$left -1); }; $pugs ./p6test.p6 returns with 50 But if I change the + character to (say) a cyrillic letter Д, I get the following error: $ pugs ./p6test.p6 ***

more on perl5 modules

2006-09-17 Thread Richard Hainsworth
The .can workaround doesnt seem to work for more complex modules. Here is a working perl5 program that puts up a message with two buttons. use strict; use Gtk2 -init; use Gtk2::Ex::Dialogs(destroy_with_parent=-1, modal=-1, no_separator = 0); my $window = Gtk2::Window-new('toplevel');

Re: more on perl5 modules

2006-09-18 Thread Richard Hainsworth
perhaps, the problem is I am not using the latest version of pugs. Regards, Richard A. Pagaltzis wrote: * Richard Hainsworth [EMAIL PROTECTED] [2006-09-17 18:05]: The .can workaround doesnt seem to work for more complex modules. Err, the .can workaround is a way to get past missing sub

Re: Trying to make a new operator

2006-09-20 Thread Richard Hainsworth
Thanks for help. For anyone else, the following works. sub infix:grew_by_to {...}; (32 grew_by_to 48).say; sub infix:grew_by_to ($left, $right) { return ($right/$left - 1) * 100 ~ '%'; }; Yuval Kogman wrote: On Sun, Sep 17, 2006 at 16:35:39 +0100, Daniel Hulme wrote: What am I doing

Re: Trying to make a new operator

2006-09-22 Thread Richard Hainsworth
Steffen Schwigon wrote: snip Thanks for reporting the solution back. And it even works with unicode operators. Looks like we finally really get our ankh, pentagram, and that smiley teddy bear from that Grateful Dead album. (*) :-) Thanks to Unicode, thanks to Pugs So hopefully in the same

trying to use a role within a role

2006-10-02 Thread Richard Hainsworth
Could someone please tell me what is wrong with the following? role win_text { has $.win_mytxt1 is rw; has $.win_mytxt2 is rw; }; role mywindow { has $.border is rw; has $.colour is rw; does win_text; }; my $w = new mywindow; $w.border = 2; $w.colour = 'red'; say $w.border; say

Embedded perl5 modules

2006-10-20 Thread Richard Hainsworth
Upgraded to pugs 6.13 after seeing comprehensive support for interoperability with Perl 5 modules. I want to test gui modules and I am trying the Gtk2 and Wx modules. The following program works under perl5: use strict; use Wx; my $app = Wx::SimpleApp-new; my $frame=Wx::Frame-new(undef, -1,

Re: Embedded perl5 modules

2006-10-22 Thread Richard Hainsworth
Steffen said: Maybe an additional use perl5:Wx::SimpleApp; ? I'm just guessing... Steffen -- Steffen Schwigon schwi... http://groups.google.com/groups/unlock?msg=5db1a47bed78a20d_done=/group/perl.perl6.users/browse_frm/thread/4c85d7fedf76dd11/6ec62de446f6ea38%3F@webit.de Dresden Perl

Re: Embedded perl5 modules

2006-10-24 Thread Richard Hainsworth
to know where to go to get Wx::SimpleApp-new, then in perl6 the same should be true, viz., use perl5:Wx; Wx::SimpleApp.new Regards, Richard Steffen Schwigon wrote: Richard Hainsworth [EMAIL PROTECTED] writes: use perl5:Wx; my $app = Wx::SimpleApp.new; my $frame=Wx::Frame.new(undef, -1, 'Hello

Re: Embedded perl5 modules

2006-10-28 Thread Richard Hainsworth
Schwigon wrote: Richard Hainsworth [EMAIL PROTECTED] writes: Tried use perl5:Wx::SimpleApp; but the compiler complained it could not find SimpleApp.pm Did you see my other suggestion with an intermediate WxHelper (http://www.nntp.perl.org/group/perl.perl6.users/546)? It also doesn't

variables inside an eval

2006-10-30 Thread Richard Hainsworth
If I have the following my $self = some text; my $nself = ~eval(q/self is $self/,:langperl5); then surely $nself should be self is some text. But it is not. $self is not set inside the eval in pugs. But say ~eval(q/self is $self/); yields self is some text Is this correct behaviour? If yes,

modifying within a perl5 block

2006-11-05 Thread Richard Hainsworth
Dear Audrey, Consider: my $x = 'test'; { use v5; $x .= 'ing'; }; say $x; pugs yields 'test' and not 'testing' - as expected. Moreover, the following hangs pugs: my $x = 'test'; my $y = 'case'; { use v5; $x .= 'ing'; { use v6-alpha; $y ~= 'book';

What criteria mark the closure of perl6 specification

2007-02-25 Thread Richard Hainsworth
When does the specification of perl6 come to an end? Are there criteria or milestones which define that the perl6 specification stage is at an end? I can see that setting a time line is not easy because the effort is volunteer based, but what about a conceptual end? Perhaps there could be a

Re: Documenting Perl6

2007-07-02 Thread Richard Hainsworth
Having read this posting, I find it VERY hard to understand exactly how Damian and Mark differ fundamentally. They both seem to be after the same thing in the end. A rhetorical question of my own and an answer. Q) what is the real difference between comments and documentation? - Syntactically

Re: xml and perl 6

2007-11-30 Thread Richard Hainsworth
By the time this got written, I see James has bowed out of the discussion with some words about 'architectural break points'. Even so, my two-penniworth: JF gave some examples of how he would like xml to be 'a part of core'. For clarity, I use xml and I have designed a language to describe

Re: Standards bearers (was Re: xml and perl 6)

2007-12-08 Thread Richard Hainsworth
Larry Wall wrote: On Sun, Dec 02, 2007 at 07:43:25PM -0800, Peter Scott wrote: : I do feel strongly that we need some sort of solution to this so that Perl : 6 is not merely an outstanding framework that leaves all domain-specific : extensions to the end user. Perl 6 as a language doesn't

Switch/Given and English, Was perl 6 grammar

2007-12-08 Thread Richard Hainsworth
snip I don't know why, this given... when sounds so 'English' without really being that English. The construct given ... when sounds better in English than switch ... case ... because: a) Switch is more commonly used in English as a noun, eg., Use the switch to turn on the light. But because

Re: Standards bearers (was Re: xml and perl 6)

2007-12-10 Thread Richard Hainsworth
chromatic wrote: On Saturday 08 December 2007 06:50:48 Richard Hainsworth wrote: Surely, some concentrated thought by the inventive and resouceful minds of who lead this project should go into language utilisation and popularisation. My goodness, @Larry's pretty darn busy trying

Re: Switch/Given and English, Was perl 6 grammar

2007-12-10 Thread Richard Hainsworth
snip I've never said that switch ... case was better than given ... when or that switch ... case was even a good construct. I have said that given ... when sounds weird as a construct (not mentionning the use of past participle and on top of that of an irregular verb). I understand the meaning

Re: Standards bearers (was Re: xml and perl 6)

2007-12-10 Thread Richard Hainsworth
A great relief. Fantastic. Where should I be looking to see what is happening. Is there some form of coordination of this module writing activity? Darren Duncan wrote: At 9:04 AM +0300 12/10/07, Richard Hainsworth wrote: Equally, Something to replace CGI or DBI will be essential

calling parrot from perl6

2008-01-01 Thread Richard Hainsworth
Not sure whether this should be p6-lan or p6-users. Posted to p6l only. Given a function implemented in parrot, how can it be called from a perl6 program? Suppose I have a file (in current path) myfun.pir which contains .sub myfun .param pmc passed_variable .local int an_int

what should be the default extension?

2008-01-04 Thread Richard Hainsworth
Perl scripts have had the extension *.pl To distinguish the scripts I started writing in perl6 from those in the same directory written for perl5, I started naming perl6 scripts with extension *.p6 . Trivial question, I suppose, but any reason not to use p6? What will the perl6 compiler

Re: what should be the default extension?

2008-01-07 Thread Richard Hainsworth
May I suggest the following extension to the 'use ' pragma, viz. use module name written in unicode and case sensitive in filename as constrained by local system For justification, see below. asideThere were some hot replies to what I thought was a fairly trivial question. A corollary

Re: what should be the default extension?

2008-01-07 Thread Richard Hainsworth
Trey Harris wrote: In a message dated Mon, 7 Jan 2008, Richard Hainsworth writes: May I suggest the following extension to the 'use ' pragma, viz. use module name written in unicode and case sensitive in filename as constrained by local system Oh please, no. The entire point of the wording

Re: pluralization idea that keeps bugging me

2008-01-26 Thread Richard Hainsworth
Its only English centric if the idea is fixed to plurals, because its only for plurals where English words are mutated by grammar rules. In other languages, words are mutated by other factors, such as the gender of the word, the case, and the number. The problem can be quite difficult, say

Re: pluralization idea that keeps bugging me

2008-01-27 Thread Richard Hainsworth
Perl - when I first met it - was great because it handled text easily and 'naturally'. I now use perl for everything, even when another language would probably be better. Perl6 has gone a long way to making things more universal by using UNICODE, (The difficulties of non-Latin fonts and

Re: pluralization idea that keeps bugging me

2008-02-09 Thread Richard Hainsworth
Warnocked! I posted an idea about pluralisation could be handled in a way that would not be English-centric (Subject: interpolation contextualisation). There were no responses to the idea. Was it so bad? Did no one see it? Was it too un-perlish? Was the title too horrible? The basic idea

Re: pluralization idea that keeps bugging me

2008-02-10 Thread Richard Hainsworth
Brandon S. Allbery KF8NH wrote: On Feb 9, 2008, at 11:43 , Richard Hainsworth wrote: I posted an idea about pluralisation could be handled in a way that would not be English-centric (Subject: interpolation contextualisation). There were no responses to the idea. Was it so bad? Did no one

Re: Perl 6 fundraising and related topics.

2008-02-22 Thread Richard Hainsworth
In my $life, I raise money from sponsors. It is not difficult to spend money, once you have it. It is not difficult to raise money, once you know how to spend it wisely. What's difficult is putting the two together. Some donors know what to contribute to - they choose specific projects and

Re: Perl 6 fundraising and related topics.

2008-02-22 Thread Richard Hainsworth
Me too. $500. That's 3*500, so far. Can I do this through the Perl Foundation as an earmark? Conrad Schneiker wrote: On Thursday 21 February 2008 06:25:42 Joshua Gatcomb wrote: On Thu, Feb 21, 2008 at 4:23 PM, chromatic [EMAIL PROTECTED] wrote: I could take a month's sabbatical from my

Re: Perl 6 fundraising and related topics.

2008-02-22 Thread Richard Hainsworth
, Richard Hainsworth wrote: No one likes bureacracy. But I feel much happier about handing over money, or persuading someone else to hand over money, to a group of people with established procedures and collective responsibility, than to some enthusiatic individual who promises the earth and whose

Re: Perl 6 fundraising and related topics.

2008-03-11 Thread Richard Hainsworth
FYI This discussion remains on-going. Some of the issues raised require investigation to clarify, which takes time. Richard Gabor Szabo wrote: Has anything happened in response to this discussion? Gabor

Re: Perl 6 fundraising and related topics.

2008-03-25 Thread Richard Hainsworth
this through The Perl Foundation and you will get a clear answer. Richard Hainsworth Uri Guttman wrote: RH == Richard Hainsworth [EMAIL PROTECTED] writes: RH No one likes bureacracy. But I feel much happier about handing over RH money, or persuading someone else to hand over money

Re: Nomenclature Question - BEGIN etc.

2008-04-13 Thread Richard Hainsworth
How about 'contingent blocks', because they are contingent on some event, without having to use the word 'event'. Richard TSa wrote: HaloO, Larry Wall wrote: Hmm, maybe control event blocks and control events, then... I would call them flow blocks because this is where they are called and

Re: All classes imply the existence of a role of the same name.

2008-05-03 Thread Richard Hainsworth
these concepts give a programmer that cannot be obtained from the roles/class/object hierarchy? Regards, Richard Hainsworth

Re: Speccing Test.pm?

2008-09-03 Thread Richard Hainsworth
Two sorts of testing - a) compiler, b) modules. Each category has different environment and function. a) compiler. An official test suite is defined (and probably will be added to as corner cases / ambiguities are discovered and disambiguation decided, so presumably some standardisation of

Files, Directories, Resources, Operating Systems

2008-11-26 Thread Richard Hainsworth
The S16: chown, chmod thread seems to be too unix-focussed. Perl6 is being born in a world dominated by the internet. Whilst perl was the glue for the internet when the internet was born, it was a unix child. I learned perl from a Windows perspective and I found the discussion of ownership

Re: Files, Directories, Resources, Operating Systems

2008-11-27 Thread Richard Hainsworth
Just as a variable name in perl6 must conform to a standard and abide by a set of constraints, why should file or other resource names be an exception? The constraints on variable names in perl6 are very flexible, but there are some rules that must be enforced for a program to work. It

Re: Perl as a better web language ?

2008-12-14 Thread Richard Hainsworth
Marc Chantreux wrote: On Sat, Dec 13, 2008 at 01:34:44PM +1100, Timothy S. Nelson wrote: On Sat, 13 Dec 2008, howard chen wrote: What I think is more likely to happen in reality is that people will make various Perl6 distros, ie. the Perl6 core + whatever modules are suitable to the

Working with files wish list

2008-12-15 Thread Richard Hainsworth
Following the request for ideas on IO, this is my wish list for working with files. I am not a perl guru and so I do not claim to be able to write specifications. But I do know what I would like. The organisation of the IO as roles seems to be a great idea. I think that what is suggested here

reporting bugs

2009-01-04 Thread Richard Hainsworth
I posted an email to per6-all asking about how one should go about reporting bugs. That message has appeared on the list. So again: how can bugs be reported? There was a suggestion by PM for people to try out perl6 on some real software, and the scripting completion tasks were suggested. So

Re: reporting bugs

2009-01-04 Thread Richard Hainsworth
s/has appeared/has NOT appeared/ Richard Hainsworth wrote: I posted an email to per6-all asking about how one should go about reporting bugs. That message has appeared on the list.

not wanting something

2009-01-06 Thread Richard Hainsworth
Supposed I define regex digit { [0..9] } what is the negative? By analogy, it should be !digit but I cant find this in the Synopses (possibly missed the relevant section). if /[0..9]/ then the negative is /![0..9]/ Also, suppose I want a 'when' clause to fire when the test is *not* met.

opposite of when (fewer stupid errors)

2009-01-06 Thread Richard Hainsworth
Suppose I want a 'when' clause to fire when the test is *not* met. What syntax should be used? So how would I do my $x = 'abced'; given $x { when ! /digit/ {say 'this does not contain a digit'} # this does not work } Since the ~~ operator is implied in the when, how do we get an implied

Scripting competition: password solution

2009-01-08 Thread Richard Hainsworth
Here's a solution to the scripting competition test. Patrick suggested publishing solutions somewhere, including this list. #!/usr/local/bin/perl6 =pod Patrick Michaud suggested (http://use.perl.org/~pmichaud/journal/38134?from=rss) writing solutions to scripting game definitions as a way of

Re: Scripting competition: password solution

2009-01-09 Thread Richard Hainsworth
wrong pod commands s/=pod/=begin/ s/=cut/=end/ Richard Hainsworth wrote: Here's a solution to the scripting competition test. Patrick suggested publishing solutions somewhere, including this list. #!/usr/local/bin/perl6 =pod Patrick Michaud suggested (http://use.perl.org/~pmichaud/journal

Re: [perl #62068] output from .perl for regex

2009-01-10 Thread Richard Hainsworth
/ digit+ / is what I thought it should be. { ... } is what rakudo current gives, which from the point of view of runnable code and comprehensible output, are wrong. Carl Mäsak via RT wrote: Richard (): The output from .perl for a regex could be more useful than currently. [...]

what is going on here?

2009-01-10 Thread Richard Hainsworth
Could someone help me understand what is going on in the following snippet? my %players = {'william'=2, 'peter'=3,'john'=1,'mary'=5}; my @ranking = %players.sort: { .value }; for @ranking {.say}; I cut and pasted from Patrick's blog on sorting and played around to get an array. But ... I

[Fwd: [Fwd: Re: what is going on here?]]

2009-01-11 Thread Richard Hainsworth
could this code be written? Hal Wigoda wrote: the first line creates a hash, the second line sorts the hash values into an array. the third loops thru the array values printing one array member per line On Jan 10, 2009, at 2:26 PM, Richard Hainsworth wrote: Could someone help me understand what

Re: [perl #62176] wierd segmentation fault with correct code.

2009-01-11 Thread Richard Hainsworth
Have you got the second data file in the current directory? I link perl6 to /usr/local/bin, change to the directory with the text file (skaters.txt) and script (skatersv2.pl), and then run. Richard Will Coleda via RT wrote: On Sat Jan 10 12:19:38 2009, richardh wrote: Getting a wierd

Solution to Games #2

2009-01-11 Thread Richard Hainsworth
Here's a solution to Scripting Games #2. Script and data file attached. The algorithm closely follows the published solution by the perl expert. Here is the model solution use 5.010; use strict; use warnings; use List::Util qw(sum); my %score; open(my $fh, , C:/Scripts/skaters.txt) or die;

Re: [perl #62176] wierd segmentation fault with correct code.

2009-01-11 Thread Richard Hainsworth
Thanks for the response. I downloaded parrot onto my office machine (35397), and tested as you suggested. All worked and in fact I couldnt reproduce the bug!!! :(( I will try again with parrot at home with version 35286 This happened to me before - I got a segmentation fault working with a

[perl #62176] wierd seg.. Follow up

2009-01-11 Thread Richard Hainsworth
Following up. Note that you need to delete the first 'say' line and uncomment the second. Running the first 'say' line clears up the fault with the second one. Deleting the first, yields the fault. Tried the script using parrot and perl6.pbc eliminates the fault. Richard Patrick R. Michaud

Re: what is going on here?

2009-01-12 Thread Richard Hainsworth
Larry Wall wrote: On Sat, Jan 10, 2009 at 11:26:50PM +0300, Richard Hainsworth wrote: More precisely, I dont understand the meaning of the ':' after '.sort' It is turning the method call into a list operator, essentially. It's not the so-called indirect object syntax, or it would

Revised solution #2

2009-01-12 Thread Richard Hainsworth
Of course whenever I post to this list I make some sort of mistake, like including a test version that does not parse in perl6. Hopefully, I have eliminated all the mistakes. The following is a revised version due to Carl Masak. The problem and model perl5 solution by Jan Dubois (a member of

Re: Revised solution #2

2009-01-13 Thread Richard Hainsworth
Carl Mäsak wrote: Andy (): P6 treats the key/value as an anonymous 'pair' object so @ranking is an list of pairs. That's why: say @ranking.pop.fmt($m Medal: %s, %s) or, less succinctly: say (pop @ranking).fmt($m Medal: %s, %s); works - the pair object, popped off into the 'printf' like

getting the face value of an enum

2009-01-14 Thread Richard Hainsworth
S12 defines enums and rakudo impliments them, so perl6 enum wkend Sat Sun; my $x = Sun; say $x 1 But suppose I want to get the face value of $x, viz., 'Sun'? How do I get it? say $x.key doesnt work.

Re: getting the face value of an enum

2009-01-14 Thread Richard Hainsworth
Can I suggest a new method to be declared with enums, viz. .face enum day Sun Mon Tue Wed Thur Fri Sat; my $today does day; $today = prompt Type in a day of the week ; #later say $today ; # prints 3 say $today.face; #prints Wed Whilst having an enum being a list of values is useful, not

Operating on pairs, Was Re: Revised solution #2

2009-01-15 Thread Richard Hainsworth
Larry Wall wrote: On Wed, Jan 14, 2009 at 09:55:38AM +0300, Richard Hainsworth wrote: However, I came across one thing in solution #3 that I posted yesterday. $pair.fmt(%s %s) is nice, but it doesnt allow for any action on either value or key before printing (I wanted to print the value

Re: Operating on pairs, Was Re: Revised solution #2

2009-01-16 Thread Richard Hainsworth
Carl Mäsak wrote: Andy (): map? perl6 -e 'my $x = :a5; say $x.map( { .value / 10} ).fmt(%s)' Yes, sure. That'll print a tenth of the value of $x. The '.fmt(%s)' is a no-op in this case. // Carl Not entirely a no-op. Thus $perl6 my $x=:a5; say $x.map({.value/10}).fmt(the value

first real perl6 use

2009-01-20 Thread Richard Hainsworth
Just wanted to say that this afternoon I used rakudo for a real world need. It was only a simple script to extract data from a text file. But it took all of 5 min from start to finish. Could have done it in perl5, but it really was easier to do it in perl6. As far as I am concerned, this

Re: RFD: Built-in testing

2009-01-21 Thread Richard Hainsworth
(Daniel Ruoso also proposed to call the adverb :test instead of :ok, making it easier to read but a bit longer; my happiness doesn't depend on the exact name, but of course we can discuss it once we have settled on this scheme, if we do so). My two-cents worth: The adverb on a boolean

Re: RFD: Built-in testing

2009-01-22 Thread Richard Hainsworth
Moritz Lenz wrote: snip So I'd like to hear your opinions: do you think adverb-based testing is a good idea? If you don't like it, do you see any other good way to tackle the problems I mentioned above? After reading everything in this thread to date and in order to structure my thoughts, I

Re: r25172 - docs/Perl6/Spec

2009-02-02 Thread Richard Hainsworth
to discover container objects (files, archives, databases) in them. Richard Hainsworth

Re: Periodic Table of the Operators, version 3

2009-02-16 Thread Richard Hainsworth
VERY stylish! For example, some questions: To what extent is the vertical alignment important? Does it indicate some form of seniority within a category? Where do the terms iffy dotty fiddly, etc come from? STD.pm? Where do the categories Jungian, Jungior etc come from? Just an excellent

Re: IO, Trees, and Time/Date

2009-02-17 Thread Richard Hainsworth
Timothy S. Nelson wrote: Hi all. I know we usually run on forgiveness instead of permission, but I'm suggesting a big change (or extension, anyway), so I wanted to run the ideas by you all before I put the effort in. If I don't get feedback, I'll just make the changes. The first

Re: IO, Trees, and Time/Date

2009-02-18 Thread Richard Hainsworth
Timothy S. Nelson wrote: On Tue, 17 Feb 2009, Richard Hainsworth wrote: Timothy S. Nelson wrote: snipbe specifying our files; it's prettier than File::Spec :), and unified. Anyway, HTH, I like all the default suggestions. Not sure whether this means you completely agree

Re: IO, Trees, and Time/Date

2009-02-18 Thread Richard Hainsworth
disagreement: Timothy S. Nelson wrote: On Wed, 18 Feb 2009, Richard Hainsworth wrote: snip $dir = new IO::Dir(/home/wayland); @files = grep { -f } @$dir; But this is exactly what I think should be avoided. -f implies that the location $dir contains things other than files. But that is an artifact

Re: Temporal revisited

2009-02-20 Thread Richard Hainsworth
Dave Rolsky wrote: After some discussion I made a number of drastic revisions to S32-setting-library/Temporal.pod What I want to see in Perl 6 is a set of very minimal roles that can be used to provide a simply object from gmtime() and localtime(). These objects should not handle locales,

S28

2009-02-24 Thread Richard Hainsworth
The official Perl6 Documentation site http://perlcabal.org/syn/ list this document as special-names not special-variables variables is more constrictive, so suggest a change in name of pod. pugs-comm...@feather.perl6.nl wrote: Author: wayland Date: 2009-02-23 04:47:22 +0100 (Mon, 23 Feb 2009)

Rules mentioned in specifications, etc

2009-02-24 Thread Richard Hainsworth
Here is a list of rules (see below) that are spread around the language design documents, but which lack a home in which they are systematically canonically defined. I suggest they be added to the new S28 (which is possible if S28 is special-names, not special-variables) Richard Where can

Predefined rules - clean up

2009-03-08 Thread Richard Hainsworth
Various Appocalypses, Exegeses, and Synopses use rules in example codes. These were gathered together by PM and implemented in PGE. Larry asked for them to be listed in S05 for a short description to be added. Timothy Nelson added them and I have just described them. This yielded some extra

Dot forms of adjectives

2009-03-15 Thread Richard Hainsworth
But I recently read this on irc: 2009-03-12 23:16pugs_svnr25809 | lwall++ | This decrease in consistency on the syntactic level is offset by an 23:16pugs_svnr25809 | lwall++ | increase in consistency on the semantic level, as suggested by rouso++. 23:16pugs_svnr25809 |

Re: Dot forms of adjectives

2009-03-15 Thread Richard Hainsworth
Original post not very clear. So here goes again: First statement (below) says: dot forms of adverbs eliminated. Second appears to say: adverb form is translated to dot form. Richard Hainsworth wrote: But I recently read this on irc: 2009-03-12 23:16pugs_svnr25809 | lwall

Power of Perl6 Operators!

2009-03-15 Thread Richard Hainsworth
Inspired by a line of code on irc by krunen++, I returned to the scripting games problems (following PM's suggestion in a blog a while ago). Perl6 rocks! 30 lines to solve the problem. The perl5 solution was a neat 45 lines. The vbscript took 197 lines! In lines of code perl6 is 50% better

a junction or not

2009-03-15 Thread Richard Hainsworth
The following (the n: is to mark the lines) are legal: 1: my @x = 1,2,3,4; ([+] @x).say; # output 10 2: my @x = 1|11,2,3,4; ([+] @a).perl.say; # output any(10,20) 3: my @x = 1|11,2,3,4; ([+] @a).eigenstates.min.say; # output 10 However, the next line isnt 4: my @x = 1,2,3,4; ([+]

Re: a junction or not

2009-03-15 Thread Richard Hainsworth
Jonathan Worthington wrote: Richard Hainsworth wrote: snip Eg. $ perl6 my @s=1|11,2,3,4,5,6;my @x; loop {...@x=@s.pick(3);([+] @x).eigenstates.min.say} 8 6 Method 'eigenstates' not found for invocant of class 'Integer' You can detect junctions by smart-matching against the Junction type

Logo considerations

2009-03-23 Thread Richard Hainsworth
Hats off to the designer of the gimel symbol - the associations with anarchy are probably right for perl6. But to be honest, a letter didnt quite inspire me. Since, I dont want to criticize without providing other ideas, here are some thoughts. Logos can contain meaning. I am not sure whether

Camelia - Queen of Perl

2009-03-26 Thread Richard Hainsworth
Just read nearly 100 emails on Re: Logo Considerations, a whole lot in reverse order and repeated! Is this the result of a perl6 implementation of a listserver using junctions? But I agree with Brett, Camelia is the first logo idea I really liked. I vote we tell Camelia she has the prize she

On Junctions

2009-03-27 Thread Richard Hainsworth
The following arose out of a discussion on #perl6. Junctions are new and different from anything I have encountered, but I cant get rid of the feeling that there needs to be some more flexibility in their use to make them a common programming tool. Background: Imagine a hand of cards. Cards

Re: On Sets (Was: Re: On Junctions)

2009-03-28 Thread Richard Hainsworth
Daniel Ruoso wrote: The thing is that junctions are so cool that people like to use it for more things than it's really usefull (overseeing that junctions are too much powerfull for that uses, meaning it will lead to unexpected behaviors at some point). What are the general boundaries for

Junction Algebra

2009-03-28 Thread Richard Hainsworth
Included in my 'On junctions' message were some questions that have not been directly answered. I simplify and expand them here. Here I use === to mean 'is the same as'. (I am not sure which of == or === should be used.) 1) Is the following true for an any junction? any( ... ,

simultaneous conditions in junctions

2009-04-01 Thread Richard Hainsworth
Thinking about Jon Lang's -1|+1 example in another way, I wondered about simultaneous conditions. Consider $x = any (1,2,5,6) How do we compose a conditional that asks if any of this set of eigenstates are simultaneously both 2 and 5? Clearly the desired answer for $x is False, but my $x

[Fwd: Re: junctions and conditionals]

2009-04-01 Thread Richard Hainsworth
This email was mistakenly not sent to the p6l list. Jon writes: On Wed, Apr 1, 2009 at 12:54 AM, Richard Hainsworth rich...@rusrating.ru wrote: Jon Lang wrote: In Junction Algebra, Martin Kealey wrote: On Mon, 30 Mar 2009, Mark J. Reed wrote: ( $a = any(-1,+1) = $b

Re: simultaneous conditions in junctions

2009-04-02 Thread Richard Hainsworth
Larry Wall wrote: On Wed, Apr 01, 2009 at 08:40:12AM -0700, Dave Whipp wrote: That said, the semantics of a chained relop really should work correctly for this. If you only reference a junction once in an expression, then it should behave as such: {abc} !=== {ab bc}. Yes, that is

Add link to STD.pm where official documentation listed

2009-05-24 Thread Richard Hainsworth
On #perl6 Larry said that STD is a part of the specification for perl6. Would it be possible to include a link to STD.pm in the list of official documentation? There are things in STD that are not in the specifications, eg., default values for optional parameters should come after traits

Module Library - aka CPAN

2009-05-31 Thread Richard Hainsworth
Before joining in the previous CPAN threads, here are some personal wish lists regarding what the perl6 version of CPAN should do. But in order to get some distance from CPAN, I want to call it the Module Library system. Some of the debate threads impact on the internal software environment,

Re: Module Library - aka CPAN

2009-05-31 Thread Richard Hainsworth
: Richard Hainsworth richard-at-rusrating.ru |Perl 6| wrote: Once a module has been decided on, you look to see if there is a binary that matches your internal environment. If not, you have to roll your own from source. Why not have it generate the binary for you, and safe it for future

Re: Module naming conventions

2009-06-02 Thread Richard Hainsworth
Daniel Carrera wrote: Mark Overmeer wrote: Currently in CPAN you have modules like: Digest::MD5 Digest::SHA Digest::MD5::Perl Digest::SHA::PurePerl The difference is that the first two are implemented in C and the later two in Perl. This is comparible to adding a target to each of the

slowness in grammar

2009-06-03 Thread Richard Hainsworth
Is this a good place to come with code that runs into speed problems? I am writing a program in perl6 to read the xml file from a Sony book reader, list the books, and move books into collections (the Sony software to do this will only work on windoz and not on wine). I have a grammar that

How to speed up a grammar

2009-06-06 Thread Richard Hainsworth
Leon Timmermans wrote: If you want to write a fast parser for XML, preventing backtracking is going to be quite essential. I suspect the problem is your grammar, not the grammar engine itself. You could post it to perl6-users and ask for advice on it. Leon Below is the grammar. I am only

say followed by lines - inconsistencies

2009-06-08 Thread Richard Hainsworth
I came upon the following, which seems to be in line with spec, but I think is inconsistent. I write a hash to a file delimited by tabs, eg my $fn=open('data.csv',:w); my %x=one two three four Z 1,2,2.1,3; $fn.say('record-name'~map(\t$^a\t$^b),%x); $fn.close; The output sometimes contains

Re: say followed by lines - inconsistencies

2009-06-09 Thread Richard Hainsworth
Larry Wall wrote: snip Well, regardless of whether there are extra spaces, please note that the default stringifications are not intended as a serialization format. They are intended only to provide a bit of human readability for the common case of small, spaceless items such as numbers and

Re: [perl #66640] [BUG] minmax operator not working yet

2009-06-26 Thread Richard Hainsworth
I dont quite understand, see below: Patrick R. Michaud via RT wrote: On Tue Jun 16 10:14:11 2009, richardh wrote: my @a=1,2,3,4; my @b=9,8,7,1; say (@a minmax @b).perl While rakudo doesn't implement infix:minmax yet, the operator is constrained to having two elements on either side,

Re: [perl #66640] [BUG] minmax operator not working yet

2009-06-28 Thread Richard Hainsworth
Patrick R. Michaud via RT wrote: On Fri, Jun 26, 2009 at 08:37:20AM -0700, Richard Hainsworth via RT wrote: my @a=1,2,3,4; my @b=9,8,7,1; say (@a minmax @b).perl While rakudo doesn't implement infix:minmax yet, the operator is constrained to having two elements on either side, so

  1   2   3   4   >