»ö« | perl6.org/ | nopaste: paste.lisp.org/new/perl6 | evalbot usage: 'perl6: say 3;' or rakudo: / pugs: / std: , or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by wolfe.freenode.net on 30 October 2009.
00:13 cotto joined 00:22 Guest5971 left 00:24 SmokeMachine joined 00:32 colomon joined, colomon_ joined 00:36 lestrrat is now known as lest_away 00:40 wormphlegm left 00:47 Exodist joined
pugs_svn r29431 | lwall++ | [S01] take another lap around Mt Sinai... 00:50
chromatic I've been to Mt. Sinai. You need a beard. 00:52
00:52 patspam left 00:53 bryan[c1] joined, ejs joined 00:57 Traveler joined, soupdragon joined, Traveler is now known as Guest82974 01:03 colomon left, colomon_ left 01:08 patspam joined 01:14 patspam left 01:18 Guest82974 left 01:19 bcat joined
pugs_svn r29432 | diakopter++ | redaction; see r29431 01:22
01:36 cognominal left 01:37 simcop2387_ is now known as simcop2387, bryan[c1] left 01:40 kst joined 01:55 mberends joined 01:57 bryan[c1] joined, old_gray_bear joined 01:59 old_gray_bear left 02:00 old_gray_bear joined 02:01 old_gray_bear left, shachaf joined 02:04 bcat left 02:05 shachaf left 02:34 justatheory left 02:36 chromatic left 02:50 cls_bsd joined 02:52 bcat joined 03:00 Wolfman2000 joined 03:09 bryan[c1] left 03:10 au9ustine joined
au9ustine perl6: say 3; 03:11
p6eval elf 29432, pugs, rakudo db84bc: 3␤
soupdragon perl6: don't say 3; 03:12
p6eval pugs: *** ␤ Unexpected "'"␤ expecting "::", dot, ":", "(", term postfix or operator␤ at /tmp/d9yFEEEpai line 1, column 4␤
..rakudo db84bc: 3␤Could not find non-existent sub don't␤in Main (file src/gen_setting.pm, line 324)␤
..elf 29432: Parse error in: /tmp/GxOC8BTxGH␤panic at line 1 column 0 (pos 0): Can't understand next input--giving up␤WHERE: don't say 3;␤WHERE:/\<-- HERE␤ STD_red/prelude.rb:99:in `panic'␤ STD_red/std.rb:76:in `scan_unitstopper'␤ STD_red/std.rb:224:in `comp_unit'␤ STD_red/std.rb:210:in
..`_UNIT'␤ …
03:13 au9ustine left
diakopter ok.. 03:14
03:23 ejs left 03:42 wolf2k_ubuntu joined 03:52 jferrero left 04:00 am0c joined 04:04 bcat left 04:22 cbk joined 04:23 bryan[c1] joined 04:30 dduncan joined
dduncan I have a question about terminology in either programming languages or maths, with respect to intervals such as what Perl 6 calls the Range ... 04:32
specifically, I wondered what the more proper or understandable terms are to distinguish what I call a continuous vs discontinuous range ...
by continuous I mean eg {1..10} and by noncontinuous I mean eg {1..3,6,8..9} 04:33
basically, what would be the best terms to use to distinguish those 2 examples I gave?
I'm also talking about intervals in a type-agnostic manner ... eg they may be over numbers or dates or strings or whatever 04:34
04:38 Baggio_ joined, soupdragon left
araujo just released his small language! 04:43
code.google.com/p/jotstack
04:44 bryan[c1] left 04:48 soupdragon joined 04:54 meppel joined 04:56 colomon joined, colomon_ joined
colomon TimToady++ 04:58
slavik Happy New Year! 05:00
wolf2k_ubuntu same
05:10 meppl left
colomon Happy New Year indeed! 05:11
xinming Happy new year to all. 05:12
cbk Happy New Year, Perl6 you guys are great and I wish you all the best with perl6! 05:19
Tene You too!
cbk thanks. 05:20
05:22 Baggio_ left 05:25 _jaldhar left, jaldhar_ joined 05:31 jaldhar_ left 05:32 jaldhar_ joined 05:44 soupdragon left 06:14 xenoterracide left 06:26 Baggio_ joined 06:27 wolf2k_ubuntu left 06:36 wormphlegm joined 07:06 stephenlb left
spinclad dduncan: well, your noncontinuous example isn't currently called a Range or an interval... so interval and non-interval, or Range and non-Range. 07:23
s/currently// 07:24
dduncan ignoring what the Range of Perl 6 represents ...
what is a good name for the 2 different set-like constructs that are expressed and stored in terms of interval endpoints?
is what I was trying to determine 07:25
ideally, I would be able to say {1..10} is a "foo quux" and that {1..2,4..5} is a "bar quux" ... 07:26
or alternately that the first is a "foo" and the second is a "bar"
spinclad but your second example isn't expressed as an interval, with interval endpoints; it's a construct composed of intervals and points
dduncan something that distinguishes the 2 from each other, and the latter from things that aren't the latter
spinclad interval and non-interval 07:27
dduncan the {1..3,6,8..9} should be read as {1..3,6..6,8..9}
spinclad ok
dduncan its a shorthand
spinclad interval and Borel set? (looking up definition...) 07:28
dduncan so my real question is, what does one call a {1..2,4..5} ?
its fairly unambiguous that a {1..10} is an "interval"
I suppose I could call it an "interval set"
maybe that is best 07:29
but I thought maybe there was another term out there to mean what a {1..2,4..5} is
considering how often such a piece of data is used
spinclad (Borel set is made of intersections of unions of intervals, or vice versa, i forget now) 07:30
union or sum of intervals
dduncan thanks for the lead 07:31
a union of arbitrary intervals is the sort of thing I'm looking for
looking ...
spinclad i expect Borel set is both too specific and quite a bit fancier than what you're looking for 07:32
used in analysis, for defining foundations for integration and such 07:33
dduncan I'll look it up anyway, out of curiosity 07:34
spinclad and for defining measurable sets and such like -- not my specialty but i got some exposure
dduncan I will note that my base interval in question is for all intents and purposes the same as Perl 6's range ... it can do both open and closed intervals, and supports +/-Inf, and is base type generic 07:36
and the other one is a set of those, which is allowed to be the empty set
that also means its basically one-dimensional 07:37
so maybe or maybe not Borel applies ... at first glance it seems multi-dimensional
spinclad i expect an analyst would call [0,1) x [0,1) simply a 2-dimensional interval (that is, 0..^1 X 0..^1 in Perl 6 terms, though the X is not quite right) 07:40
so fancier than you're looking for, but coinciding over your domain of interest. 07:41
Borel similarly applies in a 1-d domain 07:42
but you don't need infinite unions or intersections, and so don't need intersections at all... so unions of intervals sounds right 07:43
(finite unions)
(at :2nd place) 07:44
dduncan the set of intervals I am thinking of would have a finite number of set elements, but each element may represent an infinite number of points, such as if written over rationals
operations on them would be similar to operations on sets
spinclad sure, each element is an interval
dduncan I'm thinking for now I may just call the larger thing "interval set" or "interval union", thinking probably the latter now 07:45
spinclad (and 1..3,2..4 can be simplified to 1..4)
dduncan exactly
spinclad sounds good
dduncan while "borel" at al sounds fancy, I'm hesitant to use something I don't understand enough, as people who know more than me might be confused by it 07:46
or people that know less
an expert can always recommend a rename later
spinclad, thank you for your help
spinclad you don't need borel, it's the wrong concept
dduncan but between the 2 options, set vs union, which reads better or sounds more accurate?
I consider the thing to be a generalization of a set ... 07:47
spinclad union, to me; it's more specific how they're combined.
dduncan that can represent infinite values in finite memory
while union seems to describe a bit more an interpretation
or concept
but I'll go with union I think, which you seem to think better 07:48
spinclad i consider intervals and interval unions on the same level, both being sets of points
dduncan, you're welcome 07:49
happy to help
07:49 rachelBROWN left
dduncan and over here the year will tick over in 11 minutes, so happy new year 07:49
07:50 rachelBROWN joined
spinclad over here, 3 hours old; happy new year to you too. may the year be good to you. 07:52
and i wish all on #perl6, and all Perl people (both 5 and 6) a Happy New Year! may the new year bring us joy, and happiness, and peace. 08:10
08:13 Baggio_ left 08:23 iblechbot joined 08:27 Baggio_ joined
dduncan yes, we can't have enough peas 08:33
08:37 Baggio_ left 08:39 wormphlegm left 08:44 soupdragon joined 08:51 am0c left 08:57 jge joined, jge left 09:11 dduncan left 09:20 Baggio_ joined 09:48 eternaleye joined 09:54 Su-Shee joined
Su-Shee good morning 09:55
soupdragon hi
10:13 abra joined 10:34 abra left 10:54 abra joined 10:55 iblechbot left 10:56 eternaleye left 11:12 eternaleye joined
pugs_svn r29433 | unobe++ | * Start Spec/Coverage.pm by explaining its purpose/goals 11:21
r29433 | new file: Coverage.pm
r29433 | new file: TODO
11:39 Baggio_ left 11:40 Baggio_ joined 11:41 Baggio_ left, eternaleye left, Baggio_ joined 11:45 abra left 11:54 Baggio_ left 12:02 xenoterracide joined 12:12 Baggio_ joined 12:40 Chillance joined 12:46 kaare joined, kaare is now known as Guest35397 12:57 Baggio_ left 13:12 eternaleye joined, eternaleye left 13:14 eternaleye joined 13:33 am0c joined 13:54 khurt joined 13:55 khurt left, khurt joined
khurt The "www.perl6.org/" web site suggested that this IRC was the place to hangout and get more information perl 6. How does this work? This place seems abondoned. 13:57
diakopter khurt: hi!
mberends khurt: sorry, I was dozing a little. How can we help?
13:59 diakopter_ joined
khurt It's been awhile since I tracked the progress of Perl 6 and it seems that nothing is ready for prime time. I am not a computer science major and most of the information I have found seems to be written from the point of view of language developers. What is avaiable for a long time perl 5 developer who just want to understand what is what and how is it useful? 13:59
14:00 diakopter_ left
mberends for just reading, the Perl 6 Advent is a nice view of what's possible perl6advent.wordpress.com/ 14:01
we are mainly builders here, but we love eager early adopters too and give them plenty of help 14:02
khurt I read the advent and could follow most of the "language science" jargon. I had to look up the word advent. :) I found this: en.wikibooks.org/wiki/Perl_6_Progra...Structures to be more useful. 14:03
Perl 6 seems like another language all together. Not really perl. More like Java/Python/C++.
mberends many people adopt that viewpoint, it's one valid perspective. But it is *very* Perlish. 14:04
diakopter khurt: may I ask what sorts of things you tend to use Perl for (just broad categories here: web, systems, science, etc)
khurt A lot of the doco seems to be written in the language of computer science language/compiler majors. I use perl to build system level utilities and web sites but mostly to analyse very large logs and data sets I'm an information security analyst for a biopharma. 14:06
I have been using Perl since about 1997 and have almost every O'Reilly book on Perl (but not all of them). 14:07
diakopter :)
mberends khurt: you'll like Perl 6 regexes then
14:08 iblechbot joined
khurt Taking a look at the wiki for that now. I love regexes. Can't live without them. :-). I keep reading about Rakadu. Is that something I can use right now to get an understanding of how things work? I learn best by doing. 14:09
diakopter I can see how a transition from linguistically-focused to language-oriented programming increases the "language science" jargon
mberends khurt: yes, that's a good way to get started. And on most days there are plenty more helpers around. 14:10
diakopter khurt: also, you can try it out, synchronously, here on the channel
if you're accustomed to the fancier 5.10 regex features, I don't think those are implemented yet. 14:12
khurt: you can download a build (or build from source) of rakudo at rakudo.org/download 14:13
khurt @diakopter: What do you mean by "you can try it out, synchronously, here on the channel"?
diakopter I mean
mberends khurt: another nice book is cloud.github.com/downloads/perl6/bo...009-12.pdf 14:14
diakopter rakudo.org/how-to-get-rakudo
khurt: the p6eval bot responds to rakudo: do { }; and std: do { }; and others 14:15
std: //
p6eval std 29433: ===SORRY!===␤Null regex not allowed at /tmp/WnuBeeCQ6V line 1:␤------> //⏏<EOL>␤FAILED 00:01 106m␤
khurt @mberends: Thanks for that link! I think this is what I am looking. The "how to speak" book. What I felt I had found so far was more akin to a discussion of "What is English" versus "Learn English". 14:16
diakopter (also, you can message p6eval directly if you don't want others to see your inputs 14:17
)
14:17 diakopter_ joined
mberends rakudo: my $visitor="khurt"; say "howdy, $visitor"; 14:17
p6eval rakudo db84bc: howdy, khurt␤
diakopter_ std: //
p6eval std 29433: ===SORRY!===␤Null regex not allowed at /tmp/wxGi5Hg2On line 1:␤------> //⏏<EOL>␤FAILED 00:01 104m␤
khurt diakopter, is there an OS X binary? Will Rakudo compile under OS X 10.6?
arnsholt khurt: I don't think messages work, unfortunately =)
diakopter_ aww, webchat.freenode.net doesn't convert the ansi colors
arnsholt Several of the devs use Mac
khurt is "say" a replacement for print 14:18
mberends khurt: yes it is
arnsholt say is print with a \n at the end
khurt why?
diakopter_ for convenience, when that's useful
arnsholt Because that's a really common thing to do, so it makes sense to have a function for it
mberends khurt: most mac users build Rakudo from source 14:19
khurt With xcode comiler or do I need gcc?
arnsholt Just gcc. But if you've installed the XCode tools I'm pretty sure you've got make and gcc
khurt From my experience building perl from source can take half a day. 14:20
diakopter
.oO( I wonder if parrot builds ok with the llvm-gcc in XCode )
it's much smaller
arnsholt khurt: Rakudo isn't that big yet =)
khurt Good to know.
arnsholt On my MacBook Pro it takes 10 or 15 minutes I think 14:21
diakopter it's not a fork of perl
khurt I've compiled my own perl 5 in the past but would prefer a static build for my platform. I guess I'll see what setup is needed and proceed from there.
14:21 rachelBROWN left 14:22 synth left
diakopter rakudo.org/how-to-get-rakudo 14:22
14:23 diakopter_ left
khurt "it's not a fork of perl" .. but perl 6 seems that way to me. It is almost alien. I am having trouble even calling it perl. But .. I may get over that resistance with familiarity. I supposed speakers of middle-English would not recognize modern day English either. 14:23
soupdragon your totally right khurt 14:24
diakopter khurt: I meant, rakudo/parrot is not a fork of the perl sources
khurt Ok. I'm here: github.com/rakudo/rakudo how do I avoid the "first you need this, then that, then this ..." to get to what I need in the shortest possible route. 14:26
I don't have github. 14:27
I know have Xcode installed.
arnsholt khurt: Download the december release, from github.com/rakudo/rakudo/downloads 14:28
khurt I did. I did "perl Configuler.pl" and got an "Unable to locate parrot_config" error message. 14:30
arnsholt You should probably do perl Configure.pl --gen-parrot
colomon that does need svn 14:31
14:31 rgrau` joined
arnsholt True, true 14:31
colomon (--gen-parrot needs svn, I mean)
khurt So I need to build parrot, then build rakudo? Anything else?
arnsholt Nope
diakopter imho someone should make a --gen-parrot-http that downloads the appropriate parrot svn snapshot. 14:32
khurt Good to know. I tend to have a very low "frustration threshold" for things that don't "just work". :)
arnsholt diakopter: Good point 14:33
khurt Ok.. that bombed with the same error message "Unable to locate parrot_config "
Do I need to be root?
colomon no.
khurt Aparently I don't have "gcc-4.2" 14:34
mberends the --gen-parrot option calls svn to get the correct Parrot source version 14:35
colomon khurt: what claims you need gcc-4.2 ? I'm building on OS X with gcc-4.0, and everything works fine. 14:36
mberends khurt: what does your gcc --version say? (my Linux one is 4.4.1)
khurt colomon, I have xcode installed. Does that not include gcc? 14:37
mberends there was an issue with 4.2.1 on bsd related unices
arnsholt My Mac has 4.2.1 14:38
diakopter gcc --version
says what?
14:41 Baggio_ joined, hicx174 left 14:44 Baggio__ joined
khurt I can't seem to find a way to invoke gcc from the terminal. I assumed GCC was included with my install of Xcode. 14:46
mberends probably not, then. is there a ports way to install gcc?
arnsholt GCC should come with XCode 14:47
diakopter no, it's in XCode
arnsholt khurt: What do you get if you say "ls /usr/bin/gcc"?
khurt "No such file or directory" which means I have no gcc. 14:48
arnsholt WEird
14:49 Baggio_ left 14:50 Baggio__ left
khurt But using Xcode I can compule a simple "Hello World" C program. 14:50
Not sure what is going on.
diakopter khurt: did you upgrade snow leopard from 10.5? you'll need to install XCode from the snow leopard DVD, if so.
mberends there are other C compilers besides gcc, maybe you have another cc
diakopter what version of XCode do you have 14:51
khurt turns out I also have no "make". Aarrgh! Apple is killing me. Maybe I should just VPN into the office and use the Linux server I use everyday.
diakopter sounds like your PATH is botched
arnsholt I think diakopter may be onto something
khurt the only cc in /usr/bin is perlcc 14:52
diakopter what does ls /usr/bin/gcc-4.2
14:52 partisan left
khurt On Xcode 3.1.2 14:52
ls *cc* in /usr/bin return nothing but "distccdperlccperlcc5.8.9rpcclientrunocc.d". i may need an updated xcode. Let me check that. 14:53
mberends khurt: what does 'which cc' give you? 14:54
khurt 'which cc' returns nothing
arnsholt khurt: I think you need to update XCode
khurt I am downloading Xcode 3.2.1 now.
arnsholt That should fix it. IIRC 3.1 is for 10.5 and 3.2 for 10.6 14:55
colomon is wishing Rakudo had unindenting here-strings working already, it would be perfect for $work.
diakopter khurt: what about /Developer/usr/bin/gcc-4.2 14:57
khurt diakopter: Yep. There is a gcc in /Developer/usr/bin/ 14:58
Why the heck would Apple do that? 14:59
diakopter I bet the XCode installation added it to your PATH originally, but the osx upgrade reset it 15:00
esp if you're root
khurt I don't normally run as admin and root is disabled on my Macs 15:01
arnsholt diakopter: No. On my machine it's in /usr/bin
So the upgrade probably nuked all of /usr/bin
diakopter ah, the symlinks that were there 15:02
arnsholt: are yours symlinks?
arnsholt /usr/bin/gcc symlinks to /usr/bin/gcc-4.2, which is a real executable 15:03
khurt So now gcc is in my path ( i added all /Developer/usr/bin). And I reran the 'perl Configure.pl --gen-parrot" and got the same error. 15:04
arnsholt I think you should wait for the XCode update
diakopter agrees
khurt Doing that now. 15:05
I hate dependencies. :(
diakopter if you copied files to /usr/bin you should remove them, and if you symlinked things there, you should unlink them, I recommend. 15:06
khurt I copied nothing to /usr/bin. The upgrade from OS X 10.5 to OS X 10.6 must have moved my older Xcode to /Developer/ ( I assume). 15:07
arnsholt I think it probably just wiped whatever was in /usr/bin and put in the stuff it wanted 15:08
diakopter oh, you just edited $PATH; sorry; I misread
khurt Reading Xcode doco. Says "GCC 4.2 is the primary system compiler for the 10.6 SDK" so ... I should be good to go once I have that installed (it's a big install!). 15:11
15:11 SmokeMachine left
diakopter 2010 looks ominous in a filesystem mtime listing 15:13
khurt gcc is hashed (/usr/bin/gcc) 15:15
15:15 Baggio_ joined
khurt Got Xcode 3.2.1 installed. Running rakudo install (first needs to build parrot) and all seems to be proceeding well. 15:16
diakopter khurt: yay :)
15:18 SmokeMachine joined
khurt Well .. for all the hassle at least now I have an updated (and working) version of Xcode (wonder why Software Update does not update Xcode) and soon a perl 6 I can play with. 15:21
15:28 wolf2k_ubuntu joined
khurt success. I have a working rakudo. 15:43
Thanks so much for everyone's help. I might be back later to ask more perl6 related questions. 15:45
mberends all the best, khurt 15:46
15:48 soupdragon left 15:49 soupdragon joined 15:52 qburke joined 15:53 Psyche^ joined, qburke left 15:54 Patterner left, Psyche^ is now known as Patterner 15:58 Baggio__ joined 16:12 Baggio_ left 16:13 pdcawley joined 16:16 jferrero joined 16:18 Baggio__ left 16:22 masak joined
masak TimToady++ # r29431 16:22
16:22 masak left 16:25 ash_ joined 16:39 PerlJam left 16:40 am0c left 16:42 PerlJam joined 16:49 meppel left
diakopter phenny: tell chromatic I'll have you know I'm *again* switching back to JavaScript :/ sigh. .words.eat Compiling to JS now, though, now that I know how to write an emitter builder. 17:02
phenny diakopter: I'll pass that on when chromatic is around.
frettled I'll join masak in a TimToady++ for r29431. 17:04
khurt Is a pelr6 regex synonymous with rule? Is there a perl 6 document that explains regex without comparison to perl 6? 17:06
I meant without comparison to perl 5.
diakopter TimToady++ # addressing nearly all of my requests in r29431 17:11
khurt: this page is great... perlgeek.de/blog-en/perl-5-to-6/ 17:13
khurt cool. thanks. any way to get perl 6 to use cpan? 17:22
diakopter not yet.
khurt Ok. been using perl since 1997 and Perl 6 makes me feel like I know nothing. 17:24
looks like I'll have to take all my perl books (I have a lot of stuff written by wall, torkington and conway) and chuck em. 17:25
diakopter take your time with that perl-5-to-6 page; it'll stretch your mind... don't toss your books :P
ash_ khurt: have you read the spec on regex's yet? S05?
khurt nope.
mberends khurt: Perl 5 is not going away
ash_ perlcabal.org/syn/S05.html
has the full spec of the new regex stuff in perl 6 17:26
i'd also recommend github.com/perl6/book direct link: cloud.github.com/downloads/perl6/bo...009-12.pdf 17:27
some of the guys developing perl 6 made that book, its really good and informative if your just getting to know perl 6
17:32 justatheory joined 17:34 pmurias joined 17:35 ejs joined
khurt are perl six regex a new language? I can't grok it. 17:50
17:51 SmokeMachine left
ash_ khurt: yeah basically, they are a new syntax with new capabilities 17:51
and are a bit more integrated into perl than perl 6's regex's were
mberends than perl 5's
ash_ or that 17:52
sorry i must not be fully awake yet *needs more caffeine* 17:53
mberends hands ash_ a mug of coffee 17:54
khurt I'm just not getting it. In perl 5 I would do "my( $ip ) = ($log_line =~ /(\d{2,3}\.\d{2,3}\.\d{2,3}\.\d{2,3})/ )[0];" to math the IP in this line "1012429341.115 100 172.16.100.152 TCP_MISS/302 184 GET www.cisco.com myloginname DIRECT/www.cisco.com -"
but not sure how to proceed in perl 6. 17:55
I know about using ~~ but then what? This "$log_line ~~ /(\d{2,3}\.\d{2,3}\.\d{2,3}\.\d{2,3})/" fails.
mberends the {2,3} has changed, I forget the details, possibly ** notation. See S05. 17:56
khurt What in here: perlcabal.org/syn/S05.html#Match_objects should I pay attention to? 17:57
mberends looking...
diakopter std: my $log_line = "1012429341.115 100 172.16.100.152 TCP_MISS/302 184 GET www.cisco.com myloginname DIRECT/www.cisco.com -"; say $log_line ~~ /(\d**{2,3}\.\d**{2,3}\.\d**{2,3}\.\d**{2,3})/;
p6eval std 29433: ok 00:01 109m␤ 17:58
diakopter rakudo: my $log_line = "1012429341.115 100 172.16.100.152 TCP_MISS/302 184 GET www.cisco.com myloginname DIRECT/www.cisco.com -"; say $log_line ~~ /(\d**{2,3}\.\d**{2,3}\.\d**{2,3}\.\d**{2,3})/;
p6eval rakudo db84bc: perl6regex parse error: Error in closure quantifier at offset 164, found ','␤in Main (file <unknown>, line <unknown>)␤
diakopter rakudo: my $log_line = "1012429341.115 100 172.16.100.152 TCP_MISS/302 184 GET www.cisco.com myloginname DIRECT/www.cisco.com -"; say $log_line ~~ /(\d**{2..3}\.\d**{2..3}\.\d**{2..3}\.\d**{2..3})/;
ash_ rakudo: if '1012429341.115 100 172.16.100.152 TCP_MISS/302 184 GET' ~~ /((\d+)\.(\d+)\.(\d+)\.(\d+))/ { say $/; }
p6eval rakudo db84bc: 172.16.100.152␤
ash_ dang to slow
khurt you got all that from perlcabal.org/syn/S05.html ? 17:59
ash_ and the perl 6 book
diakopter perlcabal.org/syn/S05.html#Bracket_...nalization
ash_ page 24 of it talks about regex's and gives a number of examples
diakopter search for "The general repetition specifier is now" in S05 18:00
khurt where's the stuff that explains what happened to \d \s \w . * etc.
diakopter it's there in S05; search for \b and \d etc 18:02
ash_ khurt: on the bottom of page 25 of the perl 6 book they have a chart with them in there
for me, the spec's were a bit more technical than i could easily comprehend, the perl 6 book helped me with perl 6's regex's the most, now i sound like i am beating a dead horse or something 18:04
mberends khurt: also read the section "Unchanged syntactic features" near the beginning of S05, because fortunately \d etc remained the same
khurt I don't mean to sound like a jerk but do most perl 5 users (not language developers) find perl 6 frustrating?
mberends only for a short while ;) 18:05
then other adjectives take over :)
khurt I downloaded the book. Maybe that will help me get past this. Whew. Again. Feel like I am learning a new language. Perhaps I should stop thinking of it as perl. Feels like something else. 18:06
pmurias khurt: do you find perl 6 frustrating or the organisation of synopses? 18:07
mberends khurt: your feelings are not unique, and when the lightbulbs turn on, it's better
khurt hmm... I guess it's the documentation. For me,.. reading it is like reading a comp sci majors thesis paper. 18:08
spinclad std: token decimal-octet { $octet=\d+ { +$<octet> < 255 } }; #`[token ipaddr { <octet> ** '.' ** {4} } note: stacked **s don't work]; token ipaddr { <octet> ** '.' { $<octet>.elems == 4 } }
p6eval std 29433: Potential difficulties:␤ Variable $octet is not predeclared at /tmp/3lDKpmjJ0d line 1:␤------> token decimal-octet { $octet⏏=\d+ { +$<octet> < 255 } }; #`[token ipa␤ok 00:01 109m␤
khurt Accoring to the book perl 6 "represents a major break in syntactic and semantic compatibility from Perl 5". TRUE DAT! 18:09
ash_ i started learning perl 6 before i knew perl 5 (obviously I only really learned both of them in the last 6 months or so) and perl 6 didn't make much since till i learned more of perl 5, i don't consider them the same language by any means 18:10
khurt “Why call it Perl if it’s a different language?” or ... "If I write a language that looks like C++ but isn't why call it Java".
Anyway, I'll work past the frustrations ... want to be able to call my self a perl programmer/developer in the future .. at some point perl 5 will die just like perl 4 (I never used 4) before it. Of course, I'm assuming that Perl 6 will be release before my daughter enter college. She was born in 2001. 18:12
mberends Larry Wall calls it Perl, that's good enough for me
pmurias khurt: perl 5 and perl 4 look like different languages too 18:13
khurt Yep.
ash_ khurt: github.com/ihrd/uri/blob/master/lib...ar/IPv6.pm is a good example of a grammar, it can match an IP address, so if you want a 'real' IP address matching grammar there's one that follows the IP address spec exactly (does IP and IPv6) 18:14
ihrd++ for writing that one
spinclad std: token octet { \d+ { +$/ < 255 } }; token ipaddr { <octet> ** '.' { $<octet>.elems == 4 } }; 'adsfb 0.12.234.3456 sdfg' ~~ /<ipaddr>/; say $/ 18:16
colomon What does an IPv6address look like!?
p6eval std 29433: ok 00:01 109m␤
ash_ fe80:0:0:0:200:f8ff:fe21:67cf 18:17
is an IPv6 address
18:17 ejs left
ash_ ::1 is localhost in IPvv6 18:17
[::1]:80/ would be your localhost on port 80 18:18
khurt ash_, but what does it mean? example are fine unless they are broken down and explained in detail. { [ <.h16> ':' <!before ':'>] } means nothing to me.
And that's my problem. I need a book that explain regex accoring to perl 6. the perl 6 book is not helping. I'm just not getting any of it.
ash_ well, you can replace { } with / / if you want, [ ] are non-capturing groups 18:19
<!before > is a look behind
khurt Ah... here's the thing : "(If you know regexes from other program- ming languages it’s best to forget all of their syntax, since in Perl 6 much is different than in PCRE or POSIX regexes." 18:20
ash_ wait, sorry <?before > is lookbehind, <!before > is a negative look behind
yes, perl 6's regex's don't follow PCRE or POSIX or any of the other regex syntaxes, its completely different 18:21
khurt And that'w why I may be having problems. I assumed that Perl 6 regex were like regex I've used in grep , awk, perl 5 etc. and that all I needed to know were the small changes. There are no small changes. This is a complete different animal.
mberends khurt: correct, and many of us here consider the new regex system one of the most valuable advances
khurt So ... it'll take me some time to unlearn what I call UNIX convention and learn this new thing.
diakopter khurt: it's much more akin to a general parser-builder/grammar-declaration language, such as antlr. 18:22
or xtext.
ash_ <.h16> matches a subexpression based off the h16 token but doesn't capture it
khurt do I have to use tokens? Is there an explanation of that? 18:23
ash_ [ ] are a non-capturing group
taken's just represent a sub part of the grammar
you can replace that with the token itself if you want
khurt What the simplest way to get to where I want to get to..
ash_ defining a new token is useful if you have to repeat yourself a lot 18:24
it just lets you define a re-usable piece of a regex
khurt How is it better to take my oneline perl 5 regex and now expand it to include all these other things. What have I gained?
spinclad the simplest way is to take several paths at once, then when you get there you find it's where you want to be
khurt is a token a pre-complile regex?
pmurias it's an equivalent of subroutine for regexes 18:25
* of a
khurt so in my example from earlier if I have this string "1012429341.115 100 172.16.100.152 TCP_MISS/302 184 GET www.cisco.com myloginname DIRECT/www.cisco.com -" I could either use a perl regex or a perl 6 regex to find the IP . I am not sure what I would need to know to construct that regex (besied usiing ~~ instead of =~ ). 18:29
ash_ a grammar is kinda like an object, and tokens are kinda like sub routines for regex's, a grammar might represent something (like and IP address) and it has attributes (captured parts) and tokens are how it knows how to seperate itself. Its really a re-usability issue and a readability issue. you could have 1 regex that does it all in 1 line but with a grammar you can parse a string and ask it for its parts, like say you have a grammar
URI, you can say my $uri = URI.parse('www.google.com/'); and then go $uri.host == 'google.com'
khurt diakopter suggested"(\d**{2,3}\.\d**{2,3}\.\d**{2,3}\.\d**{2,3})/;" but I don't know how to read that. what's the \d**? 18:31
ash_ ** is repetition
huf the book tells you
ash_ repeat a digit (\d) 2 or 3 times
huf it's \d ** 2..3 i think
pmurias shouldn't it be \d* ** 2..3
spinclad the {2,3} should be {2..3}
ash_ they are the same thing 18:32
khurt but why do I need it in this case. what not just \d{2,3}?
pmurias \d{2,3} is now \d .. 2..3 or \d .. {2,3}
(?{print "hi"}) is now {print "hi"} 18:33
* it should have been \d* .. {2..3}
18:33 cognominal joined
spinclad you don't want 2 or 3 digits actually. { \d+ { +$/ < 255 } } is closer, but doesn't seem to work in rakudo (expected) or rakudo-ng (surprised). 18:34
pmurias: \d ** 2..3
ash_ spinclad: / (\d**1..3) <?{ $0 < 256 }> / works 18:35
eer wait
pmurias spinclad: yes, i'm sure the new year's eve has something to do with the typos 18:36
ash_ ng: 25 ~~ / (\d**1..3) { say 'hi';}/ 18:40
p6eval ng 4ccc5a: hi␤
ash_ part of the change of the { } syntax is {} is a block of code now 18:41
like in that one above, when it matches (\d ** 1..3) it executed the block of code right after it
although ng isn't assigning the capture to $0 properly
pmurias khurt: the other use of ** is that \d+ ** ':' matches numbers seperated by semicolons 18:42
huf so \d ** *..3 ** '.' ?
spinclad can you stack them like that? 18:44
pmurias matches stuff like 193.3.23.285.7.921
spinclad ah, i was thinking of <octet> ** 4 ** '.' , which i'm sure is wrong (but i'd like to say something that means what i mean there) 18:46
pmurias huf: only you should write it [\d ** 0..4] ** '*'
18:46 ash_ left
spinclad 4 octets, . separated 18:46
18:47 ash_ joined
huf pmurias: makes sense 18:47
khurt none of this seems trivial to me. Wow. I'm in over my head. Read and re-read the pattern matching section of the perl 6 book and I just don't get it. 18:52
spinclad khurt: you're right, these aren't small changes. there are equivalents to (just about?) everything from Perl 5, but they're not just said differently, the thoughts that make them up are different. 18:57
18:58 SmokeMachine joined
khurt The learning curve appears to be steep or it this kind of "not getting" it to be expected? 18:59
spinclad { } is pretty much always a block of code now, so we give a ** operator explicitly
ash_ khurt: it should click eventually, (it did for me anyway) 19:00
spinclad steep, yes, but with the right clues, and taking and digesting small bites, it might come more easily
khurt I've got the match working but don't see a clue about how to assign the grouping directly to a variable. 19:02
my $log_line = "1012429341.115 100 172.16.100.152 TCP_MISS/302 184 GET www.cisco.com myloginname DIRECT/www.cisco.com -"; #perl 5 stuff. #my( $ip ) = ($log_line =~ /(\d{2,3}\.\d{2,3}\.\d{2,3}\.\d{2,3})/ )[0]; #print $ip,"\n"; #doesn't work. my($ip) = ($log_line ~~ /(\d**2..3'.'\d**2..3'.'\d**2..3'.'\d**2..3)/); ~ 19:03
ash_ rakudo: 25 ~~ /(\d)(\d)/; say 'first capture $/[0]' ;
p6eval rakudo db84bc: first capture $/[0]␤
ash_ rakudo: 25 ~~ /(\d)(\d)/; say "first capture {$/[0]}";
p6eval rakudo db84bc: first capture 2␤ 19:04
khurt How do the perl 6 equiv of this "my( $ip ) = ($log_line =~ /(\d{2,3}\.\d{2,3}\.\d{2,3}\.\d{2,3})/ )[0];"
ash_ my $ip = $\[0];
khurt Really
ash_ or $0;
19:05 soupdragon left
khurt I don't like leaving $ whatevers all over my code. 19:05
ash_ capture's are assigned to $0, $1, ... $N;
khurt Very easy to trash built in variables.
Su-Shee khurt: you really didn't parse IPs with regex and not use one of the modules, did you? ;)
khurt So this won't work: my($ip) = ($log_line ~~ /(\d**2..3'.'\d**2..3'.'\d**2..3'.'\d**2..3)/)[0];
ash_ lets see 19:06
rakuo: my $ip = ($log_line ~~ /(\d**2..3'.'\d**2..3'.'\d**2..3'.'\d**2..3)/)[0]; say $ip;
oops, forgot to add a log_line
spinclad my(...) is always a call of the my function. you want my (...) ... 19:07
ash_ rakudo: $log_line = "1012429341.115 100 172.16.100.152 TCP_MISS/302 184 GET www.cisco.com/ myloginname DIRECT/www.cisco.com/ -"; my $ip = ($log_line ~~ /(\d**2..3'.'\d**2..3'.'\d**2..3'.'\d**2..3)/)[0]; say $ip;
p6eval rakudo db84bc: Symbol '$log_line' not predeclared in <anonymous> (/tmp/xVyMuUu2Qd:2)␤in Main (file <unknown>, line <unknown>)␤
ash_ rakudo: my $log_line = "1012429341.115 100 172.16.100.152 TCP_MISS/302 184 GET www.cisco.com/ myloginname DIRECT/www.cisco.com/ -"; my $ip = ($log_line ~~ /(\d**2..3'.'\d**2..3'.'\d**2..3'.'\d**2..3)/)[0]; say $ip;
p6eval rakudo db84bc: 172.16.100.152␤
pmurias khurt: it should 19:08
spinclad rakudo: my $log_line = "1012429341.115 100 345172.16.100.152567 TCP_MISS/302 184 GET www.cisco.com/ myloginname DIRECT/www.cisco.com/ -"; my $ip = ($log_line ~~ /(\d**2..3'.'\d**2..3'.'\d**2..3'.'\d**2..3)/)[0]; say $ip; 19:09
khurt so I don't need the ( ) around the $ip variable? In perl 5 there would be a complaint about assinging array to scalar etc.
p6eval rakudo db84bc: 172.16.100.152␤
Su-Shee rakudo: my $ip = '999.77.88.444'; say 'yes' if $ip ~~ /(\d**2..3'.'\d**2..3'.'\d**2..3'.'\d**2..3)/;
p6eval rakudo db84bc: yes␤
spinclad rakudo: my $log_line = "1012429341.115 100 345172.16.100.152567 TCP_MISS/302 184 GET www.cisco.com/ myloginname DIRECT/www.cisco.com/ -"; my $match = ($log_line ~~ /(\d**2..3'.'\d**2..3'.'\d**2..3'.'\d**2..3)/); say $match[0];
p6eval rakudo db84bc: 172.16.100.152␤
mberends what's this 2..3 anyway? one digit octets are also valid, eg 127.0.0.1 19:10
khurt yep.
mberends: you are correct. I was using testing with logs from the office where we would not be using that sort of IP space.
mberends ok 19:11
khurt Don't ask why. I did not design our network. :)
spinclad (someone doesn't like single digit octets?)
mberends (some perl script couldn't match the other addresses?) 19:12
khurt So what I was missing is that \d{2,3} would now be \d**2..3 seems a bit convoluted but ... who am I to question.
Su-Shee khurt: you're allowing bogus IPs though.
spinclad rakudo: my $log_line = "678.567.456.345"; my $match = ($log_line ~~ /(\d**2..3'.'\d**2..3'.'\d**2..3'.'\d**2..3)/); say $match[0]; 19:13
p6eval rakudo db84bc: 678.567.456.345␤
Su-Shee and with perl 6 something like "match something up to 2^8-1 followed by a dot followed by .. and so on 19:14
"should be possible."
mberends the ihrd module tests all those cases correctly
pmurias khurt: the metacharaters got all changed so new features could be added to regexes cleanly 19:15
khurt Su-Shee ... true. I use a slight different match at work. our IP space is \d**3'.'\d**2'.'\d**1..3'.'\d**1..3
And I don't test whether the IP actual valid. so even though 999.89.23.22 would match I don't care since it would not very likely ever occur in the logs I work with. 19:17
Su-Shee khurt: yeah but why be imprecise if you could get "validity" together with "match"?
19:20 khurt left
diakopter I don't think khurt came here to be challenged/badgered on programming decisions he/she already justified/explained at least once. 19:22
ash_ i think he's trying to understand why things were changed
Su-Shee maybe. and yet perl 6 supports stuff to get it right relatively easy.
so why not use it?
ash_ i honestly don't have a full answer to that, some of the stuff was changed clearly for reasons like { } mean a block, but i don't know how to justify all the other changes 19:23
mberends it's a bit annoying to have to justify the design of Perl 6 to such people. Why don't they realise that questions beginning with why are so annoying? 19:24
diakopter Su-Shee: khurt already explained the reason. As I said, khurt did not come here to be badgered on it.
Su-Shee diakopter: yes. you mentioned that. and I gave my reason to tell him to do otherwise. 19:25
diakopter Su-Shee: in khurt's case, your reason is invalid, because for khurt, "the right answer" is the answer already chosen.
Su-Shee diakopter: so it's ok to let a bad solution pass instead of getting the stuff right in the first place? 19:26
diakopter: you can do that if you like. doesn't mean that I have to too, doesn't it? ;)
diakopter Su-Shee: you should not presume you know better than khurt about khurt's network.
no, you may not badger people like that.
Su-Shee all right then, I'll leave you to it. 19:27
19:27 Su-Shee left
mberends good reasons to promote a better solution: future code re-use, and avoiding mysterious bugs after a future network redesign 19:27
diakopter I'm not claiming that khurt closed the webchat page immediately after being challenged 3 times on his programming decision, but it would be suspiciously coincidental/surprising otherwise. #elsewhere is the place you go if you want to ask a question but be accosted for asking it wrong. 19:30
khurt's attitude went from < khurt> yep. < khurt> mberends: you are correct. ... < khurt> Don't ask why. I did not design our network. :) to < khurt> Su-Shee ... true. 19:33
ash_ is there a place that explains any of the logic behind some of those changes? that anyone knows about? 19:44
mberends ash_: do you mean the regex metacharacter changes? 19:45
ash_ that and/or most of the other significant changes from perl 5? incase anyone else asks
some things seem easy to explain, like sub's paramters being explicitly defined now, but others like why did they change the way you make a character class in a regex is hard to give an answer to 19:47
mberends there are so many long stories, no, not conveniently gathered in one place 19:48
frettled They are almost conveniently gathered through perlcabal.org/syn/, since the apocalypses and exegeses are there, but, uhm. 19:52
19:53 constant left
ash_ ah, i frogot about the Exegesis, that would of helped him i am sure 19:53
frettled I'm not sure that it's in there, I've never looked for that. But I suspect that the P6L archives might add some useful information as well. 19:55
mberends khurt did not come across as a RTFM kind of person
ash_ dev.perl.org/perl6/doc/design/exe/E05.html is really helpful (the exegesis for S05) 19:57
i am reading it now, kinda skimming the parts that i am familiar with
cognominal just tripped on an & in a rule, forgot that was a metachar :( 20:22
took me a while to figure out
frettled We're all n00bs in the eye of the fnord. 20:23
cognominal hopefully, Larry, Patrick and Jonathan are working on better messages than "confused" 20:26
frettled Yup :) 20:32
TimToady Confused is just " 20:33
just "syntax error"
and STD almost never gives it to you
20:33 justatheory left
PerlJam Good day #perl6ers. and Happy New Year! :) 20:34
TimToady Likewise indeed. 20:35
PerlJam TimToady: Did you and yours have a good christmas?
cognominal I can't find the stuff about smartmatch. Is there something to use hash keys as regex and values as substitution? 20:36
TimToady pretty good, though Julian is in the hospital currently; I'm sitting in the room right now...
cognominal We wish him well. Is he your son or your grand son?
TimToady (he has a fever that keeps spiking to as high as 104°) 20:37
grandson
PerlJam swine flu?
TimToady but as far as they can tell, it's probably just a reaction to chemo, but they're not taking any chances, since he's immunosuppressed
cognominal can you american one day convert to the metric system? Farenheit does not mean anything to sensible people :)
PerlJam ah. 20:38
TimToady about 40.3℃
frettled TimToady: ow, I hope it's just a reaction, then.
TimToady all the cultures are coming back negative, which is a good sign
cognominal TimToady++ # knowing there was an unicode char ℃ 20:39
frettled I'll join PerlJam in wishing you all the best of the new year. 20:40
cognominal Ho, Ben Franklin died in 1790. Had he lived longer, I bet american would have the metric system. 20:41
frettled you make it sound like an STD ;)
TimToady well, shuttling grandma back to the kids' domicile...later &
PerlJam cognominal: he was in his 80s when he died. It was remarkable that he lived so long in the time that he did. :) 20:42
20:42 y3llow_ joined 20:43 ash_ left
cognominal I keep forgetting that the american revolution was way before the French one. 20:45
frettled Yeah, but the French had more revolutions. :) 20:48
20:48 synth joined 20:54 SmokeMachine left, y3llow left
cognominal This is no revolution, except for Glen Beck who does not know shit about France, but more than 1137 cars have been burned in France for new years eve. And the government declares to be happy because the number is stable. 20:54
frettled /o\ 20:55
Glen Beck is funny - when you watch choice snippets by Jon Stewart. 20:56
hejki in the year 2020 Martha Stewart will teach perl6 recipes instead of household equivalents
frettled :) 20:58
hejki totally irrelevant, but the name Stewart caused this out-of-body-experiment-like really strong vision of it 20:59
cognominal www.youtube.com/watch?v=ZKyi2qNskJc # this is so funny even more so when we now know for sure that Coupat has been framed by the french governement for a sabotage done by german antinuclear activists. Probably because the government prefer people to fear about terrorism that about the scretive French nuclear industry
Who is Jon Stewart? 21:00
frettled cognominal: he has The Daily Show at Comedy Central
cognominal: dry wit galore
cognominal: followed by that other famous guy from Comedy Central, that I can't remember the name of :) 21:01
cognominal do you have an good url to show him in action?
PerlJam frettled: Stephen Colbert? 21:02
frettled PerlJam: yeah, that's right - the Colbert Report. 21:03
cognominal: hmm, hmm. 21:04
www.thedailyshow.com _should_ have full-length versions of the show
cognominal: any of these should be representative: www.thedailyshow.com/full-episodes/...r-of-2009# 21:06
(Dec. 14 - 16)
cognominal In Glen Beck video, he confuses harmless intellectual people who write scary books, and yough people that burns cars that are disorganized, don't know and don't care about political action. Finally he want to agitate the communist scarecrow and find it in Japan. So much for a French threat. It is hard to find someone more clueless. I dont think that the French communist party has done more than 1.5% the last five years and it has been going down fore 21:08
ver.
frettled cognominal: I think it's safe to say that one cannot take Glen Beck seriously. Don't fret about him :) 21:11
cognominal well, apparently Fox is pretty successful. Certainly, I doubt that anyone in this channel would take him seriously. 21:12
frettled Some might, some might not, but I don't think this is the place for discussing politics unless it's relevant to Perl 6. 21:15
cognominal sorry :)
frettled no harm done, I think :)
mberends I was just beginning to fret... 21:16
frettled But political annoyances can inflame moods very easily.
cognominal too bad, that the daily shows says it is not available in "my area"
frettled mberends: while I was just starting to enjoy my glass of tawny port.
cognominal: urgh, that's annoying. Maybe one of the Americans here can help you out, though I must admit that I don't know how to save and forward a flash thingy. 21:17
(I fear that proxying isn't quite trivial)
cognominal no big deal, I will find on youtube
frettled yeah, there are probably clips there. 21:18
I think you will find that Stewart is a refreshing little island of comic insanity. 21:19
(but not quite _brilliant_)
I'll go back to watching that Poirot episode now. :)
21:30 jferrero left, cotto_w0rk joined 21:36 tag joined, cotto_working left 21:42 ash_ joined 21:44 constant joined 21:48 orafu left 21:49 orafu joined 21:53 ash_ left 21:57 wolf2k_ubuntu left 22:02 cognominal left 22:10 trondham left 22:11 stepnem left, mberends left 22:13 ash_ joined 22:14 Guest35397 left 22:15 ash_ left 22:18 stepnem joined, ash_ joined 22:19 cognominal joined 22:21 ash_ left 22:35 ash_ joined 23:20 stephenlb joined, iblechbot left 23:22 justatheory joined, adhoc left 23:33 ihrd joined 23:35 ihrd left 23:51 Tene joined
Supaplex greetings Tene. happy new year. 23:59
Tene Thanks, Supaplex!