Re: Trying to make a new operator

2006-09-22 Thread Markus Laire

On 9/22/06, Richard Hainsworth <[EMAIL PROTECTED]> wrote:

Biggest problems are the following:
a) finding the symbols - I had to use two editors, and getting them to
show them on screen


Good place to see all of the symbols in Unicode is
http://unicode.org/charts/symbols.html (a lot of PDF-files there)

You could also try to find the proper symbol from
http://www.iam.uni-bonn.de/~alt/html/unicode_3.html
and then copy-pasting it to your editor.
This seemed to work for me with Firefox+KWrite after I changed the
encoding to UTF-8 (but my font didn't show all the symbols).


b) mixing types. My version of pugs does not respect the white space at
the start and end of strings. Also if the functions are given as <>, all the white space is excluded. Not sure if this is a
feature or a non-feature.


< text more text > creates a list, not a string, and is meant to
ignore the extra spaces because spaces are only used to delimit the
list-items.
(I'm not sure about <<...>>)

If you want to create strings, just use the quotes like here:

sub infix:<☥> {...};
sub infix:<☆> {...};
sub infix:<☺> {...};

(3 ☥ 40 ☆ 7 ☺ 50).say;

sub infix:<☥> ($l,$r) {
 return "The $l wise men spent $r days";
};

sub infix:<☆> ($l,$r) {
 return "$l following a star in the $r-th heaven";
};

sub infix:<☺> ($l,$r) {
 return "$l to become very happy for $r days and nights"
};

--
Markus Laire


Re: Trying to make a new operator

2006-09-22 Thread Richard Hainsworth

Steffen Schwigon wrote:


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

sub infix:<☥> {...};
sub infix:<☆> {...};
sub infix:<☺> {...};

(3 ☥ 40 ☆ 7 ☺ 50).say;

sub infix:<☥> ($l,$r) {
 ~ $l ~ < wise men spent > ~ $r ~ < days >
};

sub infix:<☆> ($l,$r) {
$l ~ < following a star in the > ~ $r ~ <-th heaven >
};

sub infix:<☺> ($l,$r) {
$l ~ < to become very happy for > ~ $r ~ < days and nights>
};


Biggest problems are the following:
a) finding the symbols - I had to use two editors, and getting them to 
show them on screen
b) mixing types. My version of pugs does not respect the white space at 
the start and end of strings. Also if the functions are given as <$l more text>>, all the white space is excluded. Not sure if this is a 
feature or a non-feature.


Richard



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

2006-09-22 Thread Fagyal Csongor

Randal L. Schwartz wrote:


""A" == "A Pagaltzis" <[EMAIL PROTECTED]> writes:
   



"A> * Randal L. Schwartz  [2006-09-20 19:30]:
 


"Fagyal" == Fagyal Csongor <[EMAIL PROTECTED]> writes:
 


yet I never needed those HTML generating methods.
   


You've never made a sticky form then.
 



"A> False dilemma. You can create sticky forms conveniently without
"A> using CGI.pm’s HTML generation stuff. You can use HTML::Template,
"A> HTML::FillInFrom, HTML::Widget, CGI::FormBuilder… should I go on?

"A> C’mon merlyn, you’ve been around long enough to know about CPAN
"A> and realise that your statement is transparently fallacious.

However, HTML::FillInForm, HTML::Widget, CGI::FormBuilder were *not*
in core.  CGI.pm was.  One stop shopping.  Easy to describe to people.

We need the same thing for Perl6: "If you're going to do simple web stuff,
please use MUMBLE module".  And MUMBLE better have tight integration of param
processing and sticky form generation, as well as good header generation for
cookies and redirects.  In other words, at least two thirds of what CGI.pm
does for me now.  And MUMBLE better be included *with* Perl6.

Without that, people will *hand code* that stuff, and get it wrong, and we'll
get the reputation of Perl6 being horrible for the web.


I am in favour of different bundles. Then you can, for example
yum install perl6-base
or
yum install perl6-web
or
yum install perl6-everything

You know what I mean. The diff between perl6-base and perl6-web is a 
bunch of (CPAN6) modules.


- Fagzal