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