Think twice before running "make install" for Pugs | moritz.faui2k3.org/irclog/ | pugscode.org | sial.org/pbot/perl6 | ?eval [~] <m oo se> | We do Haskell, too | > reverse (show (scanl (*) 1 [1..] !! 4)) | "Perl 6 Today" video from YAPC::Asia: xrl.us/v6op
Set by agentzh on 6 May 2007.
00:01 toshinori joined 00:04 mr_ank joined 00:12 ggoebel joined 01:14 trunix joined 01:30 buetow joined 01:54 Aankhen`` joined, buetow joined 02:05 nicodaemos joined 02:13 nperez joined 02:44 amnesiac joined 02:56 kanru joined 03:03 [particle] joined 03:06 kanru joined 03:49 amnesiac joined 03:51 catch23 left 03:53 SCalimlim joined 03:59 dominix joined 04:02 dominix left 04:13 SCalimlim joined, Daveman joined 04:15 Talaman72 joined 04:17 zamolxes joined
Talaman72 hello 04:19
svnbot6 r16459 | Darren_Duncan++ | ext/QDRDBMS/ : added new test file t/QDR_10_AST.t ; fixed a kind of bug in AST.pm that it uncovered 04:36
Aankhen`` What is the Perl 6 equivalent of XS modules? 04:49
svnbot6 r16460 | Darren_Duncan++ | ext/QDRDBMS/ : fixed same kind of bug in QDRDBMS.pm, PhysType.pm
dduncan depends on implementation
for Pugs, its Haskell modules
Aankhen`` So no universal equivalent, then?
dduncan for v6.pm, its Perl 5 modules 04:50
Aankhen`` I mean, what would you package with your distro on Perl 6's CPAN?
dduncan for Parrot, its .pmc files or such
so you don't want to know about XS files, but rather how to package Perl 6 for CPAN? 04:51
Aankhen`` Hmm.
Let me see if I can rephrase my question.
dduncan only code written *in* Perl 6 is universal
are you asking how to talk to C libraries? 04:53
Aankhen`` In Perl 5, XS modules are generally used where more close-to-the-metal implementations are required, whether for speed or to do things that are masked by the higher-level language. Since there is only the one implementation of Perl 5, the XS portions can be packaged with any distribution, and (assuming the presence of a proper environment to build them in) used by any Perl 5 user. Is there any such equivalent low-level—language?
dduncan depending on what you need to do, Perl 6 itself has more down-to-the-metal features than Perl 5 did 04:54
Aankhen`` (I figure there isn't, but I was looking for confirmation.)
Okay.
dduncan for example, unboxed data types like int that map to hardware native types
Aankhen`` Right.
dduncan also, Perl 6 code can indicate in various ways things that would help compilers make optimizations 04:55
eg, declaring specific data types, or indicating if loops are uncoupled 04:56
Aankhen`` I know of open/closed and super/finalized classes, but what else?
Not sure I understand the distinction between coupled and uncoupled for loops.
dduncan uncoupled means they can execute in any order, or in parallel, implicitly
Aankhen`` Ahh.
dduncan so lots of reasons to use XS in the old days are now unnecessary, and you can write them in Perl 6 04:57
Aankhen`` I thought that only `map` &c. were implicitly parallelized?
(With the use of `hyper`.)
dduncan but if you still need to talk to hardware in other ways, how you do it is implementation dependent
Aankhen`` Makes sense.
dduncan hyperops are implicit
for any(@ary) -> ... is uncoupled
Aankhen`` Oh. 04:58
dduncan vs for @ary -> which wants a specific order
generally speaking, any of the goodies that people would have reached for PDL for are built-in to Perl 6
Aankhen`` Mmm, I see.
I'll have to remember the `for any(@ary)`. 04:59
dduncan also, Perl 6 has immutable types, which allow more optimizations
and multi-dim arrays (not same as arrays of arrays)
Aankhen`` wonders if `for any(each(@foo;@bar))` would DWIM. 05:00
How do multi-dim arrays differ from AoAs?
Fixed lengths?
Aankhen`` fires up S09.
dduncan AoAs come in immutable and mutable versions, and are constructed using eg [[a,b],[c,d]]
multidims are just mutable, and you declare them with eg @@foo[4,6] then assign to them 05:01
Aankhen`` Ah.
dduncan but yes, S09 has lots of what you want to know, as does S02
Aankhen`` Yes, I'm sorry to keep pestering you with questions... I do read the synopses a fair bit, but some of the things therein go over my head, so it helps to discuss them with someone. 05:02
dduncan that's fine for now ... once you learn it, you're another person who can tell others
Aankhen`` Thanks for all the help. ^_^ 05:03
dduncan np
but is it complete or non- ?
Aankhen`` I'm reading S09/"Multidimensional arrays" once again to see. ;-) 05:04
05:08 BooK_ joined, kanru joined
Aankhen`` I've said it before, and I'll say it again: user-defined indexes = sexy. 05:10
spinclad I expect immutable multidim arrays to be available, initted using eg [[a,b],[c,d]] 05:11
Aankhen`` Isn't that an AoA, like dduncan said?
spinclad sure, initted from an AoA 05:12
Aankhen`` Ahh,
s/,/./
dduncan I thought those were distinct things
Aankhen`` Bleh.
I read the section on multidimensional arrays again, but it flew over my head as before, laughing as it went. :-\
"Multislice arrays can keep track of their dimensionality as they are being defined" # what does this mean?
dduncan afaik, multislice whatevers are like arrays where the array indices have multiple numbers rather than one 05:13
Aankhen`` Hmm, I see.
dduncan eg, a 3-dimensional array could have eg @ary[4,5,6] = $foo
where a normal array has 1 dimension, @ary[7] = $foo 05:14
Aankhen`` Eureka!
dduncan similarly, we have multidim hashes, the difference being we can have strings rather than numbers as an address
Aankhen`` Right!
dduncan so the difference between multidim and AoA is that one adds complexity on the keys side, and the other on the values side 05:15
afaik
Aankhen`` So, let me see if I understood this correctly or just said Eureka out of a misplaced sense of understanding: in a 3-dimensional array where you say @ary[4,5,6] = $foo, the key is in effect 4,5,6 in its entirety?
dduncan or put another way, its like the key is a Seq rather than a scalar
Aankhen`` Oh jeez. I can't believe I've taken so long to understand... @foo[0][1] vs. @foo[0,1], yes? Please? :-P 05:16
dduncan Perl 6 lets any object be a key, so multidim is probably just a special syntax for when that any object is a Seq or such
I believe so
Aankhen`` Yay!
dduncan the second being the multidim
Aankhen`` Yup.
dduncan afaik
Aankhen`` I have absolutely no idea why it took so long to understand.
I think I kept deluding myself into believing that normal AoAs are also [0,1]. 05:17
dduncan++
dduncan no, normal AoAs are like what Perl 5 already does 05:18
TimToady well, that's not quite right
lambdabot TimToady: You have 1 new message. '/msg lambdabot @messages' to read it.
dduncan I think PDL added to Perl 5 what the multidim thing is
Aankhen`` Shouldn't it be [0;1], though?
TimToady yes
Aankhen`` Kewl.
TimToady [0,1,2] would be a slice of the first dimension
Aankhen`` Right.
dduncan my main point was that the key was more complicated or multidimensional
Aankhen`` Yup.
TimToady [0,1,2; 0,1] is a two-dimensional slice
Aankhen`` <dduncan> so the difference between multidim and AoA is that one adds complexity on the keys side, and the other on the values side # this is an excellent way to look at it, IMHO 05:19
TimToady also, the parallel for would be "hyper for" these days
for any() doesn't really work
dduncan I did recall that this seemed to be an overloading of syntax
so if hyper for @ary is the new for all(@ary), I'm happy 05:20
and so now all() once again just means build a junction, and nothing else?
spinclad i would expect for any() to be allowed to call it quits on the first success
TimToady by default for in list context is lazy, in scalar or void context is eager, I suspect, and never hyper unless explicitly in a hyper context 05:21
yes, all() and any() are strictly logical, and can short circuit or evaluate in any order
all() short circuits as soon as in finds a false, of course 05:22
one could even imagine a junction evaluator that does branch prediction based on past history 05:23
Aankhen`` next sets sights on the feed operators. 05:24
(I used to understand them, but now I'm not so sure.)
dduncan afaik, map is a feed operator, so its stuff like that
TimToady they're just unix pipes, only built out of lazy lists instead of bytes
Aankhen`` Neat. 05:25
TimToady map is lazy, but not a feed operator
Aankhen`` The forms with the double angle append rather than clobber the sink's *todo list*. # that sort of stuff tends to confuse me a bit, heh.
TimToady feeds are ==> and <==
it kinda goes with Unix's > vs >> redirection
Aankhen`` Right.
So... @foo ==> @bar # overwrites (if you would forgive the non-lazy view of it) @bar 05:26
@foo ==>> @bar # appends to @bar
lambdabot Maybe you meant: faq ft todo yow
TimToady correct
Aankhen`` H'ray.
05:26 luqui joined
Aankhen`` Ah, the pleasure of understanding basic things. 05:26
05:26 Psyche^ joined
TimToady yes, @foo <<== @bar is a kind of push 05:26
Aankhen`` Nothing quite like it.
TimToady but like all the parallel ops, makes promises about non-interaction 05:27
Aankhen`` Okay.
TimToady either that the left and right don't interact, or that if they do, you don't care
and the blunt end of a feed is considered likely to run in a separate thread 05:28
feeds are sort of doing what other languages use "futures" for, except they're potentially lists and not just scalars 05:29
I think Oz has a similar concept of "ports" 05:30
so the processor is even allowed to spin the blunt end of a feed off to somewhere else on the network if it likes. 05:31
and a hyper feed is something very like Google's map/reduce algorithm 05:33
but maybe that's not for 6.0.0
Aankhen`` That'd be interesting. 05:37
As I said a while back, I read the synopses quite a bit, but I'm pretty sure I'll still be discovering features long after 6.0.0 is released. 05:38
revdiablo Aankhen``: I wonder if that statement is equally true for TimToady ;) 05:39
Aankhen`` It's lazily true. ;-)
TimToady if you s/read/write/, sure.
Aankhen`` LOL. 05:40
revdiablo I just got the image of randomly pounding the keyboard until features emerge =)
Aankhen`` Haha.
TimToady yeah, I imported about a million monkeys a few years back... 05:41
Aankhen`` One thousand monkeys with one thousand typewriters and one thousand years, or Larry... hrm...
revdiablo Apparently someone's put $larry in hyper context
TimToady definitely some kind of eager context, at least 05:42
I'm not very good at multithreading though
revdiablo The STM is working overtime 05:43
=)
TimToady need someone who's better at ADHD than I am *cough* audrey *cough*
05:44 Psyche^ is now known as Patterner
Aankhen`` ?eval my @foo{<a b>} 05:52
Eek, still no evalbot.
dduncan depending how badly you need it, some human could pretend to be a bot 05:53
Aankhen`` perlbot: be evalbot
perlbot <evalbot> WHY USE PEARL!? C IS FASTAR?!?!?
Aankhen`` :-(
dduncan eg, what you said results in: Cannot cast into Hash: VRef <Array:0x2eaf660> 05:54
at <interactive> line 1, column 1-15
Aankhen`` Tsk, tsk.
I have to rebuild Pugs first. 05:55
dduncan maybe you meant to say ...
?eval my @foo<a b>
TimToady that's also wrong
Aankhen`` I'm just copying S09's my @seasons{ <Spring Summer Autumn Winter> };
Or at least I thought I was.
TimToady not impl
dduncan oddly enough, that gives the same error
Aankhen`` Cool.
dduncan or actually, not oddly 05:56
TimToady indeed, they should mean the same
dduncan I was treating <a b> like an array slice, but those are characters, so obviously a hash slice
Aankhen`` my @foo{ <a b> } == my @foo<a b>? 05:57
dduncan try changing the @ to % 05:58
Aankhen`` dduncan: I'm trying to use user-defined indexes.
TimToady subscripts on declarations aren't impl
Aankhen`` TimToady: Yeh, I figured as much. I was wondering about <TimToady> indeed, they should mean the same
dduncan I assume you mean enums
TimToady basically, almost none of S09 is implemented
Aankhen`` Awww, poop. 05:59
dduncan afaik, once the new MO comes in next week or whenever, it should be orders of magnitude easier to add any other language features
Aankhen`` I'm sorry, what does MO stand for? 06:00
dduncan meta-objects
Aankhen`` Ah.
TimToady with a bad pun on Modus Operandi
amnesiac MO = Mega objetos! 06:02
or Muchos Objetos
TimToady hmm, if Microsoft can get .ms domains from montserrat, I wonder if we can get .mo domains from macao, or even .pl domains from poland... 06:06
and I wonder what country .p6 would be? 06:07
amnesiac I guess you can get .pl domains without problems...
zamolxes darn. formmail.pl is taken 06:13
TimToady hmm, .pm is Saint Pierre and Miquelon 06:15
Aankhen`` If an object is used as a hash key, I presume that prevents it from being GC'd? 06:18
TimToady presumably 06:20
Aankhen`` presumptuousness++
TimToady oddly, there seem to be no .pm web pages when I google for Saint Pierre and Miquelon. .info, .com, .ca, au, and .fr, but no .pm 06:21
obra www.nic.pm
Looks like they're not accepting registrations within .pm
TimToady which redirects to .fr 06:22
obra Yep.
but it resolves ;)
www.iana.org/root-whois/pm.htm
lambdabot Title: IANA | .pm - Saint Pierre and Miquelon
TimToady don't want to give them ideas about seceding from France, I guess... 06:23
obra grins
06:23 amnesiac_ joined
obra I'm amused that one of the top hits for .pm on google is london.pm bemoaning the fact that they can't get 'london.pm' 06:25
Aankhen`` LOL.
TimToady I wonder what the domain for Sealand is...
06:25 Averell joined
obra Ryan never managed to get one. 06:25
He was trying for a telephone country code first 06:26
Aankhen`` class Pooch:name<Dog>:ver<1.2.1>:auth<cpan:JRANDOM> # this is the class declaration, right? 06:27
amnesiac_ TimToady, Sealand?
Aankhen`` (As opposed to a lexical alias for Dog declared within a `use`ing program.)
TimToady an attempt to bootstrap a country on an abandoned oil platform 06:28
obra Anti-aircraft iirc. 06:29
www.sealandgov.org/history.html 06:30
lambdabot Title: The Principality of Sealand
TimToady The name "Pooch" is a lexical alias only in the current file, "Dog" is the official name in the library 06:33
06:37 devogon joined
Aankhen`` Okay. 06:47
Does `grammar Foo` at the top of a file indicate Perl 6 in the same manner as `module Foo`? 06:52
TimToady y
Aankhen`` Whee.
TimToady zzz & 06:55
Aankhen`` Sleep tight.
07:02 audreyt joined 07:04 nicodaemos joined 07:05 nicodaemos_ joined 07:55 dmq joined
dduncan I discovered an interesting bug in my Perl 5 code just now (who knows if it would affect my Perl 6 code too), and it concerns for example having a QDRDBMS::AST::SeqSel in my code. The bug is that I have both a class with that name, as well as a module named QDRDBMS::AST which has a SeqSel routine 07:56
which is exported
one was just a wrapper for another, but the bug is that calling the longer one with ->new somehow invoked the subroutine instead
I'm thinking I may have to rename the subroutine wrappers to get around this 07:57
still, something I never expected to happen
meppl good morning 08:06
08:15 xinming joined, overrosy joined 08:22 franck__ joined 08:26 franck__ joined, bernhard joined 08:27 larsen_ joined 08:35 trunix joined 08:37 ofer joined
moritz hi there 08:41
08:53 iblechbot joined 09:06 DarkWolf84 joined 09:18 isaacd joined 09:34 elmex joined 09:39 overrosy left 09:45 dduncan left 10:11 chris2 joined, riffraff joined
riffraff hi 10:12
moritz hi ;) 10:13
10:13 araujo joined
riffraff so I finally upgraded again a,nd with a ghc found in the ubuntu repos :D 10:15
but I think there is something wrong in the building procedure: if a lib is missing (ghc-net in my case) the .setup-config is not generated but the building process still goes on 10:17
moritz riffraff: I can provide you with my local patches to debian/, that should enable you to use dpkg-buildpackage to build debian packages 10:18
riffraff I don't care, ghc-6.6 is good enough for me
but thanks
moritz I'm talking about debian packages of pugs 10:19
which enables you ton install pugs in a sane way without using "make isntall"
riffraff oh 10:20
well, even there not much point I never installk pugs, just run it from the build dir, but it's nice to know that if I would I could :D
moritz ok ;) 10:21
it would complain about missing build dependencies - theat's why I came up with it in the first place ;)
riffraff makes sense 10:24
is it normal that [1,2] == [2,1] ? 10:31
I mean it is nice but unexpected
wolverian ?eval +[1,2] 10:32
(the answer is 2) 10:33
lumi So it's expected, but not nice? 10:34
wolverian I'm not sure what else it could sensibly do but length comparison 10:36
riffraff [==](@aZ@b)
10:36 isaacd joined
riffraff that's what I'd expect 10:36
cmp maybe
wolverian surely == won't do that.
moritz ===? 10:37
wolverian or rather, surely you don't expect == to do that.
riffraff well, I do, but it's ok to have a wrong expectation
wolverian I assume you want cmp. 10:38
moritz @a === @b or @a.sort === @b.sort do what you want
lambdabot Maybe you meant: activity activity-full admin all-dicts arr ask . v
moritz lambdabot: no, I didn't ;)
riffraff yeah I think so
wolverian moritz, no. === checks object identity.
what you want is probably Set(@a) cmp Set(@b) 10:39
moritz wolverian: but Set(...) ignores duplicates - is that what you want?
wolverian I just assumed it was whta riffraff meant originally. 10:40
hard to say from his example.
s,whta,what,
moritz ok
riffraff true, actually I need to compare lists with no duplicates but I went aòlready with @a.sort cmp @b.sort 10:41
Set are +really+ slow, on my box
wolverian Set.pm's implementation looks a bit.. naive 10:42
riffraff by the way, what is the method to check if an element is in an array? 10:45
moritz $element = any(@array) perhaps?
riffraff eh
I know
I'd just avoid junction if possible
moritz or perhaps even $element ~~ @array?
riffraff mh good idea 10:46
moritz but it doesn't work
at least not in pugs
riffraff bad :/
mh 10:48
something is wroing i my pugs,
is it normal that typing a sub definition in it you get a huge stringification of the AST ? 10:49
wolverian that would be $elem ~~ Set(@array) ;)
moritz riffraff: it's new, but it's logical 10:51
wolverian or @array ~~ $elem
moritz riffraff: otherwise .perl on closures wouldn't stringify correctly
riffraff I see 10:52
wolverian ugh, wait, I misread.
those are deprecated.
10:54 buetow joined
wolverian I think $elem cmp any(@array) is what you want, or @array.Set.contains($elem). 10:56
riffraff I want .contains in the List role 11:02
or in Seq, still can't understand the whole container tower
Map, possibly
wolverian I'm not sure that's a good idea. it encourages people to use inefficient structures. 11:04
if you want fast membership test, use a hash or a set. and so on. :)
riffraff put it in perspective, you may have a lot of happy moments by switching from inefficient to efficient data structures :) 11:05
11:06 overrosy joined
moritz perhaps a special profiler could tell you "you use many membership tests on lists, consider hashes" ;) 11:07
11:20 franck__ joined
riffraff I think this is what the Smalltalk guys call the "code critic" 11:24
darn I can't 8understand why if I test foo() & bar() everything works, if I try baz() {foo();bar()} in the repl everything works but then my tests for baz() fail 11:39
moritz maybe because & is short circuit? 11:40
and in the second case you and-ify nothing, right?
riffraff ah no that was just to write "a and b" not a aperl operator :) 11:41
I mean my testa for foo() pass, for bar() too, if I try omposing them in interactive òpugs it worlks but in a script it fails 11:42
pasteling "riffraff" at 83.181.255.73 pasted "spell corrector with crazy behaviour" (160 lines, 3.2K) at sial.org/pbot/24998 11:50
riffraff if someone could take a loook I'd be pleased, the failing tests are in the end, the ones for the correct() function 11:51
sadly, impossible to reduce to seomthing smaller :/
12:26 overrosy left
svnbot6 r16461 | gabriele++ | changed "make fast" to "make soon" to reflect real beahviour 12:31
12:33 rindolf joined 13:02 Limbic_Region joined
Limbic_Region salutations all 13:07
rindolf Shalom Limbic_Region ! 13:13
Limbic_Region: how do you do? 13:14
13:15 prism joined 13:18 xinming_ joined 13:33 prism joined 13:45 ggoebel joined 13:56 pmurias joined
pmurias is Makefile.PL supposed to use inc/Module/Install.pm in the pugs repo? 13:56
(mine dosn't)
diakopter pmurias: I think it uses a later version if it can find it. which one is yours using? 13:57
14:02 avar left
pmurias a wrong one as i get an evil error 14:03
how should i check? 14:04
14:05 avar joined
diakopter pmurias: I guess you could put print $Module::Install::VERSION after it's used 14:06
what's your evil error
pmurias Can't call method "load_all_extensions" on an undefined value at inc/Module/Install.pm line 128.
BEGIN failed--compilation aborted at Makefile.PL line 51.
it might be the pugsone because perl -Minc::Module::Install dosn't work 14:07
diakopter pmurias: moritz.faui2k3.org/irclog/out.pl?ch...11#id_l141 14:08
lambdabot Title: IRC log for #perl6, tinyurl.com/yt8xrr
pmurias thanks 14:12
diakopter were you using 'perl Makefile.PL' ?
pmurias it works only if name my perl executable /usr/local/bin/perl instead of /usr/bin/perl 14:13
strange
should have googled in again today 14:16
14:23 avar joined 14:33 iblechbot joined
pmurias s/in/the error in/ 14:41
14:49 REPLeffect joined
DarkWolf84 probably u've compiled perl from source :) 15:01
that's why the path is /usr/local/perl not /usr/bin/perl
15:09 offby1 joined
lumi Does anyone know perl5/PIL2JS/lib6/Prelude/JS/Rules.pm ? Is it current, relevant, should work? 15:18
avar the js emitter is largely coderotted, don't know about that file 15:19
lumi It's just that it doesn't even compile, in line 65 it refers to a variable $perl5 which doesn't exist 15:20
moritz that happend to quite a few packages in ext/ as well 15:21
lumi At a guess just removing that final if is the correct fix, but if it's in total coderot I don't know if that's any good
I guess a nice weekend task is to see whether PIL2JS is salvageable 15:22
moritz that line looks a bit weird anyway
lumi s/whether/how/
Well yes
15:22 goban left
moritz I guess you can just remove the 'if $perl5;' 15:23
that seems to be a redundant braino of the enclosing if !$p5 15:24
moritz notices that evalbot6 is gone :( 15:27
svnbot6 r16462 | moritz++ | PIL2JS: fixed braino that kept Rules.pm from compiling
moritz s/6/
oh, I see, I'm not the first one who noticed that 15:28
lumi You're the second? 15:30
moritz or even later 15:31
lumi Someone has fixed this before?
moritz no, that evalbot is missing ;) 15:32
15:32 theorbtwo joined
moritz but there is a parse failure in Algorithm::TokenBucket that I can't fix :( 15:33
lumi What does that break?
moritz ok, I found a fix 15:34
Net::IRC or something
lumi How do I tell SVK what my user is?
clkao env USER= 15:35
svnbot6 r16463 | moritz++ | Algorithm::TokenBucket now compiles again
15:35 chris2 joined
lumi clkao: Thanks 15:35
clkao: It remains unconvinced 15:36
15:39 isaacd_ joined
lumi Oh hah, I figured it out 15:40
svnbot6 r16464 | lumi++ | Wrong fix to make PIL2JS compile again
15:40 rindolf joined
moritz sub foo($bar, $baz = $bar) { ... } now produces a compiler error 15:41
at least that's how I interpret Net::IRC's errors 15:42
pmurias DarkWolf84: i have perl from portage, i have it on my systems as /usr/bin/perl and linked as /usr/local/bin/perl
Makefile.PL only works if i use the link
DarkWolf84 strange
a have perl from portage too 15:43
pmurias which version
DarkWolf84 wait a moment
mine is the last unstable version 15:44
sys-apps/portage-2.1.2.7 15:45
that says emerge
pmurias :) which version of perl
?
DarkWolf84 ok
5.8.8 I think 15:46
v5.8.8 built for i686-linux-thread-multi
pmurias the same as mine
does perl Makefile.PL work for you?
DarkWolf84 yes 15:47
but I didn't check the current svn 15:49
pmurias correction ./Makefile.PL works for me not /usr/local/bin/perl Makefile.PL
15:55 kanru joined 16:08 psst_ joined
psst_ mrgn 16:08
16:10 nicodaemos joined 16:11 psst_ is now known as psst 16:19 thoughtpolice joined 16:27 [particle1 joined 16:34 [particle1 left
diakopter isis is stable these days? 16:37
argh
audreyt :) 16:43
lambdabot audreyt: You have 4 new messages. '/msg lambdabot @messages' to read them.
16:44 freezone left
moritz audreyt: you propably already notice that... evalbot dies because definitions like sub foo($bar, $baz=$bar) complain about $bar not beeing declared 16:45
audreyt I don't... restarting it (that bug has been fixed)
moritz ok, then my pugs is outdated
16:57 BooK joined 16:59 [particle] joined 17:05 bonesss joined 17:07 weinigLap joined 17:11 evalbot_r16464 joined, amnesiac joined 17:39 BooK_ joined 17:44 nicodaemos joined 17:50 Psyche^ joined 17:51 renormalist joined 17:55 prly joined 17:58 Psyche^ is now known as Patterner 18:02 prly_ joined 18:05 ggoebel joined 18:07 prly__ joined, Limbic_Region joined
renormalist Why should I think twice before pugs make install? 18:08
I have a lot of pugses installed ...
moritz sometimes it overwrites perl6 modules - or something
it is generally rather broken
18:09 bonesss joined
renormalist m'kay 18:10
btw, moritz, in which city do u live?
it's germany, isn't it? 18:11
moritz renormalist: currently in edinburgh, but usually in würzburg
renormalist ah
in eding
ups
psst so what does 'mrgn' mean?
moritz and every second weekend in erlangen ;)
psst: that's short for "morgen" or "good morning" 18:12
psst ahaa!
so it doesn't mean 'tomorrow'?
renormalist the erlangen with the Erlangen.pm? do you know them?
psst thanks, moritz 18:13
moritz renormalist: exactly that - but I haven't been there yet
18:14 ggoebel joined
moritz psst: but you are right in some sense, "good morning" and "tomorrow" can be the same word in german 18:18
psst moritz: but on #perl6 it is 'morning' 18:19
moritz right
psst moritz: ok - thanks - that settles a discussion on #svn 18:20
psst waves
18:20 psst left 18:28 jisom joined, bonesss joined, Patterner joined, rindolf joined, franck__ joined, araujo joined, ofer joined, Yappo joined, xern joined, Caelum joined, cls_bsd joined, haelix joined, obvio171 joined, rgs joined, cernd joined, gaal joined, LCamel joined, arguile joined, takesako___ joined, kolibrie joined, QtPlatypus joined, buu joined, jql joined 18:31 bonesss joined, Patterner joined, rindolf joined, franck__ joined, araujo joined, ofer joined, Yappo joined, xern joined, Caelum joined, cls_bsd joined, haelix joined, obvio171 joined, rgs joined, cernd joined, gaal joined, LCamel joined, arguile joined, takesako___ joined, kolibrie joined, QtPlatypus joined, buu joined, jql joined 18:38 ggoebel joined 18:39 jisom joined 18:45 nicodaemos joined 19:02 Eidolos joined
svnbot6 r16465 | moritz++ | typo in t/builtin/math/exp.t 19:02
Yaakov wc
19:02 Yaakov left 19:10 bonesss joined
renormalist I experiment with "use v5". Weren't variables shared between the v6 and v5 scope? 19:17
pasteling "renormalist" at 87.234.95.11 pasted "How are variables shared between v6 and v5 scope?" (6 lines, 126B) at sial.org/pbot/25005
svnbot6 r16466 | moritz++ | added t/builtins/lists/first.t 19:20
r16467 | moritz++ | added smartlinks to t/builtins/lists/minmax.t 19:23
19:33 bernhard joined
moritz ?eval ^2 19:41
19:41 evalbot_r16464 is now known as evalbot_r16465
evalbot_r16465 (0.0, 1.0) 19:41
Tene ?eval sqrt(-1) 19:42
evalbot_r16465 NaN
moritz ?eval sqrt(-1 + 0i)
evalbot_r16465 0.0 + 1.0i
renormalist nice 19:43
Tene ?eval $m = sqrt(-1 + 0i); ^$m
evalbot_r16465 ()
moritz ?eval ^sqrt(2) 19:45
evalbot_r16465 (0.0,)
moritz ?eval ^sqrt(5) 19:46
evalbot_r16465 (0.0, 1.0)
Tene ?eval 2²
evalbot_r16465 Error: ␤Unexpected "\178"␤expecting "_", fraction, exponent, term postfix or operator
Tene ?eval sub postfix:<²> { $a**2 }; 2² 19:47
evalbot_r16465 Error: ␤Unexpected "\178"␤expecting "_", fraction, exponent, term postfix or operator
renormalist ?eval say "foo"; say "bar" 19:49
moritz ?eval sub postfix:<²> { $^a**2 }; 2²
evalbot_r16465 OUTPUT[foo␤bar␤] Bool::True
Error: ␤Unexpected "\178"␤expecting "_", fraction, exponent, term postfix or operator
renormalist ?eval my @words = <foo bar - example>; say "p6: ", @words; 19:50
evalbot_r16465 OUTPUT[p6: foobar-example␤] Bool::True
renormalist ?eval my @words = <foo bar - example>; my $words = @words; eval('print "p5: ", @$words, "\n"', :lang<perl5>);
evalbot_r16465 1.0
renormalist ?print "foo" 19:51
lambdabot Not enough privileges
renormalist I'm still in experimenting the v5-bridge. For me it seems it only works with scalars. Is this correct? 19:52
If I use a reference to an array (in the middle of following line) it works: 19:53
my @words = <foo bar - example>; my $words = @words; eval('print "p5: ", @$words, "\n"', :lang<perl5>);
but not: 19:54
my @words = <foo bar - example>; eval('print "p5: ", @words, "\n"', :lang<perl5>);
Any hints?
Tene ?eval {use v5; print "p5: stuff\n"; } 19:55
19:55 evalbot_r16465 is now known as evalbot_r16467
evalbot_r16467 1.0 19:55
20:02 Jmax joined
renormalist probably lives in the wrong timezone, it's a pity ... :-) 20:03
20:22 mr_ank joined 20:26 [particle1 joined 20:43 nicodaemos joined
renormalist ?eval my @foo = [[1, 2], 3]; say @res.perl 20:47
evalbot_r16467 OUTPUT[[]␤] Bool::True
renormalist ?eval my @foo = [[1, 2], 3]; say @foo.perl
evalbot_r16467 OUTPUT[[[[1, 2], 3],]␤] Bool::True 20:48
20:48 Jedai joined
Jmax why is it outputting utf8? 20:48
renormalist Jmax: dont know, maybe because I cut'n'pasted from an utf8 terminal
?eval my @foo = [[1,2],3] say @foo.perl; 20:49
evalbot_r16467 Error: ␤Unexpected "say"␤expecting operator or ","
Jmax er, not in what you said, but in the evalbot
renormalist ?eval my @foo = [[1,2],3]; say @foo.perl;
evalbot_r16467 OUTPUT[[[[1, 2], 3],]␤] Bool::True
theorbtwo The evalbot always outputs utf8.
Jmax i need to restart screen with -U brb
moritz Jmax: evalbot substitues \n bis N/L
Jmax N/L ?
locale-specific newline? 20:50
theorbtwo No, there's a unicode character reserved for a graphical representation of the NL character.
moritz the Unicode Character ␤
Jmax argh
let me restart screen and show me again :) 20:51
theorbtwo U+2424 SYMBOL FOR NEWLINE
Jmax oh, I see
renormalist why is my array [[1,2], 3] expanded with one more level of brackets? (see last eval above)
I generally get confused when [] and when () are used in output of arrays 20:52
?eval my @res = -« [[1, 2], 3]; say @res.perl 20:53
evalbot_r16467 OUTPUT[[(-1, -2), -3]␤] Bool::True
moritz renormalist: if you want [] to be used, use .perl
renormalist In my last line it mixes brackets with parens.
after the hyper operator was used 20:54
I don't understand this
moritz: when do I use [] and when () to work with lists? do u know? 20:57
moritz renormalist: whenever you want to nest arrays you use [] 20:59
renormalist: so evalbots output with () is wrong 21:00
renormalist: because if you eval() it again, it will be flattened
() don't do anything but grouping the values
21:00 isaacd__ joined
moritz at least afaict 21:01
21:06 mako132_ joined
renormalist I see. I have (re-)found the example in S03 and it uses brackets when hyperoperating on nested lists. 21:07
21:09 Aankhen`` joined
moritz ?eval [(1,2)].perl 21:09
evalbot_r16467 "[1, 2]"
moritz the round parenthesis are a noop in that context
21:10 avar joined
wolverian looks like a bug up there 21:10
moritz what?
?eval (1, 2, (3, 4), 5).perl 21:11
evalbot_r16467 "(1, 2, 3, 4, 5)"
moritz same here - () don't construct lists anymore in p6
renormalist I see. The bug is probably in what the hyperoperator -« on the nested list did above 21:12
?eval my @res = -« [[1, 2], 3]; say @res.perl 21:13
erm, hello eval bot?
?eval my @res = -« [[1, 2], 3]; say @res.perl;
wolverian right.
Tene ?eval [:a<b>, :d<e>]
evalbot_r16467 OUTPUT[[(-1, -2), -3]␤] Bool::True
OUTPUT[[(-1, -2), -3]␤] Bool::True 21:14
[("a" => "b"), ("d" => "e")]
Aankhen`` ?eval my @res = -« [[1, 2], 3]; say @res.perl; 21:16
evalbot_r16467 OUTPUT[[(-1, -2), -3]␤] Bool::True
Aankhen`` Musta been a lag spike.
renormalist but maybe it's a bug in .perl, because: 21:17
?eval my @expected = [[-1, -2], -3]; say @expected.perl;
evalbot_r16467 OUTPUT[[[[-1, -2], -3],]␤] Bool::True
renormalist I always get an additional level of brackets 21:18
moritz renormalist: the "say" produces an "OUTPUT[$foo]"
renormalist: that's where the outer [] come from
Tene ?eval my @res = -« ([1,2], 3); say @res.perl;
evalbot_r16467 OUTPUT[[(-1, -2), -3]␤] Bool::True 21:19
Aankhen`` ?eval my @foo = [ 1, 2 ]; say @foo.perl
evalbot_r16467 OUTPUT[[[1, 2],]␤] Bool::True
Tene ?eval my @foo = [ 1, 2 ]; @foo 21:20
evalbot_r16467 [[1, 2],]
Tene ?eval my @foo = [ 1 ]; @foo
evalbot_r16467 [[1,],]
renormalist I have that additional bracket also in Pugs shell.
Tene ?eval my @foo = 1; @foo
evalbot_r16467 [1,]
Tene ?eval my @foo := [1, 2]; @foo 21:21
evalbot_r16467 [[1, 2],]
Tene it's related to assigning a scalar to a list being equivalent to putting the scalar in the first element of the list. 21:22
the [...] returns a list that is put in the first element of @foo
renormalist that means @foo = [1,2,3] is the wrong thing I do 21:23
I should do @foo = (1,2,3);
Tene renormalist: are you wrong, or is the spec wrong, or is the implementation wrong? 21:24
moritz renormalist: or just @foo = 1, 2, 3;
Tene I *suspect* that you're wrong. I'm not completely sure, though.
this should probably be discussed on the ml, if it hasn't already.
moritz [...] is like an array ref in p5 I think 21:25
renormalist Maybe my confusion of () and [] comes from that. I cut'n'pasted .perl results and re-used them in succeeding experiments.
Aankhen`` I was under the impression that you could say `my @foo = [ 1, 2, 3 ]` or `my %bar = { a => 'b', c => 'd' }` and they'd be deref'd automatically. 21:26
I wonder.
renormalist Aankhen``: that's what I assumed, too
Now I understand Tene's ?eval my @foo = 1; @foo 21:28
?eval my @foo = 1; @foo
evalbot_r16467 [1,]
moritz Aankhen``: but at least in the case of lists it would make it hard to construct what it now means
Aankhen`` Maybe it just isn't implemented?
moritz: Perhaps you could get that with ([ 1, 2 ]) 21:29
Tene ?eval my %hash = :a<b>, :n<l>; %hash
evalbot_r16467 {("a" => "b"), ("n" => "l")}
Tene ?eval my %hash = [:a<b>, :n<l>]; %hash
evalbot_r16467 {("a\tb" => ("n" => "l")),}
Aankhen`` Heh.
moritz Aankhen``: that would be inconsitent, because () don't create lists...
Aankhen`` moritz: I guess so.
Tene This clears up a bug I kept re-introducing in some code the other day.
moritz Aankhen``: perhaps my @a = [1, 2,],;
Aankhen`` Yeah, maybe.
moritz but I quit like it the way it is now 21:30
Aankhen`` Ah, here we go, from S02:
moritz if you want to construct a list, use the comma operator
Aankhen`` Hmm, no wait.
no, wait even.
Aankhen`` continues looking.
renormalist ?eval my @foo = (1, 2, 3, 4); my @bar = eval (@foo.perl); @bar 21:33
evalbot_r16467 [[1, 2, 3, 4],]
renormalist That behaviour is strange, IMHO. I would expect the output of .perl to be eval'able directly 21:34
21:35 mako132_ joined
moritz renormalist: I'm pretty sure that's a bug 21:35
renormalist The question is, where. In .perl's way of printing arrays? 21:36
moritz I think so, yes
thoughtpolice seems the logical place to start
moritz ?eval my @foo = 1, 2; @foo.perl
evalbot_r16467 "[1, 2]"
renormalist or in Perl6 in not dereferencing array refs to lists in assignments?
moritz the [] are wrong
Jedai ?eval my @array = [1,2]; @array.elem 21:38
evalbot_r16467 Error: No such method in class Array: &elem
Jedai ?eval my @array = [1,2]; @array.elems
evalbot_r16467 1
Jedai From what I read, I understood that this assignment should have created an array with 2 elements 21:39
moritz Jedai: where did you read that? 21:40
Jedai Here we have the Perl5 behaviour
I'll search for it
But it may be quite old 21:41
So it may have changed
Still the S02 say now : 21:42
To get a Perlish representation of any object, use the .perl method. Like the Data::Dumper module in Perl 5, the .perl method will put quotes around strings, square brackets around list values, curlies around hash values, constructors around objects, etc., so that Perl can evaluate the result back to the same object.
avar ?eval my @array = [1,2]; @array[0].elems 21:43
evalbot_r16467 2
Aankhen`` "square brackets around list values"
avar it's a 1 element array with an array ref that has 2 elems
renormalist moritz: at least S02 says "To get a Perlish representation of any object, use the .perl method. Like the Data::Dumper module in Perl 5, the .perl method will put ... square brackets around list values, ..."
moritz ok, you convinced me
Aankhen`` Implies that [ 1, 2 ] ought to be parsed as a list, not an arrayref.
Or at least so it seems to me.
moritz right
avar ?eval my @array; @array.perl
evalbot_r16467 "[]"
Aankhen`` I dunno about the [ 1, 2 ], to get the old behaviour, but you could at least use: [ [ 1, 2 ] ] 21:44
avar ?eval [[1,2]].elems
evalbot_r16467 1
avar this is what you're doing essentially
so the docs are right-ish, but maybe it should say s/list/array/?
avar isn't clear on the terminology
Aankhen`` ?eval [[1,2]].perl.say 21:45
moritz why? [1, 2] isn't an array
evalbot_r16467 OUTPUT[[[1, 2],]␤] Bool::True
Aankhen`` Huh, that parses right.
Er.
?eval my @foo = [[1,2]]; @foo.perl.say
evalbot_r16467 OUTPUT[[[[1, 2],],]␤] Bool::True
Aankhen`` Nevermind. :-) 21:46
renormalist The t/builtins/perl.t contains some .perl.eval tests that are commented out, maybe for reason, but I'm not sure they handle the same what we discuss
Jedai In clear it seemed to me that [1, 2] in list context should interpret as a two elements list, rather than a one element list with first element being a ref
Aankhen`` Jedai: Aye. 21:47
renormalist Jedai: In clear? 21:48
Tene I'm not so sure... [] is for grouping tighter, to prevent flattening. 21:49
if you want flattening, use ().
I suspect.
moritz or nothing
Tene yeah
Jedai renormalist : Sorry if it's wrong, English ain't my native language 21:50
Tene what about, for example, @list = ([ ... ])
moritz I can't understand why you are so fond of (...) ;-) 21:51
Jedai Tene : In S02 it's pretty clear that () is flattening (or rather is almost a noop, just group)
renormalist Tene: I see, my initial problem was the mixed output of .perl that used both () and [] in practically the wrong way:
?eval my @foo = -« [[1, 2], 3]; say @foo.perl;
evalbot_r16467 OUTPUT[[(-1, -2), -3]␤] Bool::True
Tene moritz: that's what I'm saying, [...] is the same as ([...]) 21:52
Jedai Tene : In my opinion, this syntax should just create an array, the () being absolutely noop there
renormalist Jedai: ok, then I think I understood. I thought it's sth. that my English wasn't good enough for. :-)
Jedai Tene: I agree
renormalist Tene: I agree, too. But the example produces [()] which is wrong 21:53
moritz right
Jedai renormalist: This output by Perl is clearly a bug
by .perl sorry
Tene which output, specifically, is incorrect?
renormalist ?eval my @foo = -« [[1, 2], 3]; say @foo.perl;
this one
evalbot_r16467 OUTPUT[[(-1, -2), -3]␤] Bool::True
Tene Ahh. 21:54
renormalist outside: [], innerside ()
Tene Yes.
Jedai Because it flattens when it shouldn't
and when .perl did not mean to (I infer this from the fact it bothered to put parens) 21:55
moritz that's what we get from taking a non correct implementation as reference ;)
renormalist But again, I'm not sure whether it's .perl's failure. It might be the hyperop.
moritz: :-)
Jedai ?eval my @foo = -« [[1, 2], 3]; @foo.[0].elems;
moritz ?eval my @foo = -« [[1, 2], 3]; @foo[0][0]
evalbot_r16467 2
\-1 21:56
moritz it _is_ a .perl bug
renormalist I understand
Jedai which means it's probably easier to fix (I hope) 21:57
renormalist Should this become a test in t/builtins/perl.t ?
moritz renormalist: yes
renormalist I'm not sure how to write the test, as a string compare to an expected result?
moritz renormalist: eval($data.perl) and compare it to the original structure? 21:58
Jedai which still doesn't say us if "my @array = [1,2]; @array.elems" should produce 2 or 1
renormalist ?eval [[-1, -2], -3].perl
evalbot_r16467 "[[-1, -2], -3]"
moritz Jedai: I think the S02 excerpt is pretty clear about that 21:59
Jedai Ok....... o_O
Tene ?eval my @foo = ([1, 2], 3); eval(@foo.perl)
evalbot_r16467 [[1, 2], 3] 22:00
Jedai So to be sure it's really clear, what's everyone guess at my question ?
I say 2
Tene ?eval my @foo = ([1, 2], 3); @foo.perl
evalbot_r16467 "[[1, 2], 3]"
Tene ?eval my @foo = -« ([1, 2], 3); eval(@foo.perl)
evalbot_r16467 [-1, -2, -3]
Tene There we go.
?eval -« ([1, 2], 3)
evalbot_r16467 ((-1, -2), -3) 22:01
Tene ?eval ([1, 2], 3)
evalbot_r16467 ([1, 2], 3)
Jedai Ok, I don't get it
renormalist it's a double bug or double confusion
Tene post my last three examples to the mailing list 22:02
Jedai ?eval ([1,2],3).perl
evalbot_r16467 "([1, 2], 3)" 22:03
Jedai ?eval my $array = [[1, 2], 3]; $array.perl 22:04
renormalist the hyper on the arrayref should have never been [[1,2],3] but ([1,2],3), as in Tene's eval above. My original [[1,2],3] is maybe the initial failure.
evalbot_r16467 "[[1, 2], 3]"
Tene something really weird is going on with the hyperop 22:05
([1, 2], 3).perl is correct, but .perl on the result of -«([1, 2], 3) is incorrect
22:05 justatheory joined
Tene uses inner ()s. 22:06
renormalist exactly
Tene: which maillist do you mean, p6-compiler? 22:09
Tene perl6-language 22:10
renormalist k 22:11
22:12 Jmax joined 22:26 justatheory joined 22:28 bonesss joined 22:40 lucs joined 23:01 lisppaste3 joined
svnbot6 r16468 | renormalist++ | - :todo-tested a bug with .perl on result of a hyperoperator 23:03
r16468 | renormalist++ | - BTW, which one is the real test file perl.t or perl2.t?
23:18 ggoebel joined 23:21 Eidolos_ joined
svnbot6 r16469 | renormalist++ | - mini newline fixes for better interactive console feeling 23:22
r16470 | Aankhen++ | * added first stab at set of (as yet non-functional) grammars for parsing the IRC protocol: examples/rules/Grammar-IRC.pm
23:30 Eidolos_ is now known as Eidolos
renormalist Maybe I repeat my question of some hours ago: I'm still in experimenting the v5-bridge. For me it seems it only works with scalars. Is this correct? 23:39
If I use a reference to an array (in the middle of following line) it works:
my @words = <foo bar - example>; my $words = @words; eval('print "p5: ", @$words, "\n"', :lang<perl5>);
but not:
my @words = <foo bar - example>; eval('print "p5: ", @words, "\n"', :lang<perl5>);
Any hints?
23:40 ggoebel joined 23:48 buetow joined 23:58 unreal_name joined
unreal_name hey guys 23:58
quick question, how do i check if a file with "filename"
is an image?
avar first think of how you'd define an image 23:59