Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2007-02-01

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:27 amnesiac joined perl6
00:52 mako132_ joined perl6
00:57 nipotaway is now known as nipotan
00:58 amnesiac joined perl6
01:07 amnesiac joined perl6
01:20 kisu joined perl6
01:38 Khisanth joined perl6
01:40 nusgnaf joined perl6
01:46 kanru joined perl6
02:03 putter joined perl6
02:06 putter We have token, rule, and regex.  And they are all... regexes??
02:06 lambdabot putter: You have 4 new messages. '/msg lambdabot @messages' to read them.
02:08 allbery_b token and rule let you sensibly and readably compose complex regexes from smaller parts.
02:08 allbery_b this is not a bad thing IMO
02:08 tene putter: they're just different default behavior.
02:10 allbery_b "just".  but the different defaults help make things more comprehensible
02:16 svnbot6 r15163 | putter++ | yet_another_rules_engine renamed yet_another_regex_engine.  Because rules don't backtrack, and it knows how to.
02:17 putter The problem lies in the same word being used for both a category, and a member of that category.  So you have "regex regexs", and "non-regex regexs".  Which seems unfortunate.  And worth improving somehow.
02:19 allbery_b I'd actually say regexes, regex components, and regex collections (regex, token, rule)
02:20 allbery_b maybe collections is the wrong word there
02:20 allbery_b packages?
02:20 allbery_b kinda overloaded
02:20 putter :)
02:21 allbery_b anyway tokens and rules a re conveniently packaged fragments of regexes
02:22 allbery_b the names suggesting their default behaviors ad therefore how they fit together when used in regexes or other fragments
02:23 weinig|away is now known as weinig
02:37 putter perl question - what is the right way to refer to Inf?
02:39 putter Data::Dumper dumps it as bareword inf .
02:39 tene ?eval [+] 1..Inf
02:39 evalbot_r15162 is now known as evalbot_r15163
02:39 evalbot_r15163 pugs: out of memory (requested 1048576 bytes)
02:40 putter (err, perl _5_;)
02:40 allbery_b not sure you can in p5
02:41 putter okay.  just wanted to make sure I wasn't clueless before I kludged in a  sub inf () { 1000**1000**1000 }.  blech.
02:42 tene ?eval 1000**1000**1000
02:42 evalbot_r15163 Inf
02:43 zgold joined perl6
02:44 luqui putter, 1e999 works
02:44 luqui that's what I usually use
02:45 dmq joined perl6
02:45 luqui except it bitches a warning, n
02:45 luqui m
02:49 tene What warning does it emit?
02:50 allbery_b hm, I get no warning
02:50 allbery_b (5.8.8, with -w)
02:53 zgold left perl6
03:00 putter thanks
03:08 davidfetter left perl6
03:12 REPLeffect_ joined perl6
03:24 cls_bsd joined perl6
03:24 justatheory joined perl6
03:24 bucky joined perl6
03:36 putter good night &
03:36 svnbot6 r15164 | putter++ | misc/pX/Common/yet_another_regex_engine - minor progress.  p5 re_tests 80% okay.  Performance problems.  See README.  Help welcome.
04:01 justatheory joined perl6
04:03 nusgnaf left perl6
04:07 kanru joined perl6
04:28 weinig is now known as weinig|zZz
04:30 mako132_ joined perl6
04:56 dduncan regarding 1000**1000**1000 , that should not be Inf, but Overflow or some such
04:56 dduncan as it is known to be finite
05:11 nipra joined perl6
06:13 BooK joined perl6
06:31 Khisanth joined perl6
06:36 mr_ank_ joined perl6
06:36 rfordinal joined perl6
06:44 rfordinal joined perl6
06:58 iblechbot joined perl6
07:04 REPLeffect_ joined perl6
07:06 leed joined perl6
07:09 marmic joined perl6
07:51 baest dduncan: shouldn't it continue to output numbers in that case? Don't what in the specs concerning this, but Inf is certainly wrong
08:01 dduncan true ...
08:02 dduncan Perl 6 has big integer support, so it should try to do the whole actual number until it runs out of resources ... unless some optional feature is used to explicitly limit resources, which would eventually make it stop gracefully
08:04 dduncan eg, someone could set an environment variable that says don't try to work with integers that take more than 10MB of memory to represent
08:04 dduncan then if that limit is reached, the error would fail with an Overflow exception or some such,
08:04 dduncan s/error would fail/operation would fail/
08:06 dduncan that said, it may be simpler for implementers to not bother with such limiters initially, and program lazily such that the program just tries using resources open-ended until it reaches some hard limit, and the programmers just have their own sanity checks to avoid asking for something unreasonable
08:06 dduncan the hard limit being the hardware of the machine
08:08 dduncan that is, the environmental variable I mentioned could be a feature added later on to Perl, that doesn't need to be in the first production release
08:08 dduncan my earlier point is that returning Inf is a bad response if we know that the result is finite
08:09 dduncan eg, Inf is good for div by zero, but not for multiply of large finite numbers
08:10 xern joined perl6
08:10 xern joined perl6
08:14 devogon joined perl6
08:22 tene ?eval 1/0
08:22 evalbot_r15163 is now known as evalbot_r15164
08:22 evalbot_r15164 Error: Illegal division by zero
08:22 tene Inf is much worse for div by zero than for 1000**1000**1000
08:23 tene You have a good point, but your example of a good use of Inf was... bad.
08:40 baest dduncan: i agree
08:44 dduncan tene, 1/0 is Inf ... zero goes into a non-zero finite number an infinite number of times
08:44 dduncan as to whether 1/0 raises an exception or returns Inf, I would expect that to be configurable by the user
08:44 baest except maybe for divide by zero. That should probably return undef or null
08:44 dduncan oh god no
08:45 dduncan returning undef or null is the worst thing you can do
08:45 dduncan it should either raise an exception or return Inf
08:45 baest or exeption. But as I read divide by zero isn't Inf for several reasons
08:45 luqui dduncan, what about negative inf?
08:45 dduncan so what mathematical operations do return Inf?
08:46 luqui if 1/0 = inf, then inf = 1/0 = 1/(-0) = -1/0 = -inf
08:46 dduncan if not div by zero
08:46 baest SUM(all naturals numbers)
08:46 nperez joined perl6
08:46 luqui [+] 1..*;  :-)
08:46 dduncan luqui, as per your question ...
08:46 luqui it will return inf, if you wait for it to finish
08:46 dduncan a negative num div by zero = -Inf, positive / 0 = +Inf
08:46 dduncan I would assume
08:47 luqui dduncan, but I just derived that the two are the same
08:47 luqui (that is the grounds on which I agree with baest)
08:47 luqui (the idea that 1/0 is inf, but not -inf, is preposterous)
08:47 dduncan well sure, raise an exception then
08:47 dduncan just returning undef/null is bad
08:47 dduncan returning fail/exception should be done
08:48 luqui yeah, that's not what undef is for
08:48 luqui on the other hand, POSIX thinks 1/0 is inf and -1/0 is -inf
08:48 luqui so there's something to be said for that
08:48 luqui (even if it's wrong, it's "predictable" in some sense)
08:48 tene Exception is the best solution.  Period.
08:49 dduncan afaik, Perl's nearest native concept to a SQL null is Undef, and its nearest equivalent to the null set is the empty set
08:49 luqui exclamation point!
08:49 tene Question mark?
08:49 tene Comma,
08:49 dduncan I would argue, exception by default, but user can configure to have it return Inf or something with a module or pragma
08:49 luqui perl code $#$%
08:49 tene hehe :D
08:50 luqui I guess
08:50 luqui configurability is...
08:50 luqui overrated imo
08:50 luqui it makes it harder to implement a fast runtime
08:50 luqui and it makes it harder to get used to new environments (but that's why you put the pragma at the top)
08:50 dduncan but some users expect an Inf result ... the IEEE float has it built-in as a value for a reason
08:51 luqui then if $denom == 0 { return Inf }
08:51 tene I really doubt there's much value in configuring the response to div-by-zero
08:51 tene If you want to do something special with div-by-zero then check for zero yourself, or catch the exception
08:52 tene dduncan: They really *shouldn't* be expecting that result, because it's wrong.
08:52 dduncan or perhaps an unboxed num math will return unboxed num value Inf, while boxed Num math will throw an exception
08:52 dduncan regardless, I agree that an exception should always be the default, if it is even configurable
08:56 drrho joined perl6
08:59 nipra joined perl6
09:04 explorer joined perl6
09:19 Aankhen`` joined perl6
09:21 andara joined perl6
09:29 ruoso joined perl6
09:34 DebolazX joined perl6
09:38 kolibrie joined perl6
09:38 stef_ joined perl6
09:38 cognominal joined perl6
09:39 explorer joined perl6
09:39 nipotan joined perl6
09:39 masak joined perl6
09:39 fridim joined perl6
09:39 revdiablo joined perl6
09:39 spo0nman joined perl6
09:39 dduncan joined perl6
09:40 elmex joined perl6
09:42 takanori joined perl6
09:43 knewt joined perl6
09:43 cookys joined perl6
09:47 buetow joined perl6
09:47 pbuetow joined perl6
09:50 mr_ank_ is now known as mr_ank
10:28 Juerd Dutch Perl Workshop, Friday March 16: http://www.perlworkshop.nl/ (CFP real soon now)
10:28 lambdabot Title: Nederlandse Perl Workshop 2007 - Nederlandse PerlWorkshop
11:02 chris2 joined perl6
11:08 kanru joined perl6
11:12 Aankh|Clone joined perl6
11:14 nipotan is now known as nipotaway
12:11 dduncan left perl6
12:14 * cognominal manque de pratique en perl 5
12:14 cognominal quelle est la syntaxe la plus elegante pour une tranche de reference de hash?
12:14 cognominal oops
12:15 andara left perl6
12:23 TimToady joined perl6
12:38 weinig joined perl6
12:41 shay|army joined perl6
12:44 cognominal what is the Perl 6 equivalent of   @{$hashref}{  qw( key1 key2 ) }   ?
12:45 Psyche^ joined perl6
12:45 Psyche^ is now known as Patterner
12:45 wolverian $hashref<key1 key2>
12:46 wolverian I suppose it should be called $hashcap :)
12:47 cognominal thx
12:47 wolverian I wish purl was here to be sarcastic on you
12:47 wolverian :)
12:53 xinming_ ?eval my $h = (a => 1, b => 2); $h<a b>;
12:53 evalbot_r15164 Error: Cannot cast into Hash: VRef <Array:0xb7a9b378>
12:53 xinming_ ?eval my %h = (a => "hello", b => "world"); %h<a b>;
12:53 evalbot_r15164 ["hello", "world"]
12:54 xinming_ ?eval my %h = (a => "hello", b => "world"); my $href = %h; $href<a b>;
12:54 wolverian ?eval my $h = { a => 1, b => 2 }; $h<a b>
12:54 evalbot_r15164 ["hello", "world"]
12:54 xinming_ ?eval my %h = (a => "hello", b => "world"); my $href = %h; $href<a b>;
12:54 * wolverian pokes evalbot_r15164
12:54 evalbot_r15164 [1, 2]
12:54 wolverian here we go.
12:54 evalbot_r15164 ["hello", "world"]
12:54 xinming_ hmm,
12:55 * xinming_ forgot the { } >_<
12:55 b00t joined perl6
13:00 REPLeffect_ joined perl6
13:15 Azure-BOT joined perl6
13:15 Limbic_Region joined perl6
13:17 explorer joined perl6
13:18 Limbic_Region any sun/solaris weenies about - need to know how to reset a prom passwd - apparently pulling the eprom and watch battery don't cut it
13:51 cjfields joined perl6
14:01 vel joined perl6
14:06 hoowa joined perl6
14:06 hoowa audreyt ?
14:06 wolverian @seen audreyt
14:06 lambdabot audreyt is in #perl6, #ghc and #haskell. I don't know when audreyt last spoke.
14:07 hoowa yes
14:07 wolverian just checking if she's spoken recently :)
14:07 wolverian (apparently not)
14:07 hoowa i am hoowa from perlchina
14:08 hoowa new party in beijing
14:08 hoowa thank u
14:08 iblechbot joined perl6
14:11 [particle] joined perl6
14:12 hoowa left perl6
14:14 jabbot joined perl6
14:23 GabrielVieira2 joined perl6
14:39 shay|arm1 joined perl6
14:47 integral_ joined perl6
14:50 GabrielVieira2 is now known as GabrielVieira
14:53 Psyche^ joined perl6
15:04 bonesss joined perl6
15:06 baest joined perl6
15:07 Psyche^ is now known as Patterner
15:11 justatheory joined perl6
15:25 kisu joined perl6
15:45 baest joined perl6
15:45 thepler joined perl6
16:03 integral_ is now known as integral
16:12 hexmode joined perl6
16:30 cdfh joined perl6
16:53 REPLeffect_ joined perl6
17:05 justatheory joined perl6
17:08 buetow joined perl6
17:15 kisu left perl6
17:17 ayrnieu joined perl6
17:20 kanru joined perl6
17:32 bernhard joined perl6
17:34 ashleyb putter: tell me about yet_another_regex_engine, what's it's goals?  What's it written in? How does one help?
17:35 ashleyb putter: what's it's history?
17:47 Lorn joined perl6
17:52 TreyHarris joined perl6
18:01 gaal putter: ping
18:10 ruz joined perl6
18:59 audreyt joined perl6
19:01 justatheory joined perl6
19:01 justatheory joined perl6
19:06 macli joined perl6
19:24 justatheory_ joined perl6
19:59 tulpe joined perl6
20:05 justatheory joined perl6
20:28 explorer joined perl6
20:32 Aankhen`` joined perl6
20:45 TimToady just killed off filetest operators!
20:47 PerlJam indeed.
20:47 PerlJam I'm not sure if I should rejoice or not though
20:47 PerlJam replacing them with pairs seems like it could cause confusinon
20:47 PerlJam er, confusion
20:47 PerlJam but I haven't thought too much about it yet.
20:49 [particle] well, it hoists the problem up out of the parser, anyway
20:49 TimToady it fixes a lot of parsing problems
20:49 TimToady -x is now unambiguously - x()
20:50 [particle] does it mean there are reserved keys for pairs now?
20:50 TimToady it will assume there is an x sub declared, and if there isn't one by the end of the compunit, will complain, so I think most p5 brainos will be caught
20:50 TimToady no
20:50 [particle] just reserved on filehandles
20:50 TimToady it just reflects back to the object via .PAIR(:x)
20:51 TimToady rather .TEST
20:51 TimToady and Str and IO just happen to define that to do file tests
20:51 TimToady but it's general
20:51 TimToady so you can basically test any type for what it thinks of a pair.
20:52 PerlJam bare pairs always turn into .TEST(:x) ?
20:52 TimToady and the definition of that belongs to the type
20:52 TimToady no
20:52 TimToady only in smartmatch context
20:52 TimToady when :w & :x
20:52 [particle] $obj ~~ :something ==> $obj.TEST(:something)
20:53 TimToady basically
20:53 PerlJam Hmm
20:53 TimToady but useful in switches without .TEST all over the place
20:53 [particle] smartmatch syntax is definitely prettier
20:53 PerlJam There's still something nagging me about it, but I don't know what.
20:53 TimToady basically any type can choose to respond to "when :foo"
20:54 [particle] it's one less thing that reminds you of perl 5?
20:54 PerlJam [particle]: no, that's not it.
20:54 PerlJam perl6 still firmly has the perl spirit even if the clothes are slightly different
20:55 TimToady one slight bother is that "when :r :w" doesn't necessarily dwim
20:55 TimToady since a List is defined to match like an Array
20:55 TimToady and :r :w is defined as (:r, :w) in that context
20:56 TimToady so they either need :r & :w, or they need to say "when all :r :w"
20:56 TimToady but that's probably another error we can give a decent warning on.
20:57 [particle] looks like -- and junctional syntax is everywhere now
20:57 [particle] damian started that with Q::E so long ago, any() and all() are well within most perlers' vocabularies
20:57 * PerlJam still hears conjunction junction play in his head whenever people talk about perl 6 junctions
20:58 * [particle] is currently reading "Parsing Techniques - A Practical Guide" -- great read!
20:59 araujo joined perl6
21:04 larsen_ joined perl6
21:08 rindolf joined perl6
21:09 rindolf Aloha everybody.
21:12 xdg joined perl6
21:16 larsen__ joined perl6
21:23 shay joined perl6
21:36 avar joined perl6
21:36 * tene tries to forget PerlJam's statement in hopes of avoiding the same affliction.
21:37 knewt joined perl6
21:55 allbery_b joined perl6
22:04 Alonso joined perl6
22:05 Alonso come on. why aer you banning me. it's ficking annoying
22:05 Alonso am I too smart or what?
22:06 tene Eh?
22:06 Alonso someone banned me from perl
22:07 Alonso when I was not even on the line
22:07 [particle] #perl on irc.perl.org?
22:07 Alonso #perl
22:07 [particle] different crowd here
22:07 Alonso what is irc.perl.org?
22:07 tene Why don't you... uh... talk with the person who banned you?
22:07 ofer0 Alonso, magnet
22:07 tene Alonso: a different IRC server.
22:08 Alonso how can I see who banned me?
22:08 tene because you were in the channel when it happened.
22:08 Alonso tene: ok
22:08 Alonso and sorry about my yelling
22:08 tene #perl6 is a different crowd than #perl
22:08 Alonso thought you were the same crowd
22:09 ofer0 Alonso, Chris62vw banned you @ Fri Jan 26 00:33:47
22:09 Alonso nice cover btw (that http://chewie.f2o.org/etc/perl.png)
22:11 Alonso ofer0: thnx. just dropped him a msg
22:11 Alonso just because I talked about fpga in relation with perl or somthn. what a pussy
22:15 Alonso #perl6 is more "alive" than #perl?
22:16 ofer0 Alonso, no, there are about 1/3 of the people that they got there
22:18 Alonso perl6 is ready already?
22:18 Alonso any nice into websites?
22:18 ofer0 nothingmuch, p6 isn't ready yet.
22:18 Alonso *intro
22:19 ofer0 but you can still use it if you want to
22:19 Alonso are you discussing syntax and server vs. client side stuff and such?
22:20 ofer0 we discuss a lot of stuff
22:20 Alonso cool. may I chill out here for a while and check it out?
22:21 ofer0 are you asking me for permission? it's an open channel :)
22:22 Alonso it's just that I feel really welcome in #perl too but then I get banned by old dragons or what to call them ops or wth he he heh
22:23 Alonso kk. I'm just chillin then.
22:24 Alonso (what a feature)
22:24 dduncan joined perl6
22:26 [particle] joined perl6
22:42 Alonso in perl6 how would I write something like:  my $signature = $user->signature ? $user->signature : 'unknown'; in a prettier manner?
22:44 Alonso can I somehow ommit to say $user->signature two times?
22:47 wolverian you want the // operator
22:47 wolverian (defined-or; it'll be in perl5.10 too)
22:48 wolverian that is, my $signature = $user.signature // "unknown";
22:48 wolverian (or s/\./->/ if it's perl5.10)
22:48 Alonso where would I look up that in the perldoc?
22:49 wolverian perldoc only documents perl5. for perl6's specification, see spec.pugscode.org, specifically Synopsis 3
22:49 wolverian for perl5.10's docs, you'll have to first download the current 5.9 snapshot and then read perldoc perlop, I assume.
22:50 wolverian (I don't recommend the latter course, unless you're feeling very adventurous :)
22:51 Alonso can I say my $signature = $user.signature // "unknown"; in perl v5.8.7 also?
22:51 dduncan you don't have to download any 5.x of Perl to read its docs ... those are htmlized and online
22:51 wolverian no. 5.10 will be the first perl5 to have the defined-or operator.
22:52 ashleyb for that you want 'my $signature = ($user->signature || 'unknown);
22:52 wolverian dduncan, true enough.
22:52 wolverian http://search.cpan.org/~rgarcia/perl-5.9.4/pod/perlop.pod#C-style_Logical_Defined-Or__
22:52 lambdabot Title: NAME operator - search.cpan.org, http://tinyurl.com/2fn4zz
22:52 diotalevi Alonso, hmbrand (I think) also ported the // operator back to a bunch of the 5.8.x perls.
22:52 * Alonso is scanning that official perl 6 documentation
22:52 dduncan I'm looking forward a lot to 5.10, for various reasons
22:53 dduncan not only because it has some nice 6-ish goodness, but because it bundles a lot of modules that people commonly use all the time as dependencies of other distros ... eg, version.pm, Module::Install, CPANPLUS
22:54 wolverian yes.
22:54 diotalevi But you said $user->signature ? $user->signature : 'unknown' which is just boolean or which you already have in ||/or.
22:54 dduncan then we don't have to see all those distros that bundle copies of Module::Install because they want to bootstrap with it ... and we don't have to first go through the complicated process of installing CPANPLUS to use it instead of CPAN
22:55 diotalevi So in perl 5 you'd say C<< my $signature = $user->signature || 'unknown' >>.
22:55 wolverian except now the signature can't be "0", so you probably don't want to use that approach at all, and is the whole point of //.
22:55 diotalevi wolverian: or ''.
22:56 wolverian or that, yeah.
22:56 diotalevi or any objects with overloading that tells them to be false.
22:57 Alonso can I ommit the paranthesis in my $signature = ($user->signature || 'unknown');
22:57 wolverian or 1e-512 :)
22:57 Alonso can I ommit the paranthesis like my $signature = $user->signature or 'unknown'; ?
22:57 wolverian Alonso, see perldoc perlop for the precedence levels.
22:57 wolverian || is tighter than = is tighter than 'or'.
22:58 diotalevi See http://www.cpan.org/authors/id/H/HM/HMBRAND/ for the dor-* patches. This adds // to all 5.8.x perls.
22:58 lambdabot Title: Index of /authors/id/H/HM/HMBRAND
22:59 * Alonso just wrote my first CMS in perl :) really great gory details I must say :)
22:59 wolverian sounds nasty ;)
22:59 Alonso nasty and lively
23:02 Alonso and btw it's matching the colors in my version of vim which is red in the scalars
23:04 Alonso (my version/the gNS version)
23:07 wilx` joined perl6
23:07 explorer joined perl6
23:09 * Alonso would like to use perl on my mobile phone
23:10 Alonso (instead of JAVA)
23:11 Alonso s/instead of/in addition to/
23:11 qmole_ that'd be handy
23:11 qmole_ sort of like a swiss army chainsaw-phone
23:12 Alonso yea. then I wouldn't ahve to bother with JAVA stuff ;-D
23:13 rfordinal joined perl6
23:14 * Alonso hacked the firmware of many mobile phones some years ago
23:15 Alonso in the days they werent ready to use perl
23:15 Psyche^ joined perl6
23:20 wilx joined perl6
23:24 Psyche^ is now known as Patterner
23:26 Alonso perl6 is written in perl6 ?
23:26 TimToady will be
23:26 TimToady at least the parser
23:27 Alonso amazing
23:27 TimToady what, that a text processing language should be able to do text processing?
23:28 Alonso maybe some EDA client should optimize it further for uVersions :-?
23:29 Alonso I mean modern CPUs are designed for C++ aren't they?
23:35 Alonso perl ftw
23:36 Alonso I mean what cpus are embedding a hash stack he he heh
23:40 Alonso nice project pals. im off for now. talk to you later
23:48 audreyt TimToady: love the ~~:e syntax. finally a sane treatment.
23:57 weinig is now known as weinig_
23:57 weinig_ is now known as weinig

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo