Re: Trying to use Perl5 modules (documented on wiki)

2006-09-17 Thread Mark Stosberg
Audrey Tang wrote: > > 在 Sep 11, 2006 2:07 PM 時,Trey Harris 寫到: > >> 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 subroutines. >> >> Imports from Perl 5 modules don't currently work. > > Actually,

Re: CGI Session management (was Re: the CGI.pm in Perl 6)

2006-09-17 Thread Mark Stosberg
> > I agree completely. In that vein, I think that one thing a lot of web > developers would like to have available more easily would be session > management. In PHP it's as simple as $_SESSION['key'] = 'value'. I > understand that CGI.pm is a fundemantally different concept from PHP and > tha

best practice for web form stickiness (was: Re: the CGI.pm in Perl 6)

2006-09-17 Thread Mark Stosberg
Juerd wrote: > > Personally, I am *against* HTML generating for elements that are not > form fields. And for form fields, I think the solution should be in the > templating thing, not elsewhere. Stickiness makes sense on invalid data > only anyway, and we need to put the error message and a pointer

use perl5:CGI as a solution (was: Re: the CGI.pm in Perl 6)

2006-09-17 Thread Mark Stosberg
Aankhen wrote: > > The major feeling was that there should be no CGI.pm (if someone was > hellbent on using it, they could use the Perl 5 module). In theory, "use perl5:CGI" could be a fine solution. In practice, it hasn't worked out well for me. Even something that seems simple like passing a h

Who uses CGI.pm HTML generation? (was: Re: the CGI.pm in Perl 6)

2006-09-17 Thread Mark Stosberg
David Cantrell wrote: > > I wonder how many people really use the HTML-generating bits of CGI.pm? > I know I never have, nor have they been used that I can remember > anywhere that I've worked, or in any of the non-work projects I've > collaborated in. It's always been 'print ""' or more recently

Re: use perl5:CGI as a solution (was: Re: the CGI.pm in Perl 6)

2006-09-17 Thread Juerd
Mark Stosberg skribis 2006-09-16 21:30 (-0500): > Aankhen wrote: > > The major feeling was that there should be no CGI.pm (if someone was > > hellbent on using it, they could use the Perl 5 module). > In theory, "use perl5:CGI" could be a fine solution. In practice, it > hasn't worked out well fo

Re: CGI Session management (was Re: the CGI.pm in Perl 6)

2006-09-17 Thread Juerd
Mark Stosberg skribis 2006-09-16 22:04 (-0500): > As far as I'm aware, no work on CGI::Session for Perl 6 has started yet. I'm happy about that, because this module must not have "CGI" in its name. -- korajn salutojn, juerd waalboer: perl hacker <[EMAIL PROTECTED]>

How to pass a ref from a language with no refs (was: Re: use perl5:CGI as a solution)

2006-09-17 Thread Mark Stosberg
Juerd wrote: > > Please note that eventually, perl5:CGI is supposed to work as expected. For that to happen, there will first have be some documentation telling me what expectations to have. When Perl 5 has references and Perl 6 doesn't, I don't know what to expect to when I need to pass a hash

Re: How to pass a ref from a language with no refs (was: Re: use perl5:CGI as a solution)

2006-09-17 Thread Juerd
Mark Stosberg skribis 2006-09-17 8:10 (-0500): > > Please note that eventually, perl5:CGI is supposed to work as expected. > For that to happen, there will first have be some documentation telling > me what expectations to have. Good point, but I think your expectations are natural and logical.

Web development I: Web::Toolkit

2006-09-17 Thread Juerd
Juerd's thoughts about Perl 6 web development Part one: Motivation and general thoughts If you know me, you know that I never really liked Perl 5's CGI.pm. In essence, I like that it has enabled a lot of people to build dynamic web pages in a reasonably simple way. However, it was avery large mon

Re: Web development I: Web::Toolkit

2006-09-17 Thread Amir E. Aharoni
17/09/06, Juerd <[EMAIL PROTECTED]> skribis: This is a very strict language, though, as it is based on XML. A document is either valid and unambiguous, or completely invalid. Just like any programming language should be. And the XHTML rules are quite reasonable. In practice *all* browsers effec

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

Re: Trying to make a new operator

2006-09-17 Thread Daniel Hulme
> What am I doing wrong? Sounds like you need to define (or at least declare) the new operator before you use it. Perl 6, like Perl 5 compiles with a single pass, so when you are using your random operator, it hasn't yet read the declaration further down the file. It does its best to DTRT with mos

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

Re: Trying to make a new operator

2006-09-17 Thread Yuval Kogman
On Sun, Sep 17, 2006 at 16:35:39 +0100, Daniel Hulme wrote: > > What am I doing wrong? > Sounds like you need to define (or at least declare) the new operator > before you use it. Perl 6, like Perl 5 compiles with a single pass, so > when you are using your random operator, it hasn't yet read the >

Re: Web development I: Web::Toolkit

2006-09-17 Thread Aankhen
On 9/17/06, Amir E. Aharoni <[EMAIL PROTECTED]> wrote: WordPress is an example of a webserver software tool that does try to produce standard XHTML. It does it by default and very few bloggers who use it care about it or, for that matter, notice it. FuturisticPerl6WebPackage.pm should be like tha

perl6 and a multi-interpreted-language example

2006-09-17 Thread William Herrera
Hi! I was wondering what a perl 6 program of a game of Reverse would look like? see http://e-scribe.com/news/193 Ruby (10 lines, 274 bytes) numbers = (1..9).sort_by{ rand } steps = 0 while numbers != numbers.sort puts numbers.join(" ") prin

perl6 and a multi-interpreted-language example

2006-09-17 Thread William Herrera
I just took a second glance at my post and saw the scoping error in the $steps variable. Please don't bother fixing it-- I want to know what a perl6 version would be like :)

Re: Web development I: Web::Toolkit

2006-09-17 Thread Juerd
Amir E. Aharoni skribis 2006-09-17 17:22 (+0300): > 17/09/06, Juerd <[EMAIL PROTECTED]> skribis: > > This is a very strict language, though, as it is based on XML. > > A document is either valid and unambiguous, or completely invalid. > Just like any programming language should be. X?HTML is not a

Re: perl6 and a multi-interpreted-language example

2006-09-17 Thread Juerd
William Herrera skribis 2006-09-17 13:45 (-0600): > Ruby (10 lines, 274 bytes) This is the nicest example, so I'll base my response off this one. my @numbers = (1..9).sort:{ rand }; my $steps = 0; while ("@numbers[]" ne "@numbers.sort()") { say "@numbers"; my $flipcoun

Re: Web development I: Web::Toolkit

2006-09-17 Thread Juerd
Aankhen skribis 2006-09-17 11:54 (-0700): > The point is not to have autogenerated code conform to the XHTML > standard. The point is to not use XHTML simply because it's shiny. That's a good point, but my point was different. XHTML should be a conscious choice, not a default, in a general purpo

Re: more on perl5 modules

2006-09-17 Thread A. Pagaltzis
* 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 exports. Methods are never exported. Why are you using the workaround for sub exports on methods. > Here is

Re: perl6 and a multi-interpreted-language example

2006-09-17 Thread A. Pagaltzis
* William Herrera <[EMAIL PROTECTED]> [2006-09-17 21:50]: > perl 5 (9 lines, 353 bytes) > > use FreezeThaw qw(cmpStr); > > my @a1_9 = (1 .. 9); > my @numbers = sort {rand(10) > $a} @a1_9; > > for (my $steps = 0; cmpStr([EMAIL PROTECTED], [EMAIL PROTECTED]); ++$steps) { >print join(" ", @num

Re: perl6 and a multi-interpreted-language example

2006-09-17 Thread Ilmari Vacklin
su, 2006-09-17 kello 20:36 +0200, Juerd kirjoitti: > while ("@numbers[]" ne "@numbers.sort()") { Should C be used here? while @numbers !eqv @numbers.sort { -- Ilmari Vacklin <[EMAIL PROTECTED]> signature.asc Description: Digitaalisesti allekirjoitettu viestin osa

Re: perl6 and a multi-interpreted-language example

2006-09-17 Thread Larry Wall
Okay, combining all these approaches minimalistically but without golfing we get something like: my @numbers = sort { rand }, constant @goal = 1..9; my $steps = 0; until @numbers ~~ @goal { say [EMAIL PROTECTED]; @numbers[ 0 ..^ prompt "Reverse how many? " ] .= reverse;