Re: Perl grammar for Perl5 -> Perl6

2005-12-08 Thread Christian Renz

Is there such a Perl5->Perl6 translator underway?


I started toying with one, but didn't get very far yet. PPI (on CPAN)
would be a good way to start, but it needs to be extended to be used
as a Perl5->Perl 6 translator.

Greetings,
   Christian

--
[EMAIL PROTECTED] - http://christian.web42.com - http://www.web42.com/crenz/ 


"If the Creator really did write himself into his own story, that's
what we ought to expect to see. Creative solutions. And this
creativity is intended to be transitive. We are expected to be
creative. And we're expected to help others be creative."  -- Larry Wall


Re: Perl 6 fears

2005-10-24 Thread Christian Renz

Feel free to add your own, or fears you heard about!


Fear: Perl 6 will not attract enough interested developers and
companies to gain momentum. People will continue to be excited about
digital watches and PHP 5.

Regards,
   Christian

--
[EMAIL PROTECTED] - http://christian.web42.com - http://www.web42.com/crenz/ 


"If God were a Kantian, who would not have us till we came to Him from
the purest and best motives, who could be saved?"
   -- C.S. Lewis, The Problem of Pain


Re: State of Design Documents

2005-06-15 Thread Christian Renz

Not really, except insofar as we've talked about compact classes of
native types working like C structs.  There are lots of nitty things
we can fix with pack/unpack, but the basic underlying problem is
that pack/unpack are defined operationally rather than declaratively.


I think it's worth taking a look at Marcus Holland-Moritz'
powerful Convert::Binary::C ( http://search.cpan.org/dist/Convert-Binary-C/ ). 
It already offers a way to declaratively convert to/from binary

data, which could serve as inspiration for a similar Perl6 interface.

Greetings,
  Christian Renz

--
[EMAIL PROTECTED] - http://www.web42.com/crenz/ - http://www.web42.com/

"If God were a Kantian, who would not have us till we came to Him from
the purest and best motives, who could be saved?"
   -- C.S. Lewis, The Problem of Pain


Re: P6ML?

2003-03-25 Thread Christian Renz
of crap known as XSL.  An XML-based derivative that performs XML 
transformations, allowing/using embedded P6 regexs, closures, etc., and 
able to more easily translate XML <==> P6 data.
I'm still quite XML-phobic, but I see the need for strong XML support
in Perl 6. However, I'd like to work with XML in Perl 6 in a way that
I don't even notice it's XML. Would it be possible to come up with an
interface to XML that is at least as intuitive as tie is for
hash<->DBM file? And that can cope with megabyte-sized XML files?
In fact, if we're talking about data storage only, it would be
interesting to have such a tie that allows me to store my data in an
XML file, YAML file, SQL database etc.
XML transformations sounds to me like it would be useful to be able to
transform data that is structured according to one grammar into
another grammatical structure. (Please excuse my long sentences.) Is
that already possible with Perl 6 Grammars? (Please excuse my
ignorance.) If yes, we might even think about an C-to-Intercal
translator. (Please excuse me, Dan.)
creating a P6-specific companion to ASP/JSP/PHP, but one that's
substantially more OO in nature...
Although it doesn't end in P, I'd add Zope to that list. Definitely
sounds like a killer-app for Perl 6. 

Greetings,
  Christian
--
[EMAIL PROTECTED] - http://www.web42.com/crenz/ - http://www.web42.com/
"No Christian and, indeed, no historian could accept the epigram which
defines religion as 'what a man does with his solitude.'"
   -- C.S. Lewis, The Weight of Glory


Re: Apocalypse 6: Possible file-transfer glitch?

2003-03-10 Thread Christian Renz
It survived a few refreshes, so I wonder if it's a file-transfer
problem?
No, Larry is just presenting additional proof that we need Unicode
operators in Perl 6 by using them in English, too. :)
Greetings,
  Christian
--
[EMAIL PROTECTED] - http://www.web42.com/crenz/ - http://www.web42.com/
"The human mind has no more power of inventing a new value than of
imagining a new primary color, or, indeed, of creating a new sun and a
new sky for it to move in."  -- C.S. Lewis, The Abolition of Man


Re: AW: "my int( 1..31 ) $var" ?

2003-01-04 Thread Christian Renz
Now, I might be stupid, but I keep asking myself what you would need a
property for in this example. To me, it totally confuses the
underlying structure. When was the last time you asked an integer to
identify itself as a valid credit card number? 

It is _not_ a property of the integer that it is a valid cc number,
rather it happens that it will be accepted as valid _by a certain
authority_. So why not go and ask the authority? Compare the case to a
phone number -- the phone number itself doesn't know if its valid. You
could only check a certain format (if e.g. in the USA, in Germany,
that would be very hard). To check the validity, query a directory
server or ask a phone to dial the number. Don't check the number
itself.

To provide even stronger evidence against using properties, consider
the fact that a credit card number will only be accepted with an
expiration date and -- with good merchants -- the three or four-digit
security code on the back of the card. Now you're up to doing
something like

   # funky syntax ahead
   my $cc = [ num => "8765 4321", expdate => "0799", code => "123" ];
   # do magic
   # ...
   print "I'm rich!" if $cc.prop{CreditCard("CAMELCARD")};

Ouch! I may be conservative, but again I think you should go and ask
the authority (ie., a validation service). The authority in this case
probably is already encapsulated in a CPAN module and could look like
this:

   use CreditCard::Validation;
   deduct(10_000_000) if validate($number, $expdate, "PERLIAN EXPRESS");

or something like

   use CreditCard::Validation qw(ISA CAMELCARD MONKSCLUB);
   deduct(10_000_000) if validate($number, $expdate, $bankcode);

depending on your tastes. Yep, it doesn't use funky perl 6 syntax, but
it SWIMs (Says What I Mean, ie. it is readable).

Greetings,
  Christian

--
[EMAIL PROTECTED] - http://www.web42.com/crenz/ - http://www.web42.com/

"If God were a Kantian, who would not have us till we came to Him from
the purest and best motives, who could be saved?"
   -- C.S. Lewis, The Problem of Pain


Re: 'while <> {' in Perl 6

2002-08-09 Thread Christian Renz

>I was wondering whether the Perl 'while (<>){' idiom will continue to
>be supported in Perl 6?

Actually, I once found myself wondering why while doesn't set $_ all
the time anyway... It would be nice to do things like

while ($iterator->each()) { ... }
while (query->nextResult()) { ... }

Setting $_ would be just what I would expect perl to do, only that it
doesn't do it.

Greetings,
   Christian

-- 
[EMAIL PROTECTED] - http://www.web42.com/crenz/ - http://www.web42.com/

"Thirty was so strange for me. I've really had to come to terms with
the fact that I am now a walking and talking adult."  -- C.S. Lewis



split suggestion

2002-08-02 Thread Christian Renz

perl 5 already does that:

print "'$_' " foreach split /(=)/, "rank=?";
print "\n";
print "'$_' " foreach split /\s*(=)\s*/, "rank = ?";
print "\n";

# Output:
# 'rank' '=' '?'
# 'rank' '=' '?'

Greetings,
   Christian

-- 
[EMAIL PROTECTED] - http://www.web42.com/crenz/ - http://www.web42.com/

"Faith (...) is the art of holding onto things your reason has once
accepted, in spite of your changing moods."  -- C.S. Lewis, Mere Christianity