»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
masak 'night, #perl6 00:07
sorear bye masak
00:13 buubot_backup joined
pmurias sorear: where is that implemented? 00:22
00:37 mykhal joined 00:43 kst left 00:47 kst joined 00:50 benabik joined 01:02 xjiujiu joined, benabik left 01:03 benabik joined
flussence nom: my $num = 10; $num .fmt= '%04d'; say $num; # if I want $num to be "0010", how short can I really make this without breaking it? 01:24
p6eval nom 1e966b: OUTPUT«===SORRY!===␤Confused␤at /tmp/SJ8akhpMex:1␤» 01:25
01:35 kst left
sorear nom: my $num = 10; $num.=fmt:'%04d'; say $num 01:35
p6eval nom 1e966b: OUTPUT«===SORRY!===␤Confused␤at /tmp/khTZISNnYj:1␤»
sorear nom: my $num = 10; $num.=fmt: '%04d'; say $num 01:36
p6eval nom 1e966b: OUTPUT«0010␤»
sorear nom: my $num = 10; $num.=fmt('%04d); say $num
p6eval nom 1e966b: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 2␤»
flussence sorear++
clever use of indirection :)
sorear ...indirection? 01:37
nom: sub postfix:<%>($x is rw) { $x.=fmt('%04d'); }; my $num = 10; $num%; say $num 01:38
p6eval nom 1e966b: OUTPUT«0010␤»
flussence I wouldn't have thought to use the colon syntax there, probably because I'm wrong :)
sorear it didn't actually do anything useful
apparently the colon requires a space after it to disambiguate from name extensions ($foo.infix:sym<+>) 01:39
and ': ' is as long as '()'
I was trying to save a character, and failed
01:40 kst joined
flussence I'd completely forgotten about .= somehow so I was trying to write it like &[fmt]= while trying to get it to remember its invocant 01:41
02:10 ilogger2 joined, ChanServ sets mode: +v ilogger2 02:18 silug_ joined 02:24 thou joined 02:41 thou left 02:47 aloha joined 02:59 bacek_at_work joined 03:17 jferrero joined
dalek ast: 239bf2f | coke++ | S0 (4 files):
fudge for pugs
03:21
gs.hs: b923ddd | coke++ | t/spectest.data:
sort spectests
gs.hs: e397ced | coke++ | t/spectest.data:
run more tests
[Coke] so, any haskell hackers about? I have some LHF for you. 03:23
sorear I have haskell experience but I've never even looked at Pugs.hs 03:26
I'm not sure if I've even tried running it
[Coke] I'm trying to find where the Test module is defined - need to add a "done" sub. 03:28
sorear I'm 90% sure that the packages/Test.pm in roast is the Test module pugs use{s,d}
03:29 kst joined
[Coke] Is anyone else using it? 03:30
sorear Does any implementation other than pugs, niecza, rakudo, and alpha use roast?
Because the latter three all have their own Test 03:31
03:31 kst left, orafu joined 03:32 kst joined
[Coke] there doesn't seem to be a "sub ok" anywhere in there. 03:33
sorear going by the fudge lines - 1x kp6, 6x mildew, 1275x niecza, 520x pugs, 1295x rakudo (78x DOES :D)
is there a "multi ok" or a "only ok"?
doesn't seem like kp6 or mildew are really using roast
(either that or they're much more complete than ruoso and pmurias have let on :D) 03:34
er, fglock
[Coke] yah, we'd hear about it in here, I think.
I don't see any of those, no. 03:35
sorear dunno, seems fglock has been hacking perlito monastic-style
[Coke] Pugs.hs has no issues tab. :( 03:38
phenny: tell masak your first Pugs task is to figure out where to add a "done" sub for Test.pm (I can't even find Test.pm!) 03:39
phenny [Coke]: I'll pass that on when masak is around.
[Coke] "pugs", 1084, 0, 30, 2, 1116, 22751 03:41
sorear what are the columns for that? 03:44
[Coke] gist.github.com/1476841 03:48
"Impl", "pass","fail","todo","skip","plan","spec" 03:49
b: print 1084 / 20055 # pugs vs. niecza 03:50
p6eval b 1b7dd1: OUTPUT«0.0540513587634006»
[Coke] nom: print 1084 / 20055 # pugs vs. niecza
p6eval nom 1e966b: OUTPUT«0.0540513587634006»
[Coke] wow, slow b.
still a lot more we can run with a few fudges. 03:51
(already running 94 test files, though.)
sorear slow b? I blame caching 04:02
04:16 tokuhirom joined 04:24 lestrrat joined 04:31 tokuhirom left 04:36 emss joined 04:42 tokuhirom joined
tadzik hello #perl6 04:53
au /o 04:56
masak, [Coke]: Test.pm is currently hard-coded in Pugs as ./Pugs/cbits/Test_pm.c ... as is Prelude_pm.c. your task, should you accept it, is to write a tool that reverse it back to .pm form and get it back to .c form, then add it to makefile :) 04:59
05:08 zhutingting joined 05:13 zhutingting left 05:36 thou joined
sorear au: Why is it in ... cbits? 05:42
o/ tadzik, au
05:58 sudokode joined 06:05 sudokode left 06:06 sudokode joined
dalek ecza: c4ecd5c | sorear++ | src/niecza:
Implement $.foo(42) syntax (fixes #106)
06:11
benabik $.foo ?
sorry, I mean $.foo(42), obv.
sorear $.foo(42) means $(self.foo(42))
06:52 alvis joined 07:18 tarch joined 07:20 GlitchMr joined 07:56 noam joined
au sorear: back in the says HS issues representing very long literate ByteStrings. 07:58
*days
nowadays we can probably get by using something like hackage.haskell.org/packages/archiv...ng-QQ.html .
sorear Haskell *has* literal ByteStrings?
(stupid question, I've been gone for five years)
au they now have something approaching that 07:59
www.haskell.org/ghc/docs/7.4.1/html...ed-strings
Data.String.QQ merges IsString with multi-line quasiquoting. 08:00
but before that was available, the cbit-to-ByteString logic in src/Pugs/Prelude.hs using (unsafePerformIO . unsafePackCStringLen) was an acceptably efficient workaround. :) 08:02
we'll also want to use Text as Str instead of ByteString as both Str and Buf, etc 08:03
anyway, the ecosystem has changed a lot :)
sorear why not just use Data.ByteString.readFile? 08:05
au much slower as it hits the disk? :) 08:06
08:07 thou left
au nowadays, even that may no longer be a reasonable tradeoff, though. back in the days, it meant ~500ms startup overhead, which adds up quickly running the test suite. 08:08
08:09 noam left
sorear au: that suprises me 08:09
how big is the Pugs prelude? Niecza has a 300kb setting currently, and back in 2007 GHC could not be persuaded to emit a binary smaller than 5MB 08:10
why is the 5MB+ pugs executable in cache but the <0.5MB prelude read every time?
au $ ll 08:11
total 11232
-rw-r--r-- 1 audreyt staff 3373188 Mar 29 2011 Prelude_pm.c
-rw-r--r-- 1 audreyt staff 2374772 Mar 29 2011 Test_pm.c
08:11 noam joined
au so about 1mb data 08:11
08:11 kaare_ joined
sorear so, wait, pugs parses the prelude on every start? 08:12
au no 08:13
it's Data.Binary encoded
of the globs and pads and AST preparsed
sorear *phew*
I would have had to cry if pugs can compile 300kb of source text in <<1s 08:14
since niecza takes 60s and rakudo is/was even slower
WHY DO OUR COMPILERS SUCK SO MUCH *sobs anyway*
Woodi maybe Perl6 is little complicated a bit and gears not exactly work with each other ? 08:16
like in newly researching project... 08:17
au $ time pugs -c 300k.pm
300k.pm syntax OK
real0m13.613s
user0m12.689s
(it's Test.pm repeated over again)
but should be representative 08:18
sorear au: I need to apply a correction factor for timings other people report... you're probably not on a P4-Northwood from 2003
au I'm on feather :)
sorear yay, niecza -C CORE takes 12.9s on feather 08:19
au cool, so ~comparable 08:20
[Coke], masak: so, uh, never mind reverse-engineering the .c back to .pm... they are results of "pugs -CParse-Binary Test.pm" and "pugs -CParse-Binary Prelude.pm", from github.com/audreyt/pugs/blob/maste...Prelude.pm and github.com/audreyt/pugs/blob/maste...b/Test.pm; so just the encoding-to-cbit part is needed to modify Test.pm. 08:24
08:29 tarch left
au & 08:31
moritz o/ 09:06
sorear /o 09:20
09:24 jasonmay joined 09:32 tokuhirom left
sorear moritz: so I hear 'handles' is a priorityh 09:34
09:49 araujo joined, araujo left, araujo joined 09:51 araujo left 09:54 araujo joined 10:18 danishman joined 10:19 mj41 joined 10:23 lestrrat left 10:24 lestrrat joined
moritz sorear: well, would be rather nice to have 10:25
and probably not too complicated to implement
10:28 tokuhirom joined 10:36 unobe joined
masak good antenoon, #perl6. 10:42
phenny masak: 03:39Z <[Coke]> tell masak your first Pugs task is to figure out where to add a "done" sub for Test.pm (I can't even find Test.pm!)
masak I see au++ solved the mystery above.
tadzik hello masak 10:43
masak au: does that mean Test.pm exists in github.com/audreyt/pugs but not in github.com/perl6/Pugs.hs ? mind if we copy them over to the latter for our insidious hacking purposes? :) 10:44
sorear: +1 on 'handles' -- nice-to-have, and one less thing to have to workaround when writing cross-implementation programs. 10:49
moritz masak: forgiveness > permission
(re copying *.pm) 10:50
masak gotcha. 10:51
masak makes it so 10:52
dalek gs.hs: ffda141 | masak++ | Pugs/ (12 files):
added Test.pm and Prelude.pm

From github.com/audreyt/pugs.git
10:59
masak now, for [Coke]'s challenge... :)
11:00 mj41 left 11:02 mj41 joined 11:06 leprevost joined
dalek gs.hs: 27f1db4 | masak++ | Pugs/ext/Test/lib/Test.pm:
[Test.pm] added 'done' (and 'done_testing')

Heavily inspired by Rakudo's Test.pm.
11:10
jnthn ohhai, #perl6 11:25
tadzik ohhai jnthn
moritz lolitsjnthn 11:26
masak jnthn! \o/ 11:27
moritz currently works on the prisoner's dilemma summary, but will have little hacking time today 11:28
jnthn Welcome back, tadzik :)
moritz: How sunk is the sink work? :)
moritz stuck :/
tadzik ooh, I missed yet another contest :/ 11:29
moritz jnthn: see irclog.perlgeek.de/perl6/2012-02-17#i_5163160
and even if I change that, it seems that I get some mis-compilation
because then the 'returns' trait calls $routine.signature.set_returns, and .signature seems to return an Int :( 11:30
jnthn moritz: Not sure I follow the confusion here... 11:31
unless $precomp {
$compiler_thunk();
}
If it's false, that does the compilation and populates it
$compiler_thunk is right above, and includes the line:
$precomp := self.compile_in_context($code_past, $code_type, $slp_type);
moritz oh 11:32
11:32 Trashlord joined
moritz then I have no idea why $precomp tries to invoke Any :/ 11:32
jnthn er, that would be especially odd, yes.
Any does...not exist in NQP
(e.g. if you've got an Any then you've got Rakudo's one from...somewhere) 11:33
moritz well, not sure if $precomp is any, or if that happens somewhere in there
dalek kudo/sink: bbfd717 | moritz++ | src/ (2 files):
make List.sink safe for invoking on the type object
jnthn moritz: How to reproduce $current_issue? 11:35
jnthn is building the sink branch now
araujo morning 11:36
moritz jnthn: pull again, try to compile
I accidentally committed some debugging output
a well.
araujo so, ... where can I get the pugs version with the fixes? :)
moritz afk 11:37
11:37 JimmyZ joined
jnthn Method 'set_returns' not found for invocant of class 'Int' 11:38
o.O
masak araujo! \o/
araujo: github.com/perl6/Pugs.hs 11:39
tadzik: you and me both :/
araujo masak, \o/ !!
tadzik masak: huh?
11:40 itz joined, birdwindupbird joined
masak tadzik: missed the contest. 11:40
tadzik ah 11:41
I don't regret spending 4 days snowboarding though :)
itz My cleaner is from Bratislava. "Slovak?" Yes, and she can't iron either. 11:42
huf ow :D
jnthn :P 11:43
masak tadzik: no thumbs broken?
masak 's only association with snowboarding is broken thumbs
huf both?
at the same time?
masak apparently, beginner snowboarders usually do fine... until they stop, fall over, and break a thumb or two. 11:44
tadzik masak: they hurt the most among all the other body parts :)
the soul of fearless skiier made me pay a heavy price in the first two days
masak you're not supposed to use your thumbs as anchors when stopping! :P
that's a skiing manoeuver! 11:45
tadzik oh, that explains a lot
;)
masak sheesh.
:P
11:46 tokuhirom left 11:48 leprevost_ joined, leprevost_ left 11:49 thou joined, leprevost left 11:55 whiteknight joined 12:01 leprevost joined
dalek kudo/sink: 7ddf5ab | jnthn++ | src/Perl6/ (2 files):
If we do dynamic compilation of code code, be sure to sink it at that point. Also tag it sunk so we don't re-do the work later. Doesn't fix the immediate problem, sadly - just spotted it was missing.
12:03
12:06 sisar joined 12:23 peteretep joined
peteretep The Configure.pl buildstep for rakudo-star-2012.01 appears to dislike my Cwd having a space in it 12:23
perl Configure.pl --gen-parrot
Tries to run: 12:24
/usr/bin/perl Configure.pl --with-parrot=/mnt/hgfs/Code Folder/rakudo-star-2012.01/install/bin/parrot --make-install
Hrm, so then Configure.pl seems to call itself 12:26
jnthn It's probably a different Configure.pl - looks like it's the call to NQP's one. 12:29
And yeah, it looks like it isn't quoting that path name. 12:30
peteretep I'm trying again with prefix of "./" so it doesn't use cwd
Maybe that'll fix it
12:32 GlitchMr42 joined
dalek kudo/sink: e06236d | jnthn++ | src/Perl6/Sinker.pm:
All method calls are wrapped up in calls to perl6ize_type so we need to make sure we descend into them also.
12:32
kudo/sink: 4017a66 | jnthn++ | tools/build/Makefile.in:
Fix dependency.
12:33 GlitchMr left
avar just read www.reddit.com/r/perl/comments/pv12...ion_tests/ , very impressive 12:33
perl6.org/compilers/features also shows some very nice progress
jnthn phenny: tell moritz it appears that the problem is at least partly to do with the call to .signature
phenny jnthn: I'll pass that on when moritz is around.
12:33 GlitchMr42 is now known as GlitchMr
jnthn phenny: tell moritz replacing that trait body with nqp::getattr(nqp::p6decont($target), Code, '$!signature').set_returns($type) gets things further 12:33
phenny jnthn: I'll pass that on when moritz is around.
12:35 GlitchMr42 joined
jnthn phenny: tell moritz OH!!! In bbfd717e06 the closure assigned to $stub was changed. To something that never invoked the code the first time it was compiled... 12:36
phenny jnthn: I'll pass that on when moritz is around.
peteretep OK, so that leads to: 12:37
/usr/bin/perl Configure.pl --with-parrot=./bin/parrot --make-install
dalek kudo/sink: 0e2a54e | jnthn++ | src/Perl6/World.pm:
Undo busted change to dynamic compilation. Gets us further.
peteretep which is still not right
I'll try a different prefix then, I guess
Is there a bug tracker? 12:38
12:38 GlitchMr left
jnthn peteretep: Please do feel free to also drop a bug report about the issue with not accepting paths with spaces to [email@hidden.address] 12:38
(emails sent there create tickets in the bug tracker) 12:39
peteretep OK. Is the bug tracker public?
jnthn yes
peteretep is taking a week to learn Perl 6, and to write a review of that process at the end of the week 12:40
jnthn rt.perl.org/rt3/ - the perl6 queue
peteretep great, thanks
tadzik peteretep: good luck!
jnthn But there's not a web interface to submit (guess this is partly for spam management...)
peteretep fair enough 12:41
This is looking more promising... 12:43
ah crap 12:44
Unable to read configuration from ./parrot-3.11.0/bin/parrot.
as a result of /usr/bin/perl Configure.pl --with-parrot=./parrot-3.11.0/bin/parrot --make-install
hand-running that gives: ./parrot-3.11.0/bin/parrot: error while loading shared libraries: libparrot.so.3.11.0: cannot open shared object file: No such file or directory
Guess I'll retry this whole thing in /tmp/ 12:45
12:54 Trashlord left 12:57 kst` joined, aloha left 12:58 kst left
dalek kudo/sink: ecf6bcc | jnthn++ | src/Perl6/Metamodel/ (2 files):
Change return values from add_parent and add_role to be something other than a type object, so they'll at least be considered something true. Also avoids us sinking types we've not finished compiling yet.
12:59
kudo/sink: 41b48aa | jnthn++ | src/Perl6/World.pm:
Remove debugging code.
jnthn phenny: tell moritz latest sink branch survives through the build now. :)
phenny jnthn: I'll pass that on when moritz is around.
jnthn afk for a little bit :)
peteretep my @names = $file.get.words; -- this implies that some part of this is context aware, especially when reading that .get returns a line of code a bit below 13:00
13:00 MayDaniel joined
peteretep oh wait, no it doesn't 13:01
I'm being an idiot
13:05 kshannon joined 13:06 aloha joined 13:11 colomon joined
peteretep OK, it's built. Without rebuilding it, what env var do I need to set to get 'make install' to install to a system-wide bin? 13:18
Reading the makefile and being slow
13:18 nebuchadnezzar joined
peteretep hrm, could well be DESTDIR 13:19
peteretep gives it a go
Hrm, not quite that easy 13:20
13:21 emss left 13:23 emss joined, emss left
masak interesting language, Julia: julialang.org/ 13:23
avar niecza seems faster than rakudo on same naive factorial benchmarks of mine, is that generally the case once it spins up? 13:24
masak yes, I'd say so. 13:27
13:32 pmurias joined
dalek gs.hs: 36d2ba8 | au++ | Pugs/ (2 files):
* Make Prelude.pm self-sufficient, and re-introduce file2c.pl (from PAR::Packer).
13:32
masak \o/ 13:38
peteretep Is there a perl6doc equivalent?
tadzik not really
you can generate documentation for a single file using --doc in rakudo 13:39
peteretep OK. Where do I find comprehensive documentation on sort() most easily?
masak S32/Containers
perlcabal.org/syn/S32/Containers.html
the spec is still the most authoritative manual to Perl 6.
peteretep ok
ah, I guess S29-functions.pod will be useful too 13:40
masak yes. :) 13:41
moritz jnthn++ # unbusting sink
phenny moritz: 12:33Z <jnthn> tell moritz it appears that the problem is at least partly to do with the call to .signature
moritz: 12:33Z <jnthn> tell moritz replacing that trait body with nqp::getattr(nqp::p6decont($target), Code, '$!signature').set_returns($type) gets things further
moritz: 12:36Z <jnthn> tell moritz OH!!! In bbfd717e06 the closure assigned to $stub was changed. To something that never invoked the code the first time it was compiled...
moritz: 12:59Z <jnthn> tell moritz latest sink branch survives through the build now. :)
peteretep What's the canonical source for the Synopses? 13:42
moritz github.com/perl6/specs/
peteretep thanks
13:43 shinobicl___ joined
peteretep How does rakudo implement "use v5;"? Does it hook in to the system perl5? 13:48
13:48 Trashlord joined
masak it doesn't, yet. 13:49
there's Blizkost, though.
peteretep ah, I have been meaning to look at that 13:50
Do any of the compilers provide support for that? I didn't se it in the feature matrix (or I missed it) 13:52
masak Rakudo and Blizkost go together. I don't know excatly how, 'cus I haven't used Blizkost. 13:55
dalek gs.hs: d62568e | au++ | Pugs/src/Pugs/Prim/Eval.hs:
* Add PUGS_USE_EXTERNAL_TEST env variable that uses external Test.pm.

   So this works now:
   PUGS_USE_EXTERNAL_TEST=1 dist/build/pugs/pugs -Iext/Test/lib -MTest -e 'done_testing'
   To cache compilation AST, do this:
   dist/build/pugs/pugs -CParse-Yaml ext/Test/lib/Test.pm > ext/Test/lib/Test.pm.yml
peteretep masak: OK, that makes sense
au [Coke] / masak : I think ⬆ is all we need for Test.pm hackery for now, hope it helps
(...and commits welcome if you'd like to flip it so PUGS_USE_EXTERNAL_TEST is the default :)) 13:57
au cxt-switches a bit to the new exciting gig of Parsoid hacking
masak au++ 13:58
13:58 emss joined
au pugs: say eval('$]', :lang<perl5>) 14:00
p6eval pugs b927740: OUTPUT«5.010001␤»
au peteretep: ^^
although now the appropriate syntax for that has probably changed... :) 14:01
peteretep au: How is that implemented? 14:03
au peteretep: by embedding libperl within the interpreter
peteretep Thanks
au np :)
peteretep Hey, Embedded Comments are neat
peteretep & lunch 14:05
14:08 thou left 14:10 nebuchadnezzar left 14:13 countley joined
masak no, I think the appropriate syntax is still eval($code, :$lang) 14:14
moritz one of the appropriate syntaxes :-) 14:15
au interesting. I thought $lang is of type Grammar now 14:16
# perlcabal.org/syn/S29.html#eval
masak I've never seen that implemented, so I'm correspondingly skeptical. 14:23
pmurias au: niecza still does eval('...',:lang<perl5>)
au k, great to know.
masak you can't eval something with a Grammar anyway, you need a whole language :)
pmurias i think the assumption was that the Grammar will produce Perl6 AST 14:24
14:27 fsergot joined 14:28 fsergot left, fsergot joined 14:33 pmurias left 14:34 dfg_ joined, dfg_ left
tadzik cosimo: ping 14:46
[Coke] masak++, au++ ! 14:50
[Coke] is almost sad that he has plans today, and probably can't do much on pugs! 14:53
14:57 PacoAir joined
fsergot I've been learning perl6 for last few months. I mean writing some p6's apps, scripts, etc. What should I learn next? :) 15:00
[Coke] pugs: use Test; done;
p6eval pugs b927740: OUTPUT«pugs: *** Unsafe function 'use' called under safe mode␤ at /tmp/197NuiTk7P line 1, column 1␤»
tadzik more Perl 6? :)
[Coke] :(
fsergot pugs, nqp? :)
tadzik no, I mean, learn Perl 6 deeper :) 15:01
maybe dive into compiler guts?
fsergot tadzik, of course, but what do You mean? :)
[Coke] masak - I just did a git pull, 'cabal install Pugs', but the installed pugs ($HOME/.cabal/bin/pugs) doesn't have access to the done function.
fsergot What is it?
tadzik I mean working on the Perl 6 compiler in general
fsergot tadzik, oh, sorry my mistake. 15:02
15:03 nebuchadnezzar joined
fsergot Thanks tadzik++. :) 15:05
au [Coke]: git pull, "cabal install" 15:06
not "cabal install Pugs"
also, export PUGS_USE_EXTERNAL_TEST=1
or, alternately, git pull, "make", and ./pugs -Iext/Test/lib -MTest -e done_testing 15:07
(but still export PUGS_USE_EXTERNAL_TEST=1) 15:08
15:10 countley left 15:12 noam left, noam joined
[Coke] $ PUGS_USE_EXTERNAL_TEST=1 /home/coke/.cabal/bin/pugs -e "use Test;done" 15:12
*** No such subroutine: "&done"
(that after "cabal install") 15:13
same error using the ./pugs line. 15:14
ah. missed the "make" step, which also copies dist.../pugs to ./pugs 15:15
sucks that the installed version doesn't work. I'll see about re-doing the tests to assume you have ./Pugs/pugs instead of $HOME/.cabal/bin/pugs
au++
(heading out now)
15:26 shinobicl___ left
fsergot How does "return -> ..." work? 15:26
flussence it returns a closure 15:27
-> { } is called a "pointy block", which is basically shorthand for an anonymous sub
fsergot flussence++ thank You. 15:28
tadzik nom: for 1..5 -> $a { say $a }
p6eval nom 1e966b: OUTPUT«1␤2␤3␤4␤5␤»
tadzik nom: for 1..5 sub($a) { say $a }
p6eval nom 1e966b: OUTPUT«===SORRY!===␤Missing block at line 1, near "sub($a) { "␤»
15:31 xinming joined
colomon you know, perl6.org/compilers/features is somewhat out of date WRT niecza. 15:38
niecza: @evens = ($_ * 2 if * %% 2 for 0..100); 15:43
p6eval niecza v14-43-gc4ecd5c: OUTPUT«===SORRY!===␤␤Variable @evens is not predeclared at /tmp/Dd3MRy2twr line 1:␤------> <BOL>⏏@evens = ($_ * 2 if * %% 2 for 0..100);␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1…
colomon niecza: my @evens = ($_ * 2 if * %% 2 for 0..100); 15:44
p6eval niecza v14-43-gc4ecd5c: OUTPUT«Potential difficulties:␤ @evens is declared but not used at /tmp/xC9JHLg_Tb line 1:␤------> my ⏏@evens = ($_ * 2 if * %% 2 for 0..100);␤␤»
colomon niecza: my @evens = ($_ * 2 if * %% 2 for 0..100); say @evens
p6eval niecza v14-43-gc4ecd5c: OUTPUT«␤»
colomon ah
flussence perl6: my @evens := (1..* X+< 1); say @evens[400] 15:47
p6eval rakudo 1e966b, niecza v14-43-gc4ecd5c: OUTPUT«802␤»
..pugs b927740: OUTPUT«*** ␤ Unexpected end of input␤ expecting "\\", variable name, ">" or "<"␤ at /tmp/3_3WaDKl42 line 2, column 1␤»
flussence (should be 0..*)
15:49 Psyche^ joined, Psyche^ is now known as Patterner 15:52 MayDaniel left
TimToady colomon: you can't use a WhateverCode in an 'if', btw 15:57
colomon oh! duh. 15:58
TimToady needs 'when'
colomon niecza: my @evens = ($_ * 2 if $_ %% 2 for 0..100); say @evens
p6eval niecza v14-43-gc4ecd5c: OUTPUT«␤»
colomon still doesn't work.
TimToady but I don't think niecza does comprehensions yet
btw, that expr should make 0, 4, 8, 12 ... * 15:59
nom: my @evens = ($_ * 2 if $_ %% 2 for 0..100); say @evens 16:00
p6eval nom 1e966b: OUTPUT«0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200␤»
TimToady which is only the even evens :)
16:00 alvis left
peteretep Learning Perl 6 by reading the Specs is perhaps a mistake 16:01
TimToady it's easier than learning Perl 6 by writing the specs :)
au or handwriting the specs :) 16:02
peteretep I thought Perl was like Common Law
au (agentzh++ used to do that)
peteretep You discovered it, and it had retroactively always been there
TimToady it's more like picking the multiverse we want to live in
s/the multiverse/which universe of the multiverse/ 16:03
peteretep hrm, S02-bits.pod is looong
TimToady ENOCOFFEE
yes, the specs could use to be reorganized; it's one of the many things we have to to first next :)
*to do
peteretep After taking the adjective 'spunky' off the Perl6 site? :-) 16:04
masak what's wrong with 'spunky'? :) 16:05
peteretep For a significant subset of English speakers, it's easily interpreted as something obscene. 16:06
TimToady so is STD :)
tadzik heh
google translate told me that it means "courageous" somewhat 16:07
peteretep TimToady: Yes, but I don't have to make sure my 12 year old has Google Safe Search turned on before googling the latter
TimToady yes, but you can see how it would be used as a euphemism for "easy" :)
nevertheless, I don't like giving up words to the dark side without a fight 16:08
masak was gonna say.
peteretep TimToady: Isn't that natural language evolution at its purest? 16:10
my Dog $spot .= new; # What's new being applied to here? The Dog prototype object? 16:11
tadzik it's a Type Object
TimToady sure, but pretty much every other word in the language can be taken as something prurient if you try hard enough
peteretep TimToady: That's absolutely true 16:12
TimToady: Most words don't return 95% pornography when you google them though
Ah, ok "Type Object" is short-hand for the type's prototype object 16:13
TimToady we don't call them prototype objects anymore, just type objects 16:14
prototype was getting too overloaded
peteretep OK
TimToady and easily confused with prototype-based languages like Self and JS
peteretep ooh, type coercian using type objects is neat 16:15
16:16 alvis joined
peteretep perl6: Num("2") 16:16
p6eval niecza v14-43-gc4ecd5c: OUTPUT«Unhandled exception: Unable to resolve method postcircumfix:<( )> in class Num␤ at /tmp/XHiwsZCrTq line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3773 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3774 (module-CORE @ 65…
..pugs b927740: OUTPUT«*** No such subroutine: "&Num"␤ at /tmp/nuK3iL9MAQ line 1, column 1 - line 2, column 1␤»
..rakudo 1e966b: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&Num' called (line 1)␤»
tadzik huh. How does paying the conference fee on the Act website work? I've just clicked "purchase", and it said "okay, done". Makes me wonder, who paid?
TimToady peteretep: if only it worked :) 16:18
peteretep TimToady: Does it not work because I'm doing something stupid, or because it isn't implemented yet?
jnthn TimToady: Do we know how it should work yet? :)
TimToady perl6: say '2'.Num
p6eval rakudo 1e966b, niecza v14-43-gc4ecd5c: OUTPUT«2␤»
..pugs b927740: OUTPUT«*** No such method in class Str: "&Num"␤ at /tmp/DqK8nXzIio line 1, column 5 - line 2, column 1␤»
TimToady it should failover to that somehow if Num doesn't defined postcircumfix:<( )> 16:19
jnthn loves the "somehow" :D
TimToady types *are* predeclared, so we know when we see the call that it's probably intended to be a coercion
jnthn TimToady: OK, but we can't just assume that this form *always* means coercion? 16:20
TimToady sure, but someone might define the coercion as a sub Num somewhere
it's only if they don't that it wants to look for .Num 16:21
jnthn But...subs are post-declared.
TimToady at the point that we say "No such subroutine", we make the decision 16:22
jnthn The point we say "no such subroutine" is in the optimizer :P
Unless you mean runtime failover. 16:23
TimToady well, for known types we can say they must be predeclared
so you can't postdeclare a coercion
peteretep rakudo: "2".elems
p6eval rakudo 1e966b: ( no output )
peteretep rakudo: "2".bytes
p6eval rakudo 1e966b: ( no output )
16:24 janosik joined
tadzik rakudo: "2".bytes.say 16:24
p6eval rakudo 1e966b: OUTPUT«1␤»
peteretep thanks
tadzik no problem
jnthn OK, so Foo(...) will (a) look for an &Foo, and if it exists emit the call to it as we do today, or (b) failing that, emit a method call .Foo ?
TimToady or we just always parse TypeName() as Typename with a .() call on it, and failover at run time
peteretep msg is probably better for the general case here
TimToady but then it's hard to use at compile time in a constant expression
jnthn (in my above, I assume Foo is a known type) 16:25
TimToady so for optimizing we want to decide at parse time, and for flexibility we want to defer
jnthn TimToady: Well, I've also long pondered whether SomeType(...) actually desugars to SomeType.^coerce(...)
TimToady I think your ab is sane(ish)
jnthn So it's the meta-object we're trying to coerce towards that decides what this really means 16:26
TimToady use case?
peteretep rakudo: [2,3,4].bytes.say
p6eval rakudo 1e966b: OUTPUT«5␤»
TimToady that's bogus
peteretep I was excpecting a three there 16:27
TimToady it should not be assuming an encoding
jnthn TimToady: Mostly, giving meta-space an opportunity to play in to coercions. :)
masak rakudo: say [2,3,4].Str
p6eval rakudo 1e966b: OUTPUT«2 3 4␤»
masak hence 5.
jnthn TimToady: So we don't hardwire the "coercing to X is a method call .X on the target object".
masak peteretep: if you wanted to sum the byte counts of the elements, you have to say so. 16:28
jnthn TimToady: Maybe I'm trying for too much future-proofing.
masak nom: say [+] [2,3,4]>>.bytes
p6eval nom 1e966b: OUTPUT«3␤»
jnthn masak: And that's still a dubious thing to do without specifying an encoding.
masak peteretep: but I'd go with .chars (unless you really, really want bytes), for the reasons TimToady and jnthn said.
tadzik note that it's still byte count in the "2", "3" and "4" strings
masak aye. 16:29
peteretep masak: The docs say: "You can also ask for the total string length of an array's elements ... ".bytes", ".codes" or ".graphs"
Am I misreading them, or are they out of date?
masak sounds like a fossil.
TimToady just never implemented
masak what's happening now is that Array is Cool, and Cool pretends it's a Str when you do .bytes 16:30
peteretep OK
Sorry that I'm asking all these questions. I'm testing my assumptions as I go
masak don't be sorry, be anti-sorry.
cosimo tadzik: late pong 16:31
TimToady jnthn: a big problem with coercions is that they're in the same infrastructural category of "maybe this should be a submethod unless you are specifically writing for your derived classes"
peteretep "It's not done yet" and variations are fine, "You don't understand it" is what I'm trying to make sure isn't the case
masak we're at the stage where we need newcomers to rub up against the spec and the language and the implementations.
"You don't understand it" is fine too, because then we get to explain, and then we get better at that :)
peteretep I'll be asking for code reviews later in the week :-P
masak \o/
TimToady yes, you are in no danger of irritating us by asking good questions
we do have some folks who use us *instead* of reading the specs, and that's a bit irritating 16:32
masak we love it when people get the channel back on topic :)
TimToady: I only find it irritating when they do it repeatedly (for the same thing). 16:33
jnthn TimToady: More than that, I worry whether assuming the type that needs to become something else is always the thing with knowledge about how that should happen will always be right.
TimToady that's the bit that's irritating :)
tadzik cosimo: mind if I bother you on query a bit?
cosimo tadzik: go ahead 16:34
jnthn TimToady: That is, Str(x) assumes x will know how to turn itself into a Str. Well, that makes sense...but will we have kinds of type where maybe that isn't so sane?
TimToady: Take enumerations. SomeEnumType(x) perhaps shouldn't be doing x.SomeEnumType.
TimToady eh, if you define .() it's Str that is knowing it, not x
jnthn TimToady: In fact, I think S12 wants it to do otherwise...
jnthn checks
TimToady: Oh, you're thinking implementing .() on the type object is the mechanism for overriding coercion? 16:35
peteretep "Some object types can behave as value types." <-- what is a "value type"? Presumably it's not a native type 16:36
jnthn TimToady: OK. I was more wondering if the way that mechanism works is something that belongs in meta-space, not normal object space.
masak peteretep: a value type is a type defined entirely by its attributes.
peteretep I was just starting to think that way 16:37
OK
Thanks
TimToady it's trying to express immutable, I think
masak peteretep: it has no mutators. common examples are numeric types, or strings.
peteretep So the native types /are/ value types, too?
masak guess so.
but it's most often used for object classes.
peteretep Would that be a notable difference between Int(5) and int(5)?
TimToady types for which you expect my $a = $b.clone; $a === $b
hopefully not 16:38
int is just a restriction on how many bits you can store
they're supposed to have the same semantics
peteretep OK
peteretep decides to not think about this bit too hard 16:39
TimToady might not be right in the implementations though
also, int(5) is relatively useless if you don't store it, since it might just turn back into an Int for temporary purposes
jnthn In Rakudo, int certainly restricts you. It's also often faster. Sometimes it's very faster. BUT we don't get overflow right yet.
TimToady nom: my Int $x = 5; my int $y = 5; say $x === $y 16:40
p6eval nom 1e966b: OUTPUT«True␤»
TimToady \o/
I presume that works because int boxes to Int before the ===
jnthn TimToady: I'm almost certain that's what happens. 16:41
TimToady though, of course, with intimate knowledge of the Int type one could probably optimize it to something lower level
peteretep === is just like JS === then?
Hrm, I used JS Type Coercians as an example of something too weird to be easily remembered recently 16:42
16:42 MayDaniel joined
TimToady === is value equivalence; two identical objects that are not value types will compare false under === but true under eqv 16:42
that is, a non-value type's identity is its location, not its contents, while a value type's identity is its value 16:43
16:43 kmwallio joined
TimToady (for some nebulous definition of "location" that is not, perhaps, fixed in memory) 16:43
peteretep hrm 16:44
a.WHICH === b.WHICH implies a == b?
TimToady a === b
a == b is coerced to numeric comparison 16:45
peteretep I am being confused by the docs. .WHICH returns an ObjAt, or returns a coerced value type?
TimToady which is not useful unless you're dealing with numbers
ObjAt is intended to express a non-valuetype object's identity 16:46
peteretep Ah, .WHICH can return whatever it wants. It should use ObjAt for locations though, but can return a different value if it's being used a a value type
Got it
peteretep goes back to change his flashcard
TimToady my $fido = Dog.new; my $spot = Dog.new; $fido !=== $spot
peteretep If I've defined a .WHICH() for dog that returns constant 5 16:47
Then does $fido === $spot?
TimToady yes
peteretep ok
Is ther eany difference between: my Dog $spot; and my Dog $spot = Dog; ? 16:48
TimToady presumably the second is less efficient :) 16:49
16:49 kmwallio left, MayDaniel left
jnthn Also 16:49
nom: class Dog { }; my Dog $spot; $spot = 42
p6eval nom 1e966b: OUTPUT«Type check failed in assignment to '$spot'; expected 'Dog' but got 'Int'␤ in block <anon> at /tmp/81LH3NJVuP:1␤␤»
jnthn nom: class Dog { }; my $spot = Dog; $spot = 42
p6eval nom 1e966b: ( no output )
jnthn Only the first puts a type constraint on what the variable can store 16:50
peteretep ah, ok 16:51
Right, yes, that makes perfect sense
TimToady so does everything else, except for the bits that don't :)
peteretep I'm sure I'll get to those bits in time :) 16:52
I don't suppose there's a nice pretty PDF version of the Specs kicking around is there? Reading it via perldoc is a hassle.
TimToady perlcabal.org/syn/ has html links 16:54
peteretep skips over thanks
gah
I mean: thanks
TimToady in fact, when we say something like S13:135 here, it makes a link in the irc logs to that line in the html file 16:55
as you can see at irclog.perlgeek.de/perl6/2012-02-18#i_5168168 16:56
17:01 sisar left 17:05 birdwindupbird left 17:07 janosik left 17:10 overrosy joined
jnthn > my $x = Int('42'); .say for $x, $x.WHAT 17:12
42
Int()
masak \o/
jnthn Passed spectest so... 17:14
dalek kudo/nom: 76e282a | jnthn++ | src/Perl6/ (3 files):
Support SomeType(x) falling back to being a coercion call (x.SomeType). If SomeType already overrides postcircumfix:<( )> then we call that directly, just as before.
masak jnthn++
jnthn Let's see how this works out.
masak: Was there an RT for this?
masak not to my knowledge. 17:15
but my Bloom filter is extra unreliable today.
jnthn Dang, wanted to add it to testneeded :)
masak I only add RT for features when people are adamant about the feature.
jnthn fairy nuff 17:16
TimToady goes to look for his adamantium stash 17:20
peteretep I do like how this does Unicode properly right from the start 17:21
dalek ast: 85e742b | jnthn++ | S13-type-casting/methods.t:
Add at least one test for the SomeType(...) coercion syntax; didn't find any existing ones to turn on.
17:22
17:23 ab5tract joined
jnthn oh what on earth, I did something silly in that patch... 17:23
peteretep perl6: ArabicChars(1).say
p6eval rakudo 1e966b: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&ArabicChars' called (line 1)␤»
..pugs b927740: OUTPUT«*** No such subroutine: "&ArabicChars"␤ at /tmp/3DgAe65zpJ line 1, column 1 - line 2, column 1␤»
..niecza v14-43-gc4ecd5c: OUTPUT«===SORRY!===␤␤Undeclared name:␤ 'ArabicChars' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1344 (die @ 3) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 33) ␤ at …
peteretep substr( 'Humans welcomed', 3.as(Bytes), 2.as(Bytes) ).say; -- what's wrong with this? 17:28
I'm getting "Undefined routine &Bytes"
github.com/perl6/roast/blob/master....t#L29-L48
TimToady there's no .as anymore; where are you finding that? 17:29
jnthn In a spectest
peteretep in the URL I posted 17:30
How should I have written that?
masak that's a spunky use of '.as' :P 17:31
I'm glad we didn't keep that around.
17:31 GlitchMr42 left
peteretep "If a StrPos or StrLen is forced into a numeric context, it will assume the units of the current Unicode abstraction level." <-- that abstraction level is stored where? Are we talking about the abstraction level of the operation, of the string itself? of the scope? 17:33
17:33 JimmyZ_ joined
masak of the scope. 17:33
but it's all a bit wishy-washy due to no implementation support.
17:33 noam_ joined 17:34 benabik_ joined 17:35 rsimoes11 joined, retup-wo1k joined, kaare__ joined, `patch`_ joined, d4l3k_ joined
peteretep OK 17:35
So what's the best-practice here for a substr?
17:36 perimoso1ordiae joined, shachaf_ joined, mj41 left 17:37 colomon_ joined, wknight8111 joined, doy_ joined, aloha left, JimmyZ left, shachaf left, lestrrat left, danishman left, moritz left, mattp_ left, szbalint left, `patch` left, ab5tract left, overrosy left, noam left, leprevost left, whiteknight left, doy left, colomon left, kaare_ left, Util left, moritz joined, cooper joined, aloha joined, szabgab_ joined, benabik_ is now known as benabik, colomon_ is now known as colomon, szbalint_ joined, __sri joined, skids joined, JimmyZ_ is now known as JimmyZ, mattp_ joined, PerlJam joined, raiph joined, p6eval joined, overrosy joined, cooper left, cooper joined, ChanServ sets mode: +v p6eval, mathw joined, Util joined 17:38 lestrrat joined, leprevost joined, d4l3k_ is now known as dalek, ChanServ sets mode: +v dalek, danishman joined, ab5tract joined, danishman left, cotto joined 17:39 stepnem joined 17:40 rsimoes joined
jnthn afk for a bit 17:43
peteretep Perl 6 has several ways of performing partial function application
A hyphen would help there
Because I assume you mean partial function-application
Rather than partial-function application
Am I right? If so, I'll patch it 17:44
masak I see where you're coming from, but that's not usually written with a hyphen, I think. 17:45
peteretep masak: I was confused about if it was talking about partial functions or not
It's not, afaict
masak what's a partial function?
peteretep en.wikipedia.org/wiki/Partial_function 17:46
benabik A function that is not defined over the entire range of inputs.
Scala uses them for pattern matching. 17:47
peteretep Sometimes written -+-> instead of --->
TimToady it's funny that the first line there is: Not to be confused with partial function of a multilinear map. 17:49
masak so, a partial function is just an ordinary function, but someone gave it too large a domain :P 17:51
if we're to change the text, I'd prefer to have it as "partial application of functions" instead. 17:52
peteretep Is there any point to my forkign the repo and bunching up little changes?
Or is it quicker if I just mention them here?
TimToady nevertheless, the literature is full of the current phrase
without the hyphen 17:53
masak nod
peteretep Can I change them to what masak said?
I cound two instances
masak afk for a bit 17:55
peteretep gives up
TimToady peteretep: around here, people just change things if they think they're sufficiently non-controversial 17:57
our phrase is "forgiveness > permission"
peteretep OK
TimToady though it works the other way too; you have to forgive someone if they undo your change :) 17:58
peteretep ha
17:58 JimmyZ left
peteretep { $^x + $^y } ... these are the antecedent and consequent? 17:58
TimToady if I thought the phrase was unclear, I'd probably change it to: what is commonly known as "partial function application"
but google does in fact find a whole lot of examples of that phrase, so you should really go out and change wikipedia too :) 17:59
that what and the what?
peteretep *shrug* I did a course in Z Notation recently, so my mind is primed to interpret partial functions in a certain way
TimToady that's just a funny way to write a lambda: -> $x, $y { $x + $y } 18:00
peteretep OK, I was about to say, this Autopriming thing looks a lot like lambda abstractions
TimToady yes, * + 2 is another way to write -> $x { $x + 2 } 18:01
peteretep hasn't got to the part describing: -> yet
TimToady perl6: (0, 1, *+* ... *)[^20].say
p6eval pugs b927740: OUTPUT«*** ␤ Unexpected "[^"␤ at /tmp/N6O3YvAkdM line 1, column 18␤» 18:02
..rakudo 76e282, niecza v14-43-gc4ecd5c: OUTPUT«0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181␤»
peteretep perl6: { * - 1 }.HOW
p6eval pugs b927740, rakudo 76e282, niecza v14-43-gc4ecd5c: ( no output )
peteretep perl6: { * - 1 }.HOW.say
p6eval rakudo 76e282: OUTPUT«Method 'say' not found for invocant of class 'Perl6::Metamodel::ClassHOW'␤ in block <anon> at /tmp/bzPl8sL0Oh:1␤␤»
..niecza v14-43-gc4ecd5c: OUTPUT«Unhandled exception: Unable to resolve method say in class ClassHOW␤ at /tmp/1eMbiOn_QQ line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3773 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3774 (module-CORE @ 65) ␤ at /ho…
..pugs b927740: OUTPUT«<obj:Class>␤»
TimToady I suspect you want WHAT
peteretep ok 18:03
TimToady HOW is the metaobject, not the type object
nom: (*-1).WHAT.say
p6eval nom 14c84d: OUTPUT«WhateverCode()␤»
TimToady note the brackets are not wanted there 18:04
{ *-1 } would be a lambda returning a WhateverCode
peteretep OK
thanks
TimToady nom: {*-1}.WHAT.say 18:05
p6eval nom 14c84d: OUTPUT«Block()␤»
TimToady otherwise known as a Block :)
nom: {$_-1}.WHAT.say
p6eval nom 14c84d: OUTPUT«Block()␤»
peteretep How can I see the parent typs of a type?
TimToady that, however, is equivalent to -> $_ { $_ - 1 }
nom: say Int.^parents 18:06
p6eval nom 14c84d: OUTPUT«Real()␤»
TimToady nom: say Int.^parents(:all)
p6eval nom 14c84d: OUTPUT«Real() Cool() Any() Mu()␤»
peteretep nom: say {*-1}.^parents
p6eval nom 14c84d: OUTPUT«Code()␤»
peteretep ok
18:07 fridim_ joined, Trashlord left
TimToady nom: say Int.^methods 18:08
p6eval nom 14c84d: OUTPUT«Int Num Rat FatRat abs Bridge chr succ pred sqrt base floor round ceiling WHICH perl Bool Str Rat abs sign conj sqrt sin asin cos acos tan atan atan2 sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech cosech acosech cotanh acotanh floor cei…
TimToady nom: say Str.^methods
p6eval nom 14c84d: OUTPUT«BUILD Int Num chomp chop substr pred succ ll-match ords lines samecase samespace trim-leading trim-trailing trim words encode capitalize trans WHICH Bool Str ACCEPTS Numeric gist perl comb match subst split␤»
peteretep This ^ thing ... is giving you the union of climbing up the inheretence chain? Or just the parent?
Hrm, or is it returning the prototype 18:09
The latter makes the most sense
TimToady $obj.^foo(...) is equivalent to $obj.HOW($obj, ...)
it's the metaobject
peteretep OK
TimToady which defines whether it's class-based, prototype-based, or whatever
peteretep Excellent
TimToady since the invocant is the metaobject, we have to pass the actual object as the first arg 18:10
.^ is a convenient notation for that 18:11
nom: say Int.can('sqrt')
p6eval nom 14c84d: OUTPUT«sqrt sqrt sqrt␤»
TimToady heh
peteretep that's odd 18:12
TimToady not if you know why
peteretep That's surely part of the definition of 'odd' :)
TimToady nom: say Int.can('sqrt')».sig
p6eval nom 14c84d: OUTPUT«Method 'sig' not found for invocant of class 'Method'␤ in method dispatch:<hyper> at src/gen/CORE.setting:838␤ in block <anon> at /tmp/pjiARW5uu3:1␤␤»
TimToady nom: say Int.can('sqrt')».signature
p6eval nom 14c84d: OUTPUT«:(Int:D , Mu %_!) :(Real , Mu %_!) :(Cool , Mu %_!)␤»
peteretep Out of interest, what's the recommended Perl 6 reference guide these days? 18:13
uh, not reference guide
learning resource
benabik I like to use #perl6
TimToady depends on how you learn
peteretep Currently using flashcards :-) 18:14
TimToady if you learn by example and by comparison to other languages, rosettacode.org is nice
tutorials are more in the department of masak++ and moritz++
there's a book in progress
various things are mentioned on perl6.org/documentation 18:15
then there are the advent readings :) 18:18
those jump around a bit
peteretep nom: say Real.parents
p6eval nom 14c84d: OUTPUT«Method 'parents' not found for invocant of class 'Real'␤ in block <anon> at /tmp/AfL4Ll8g1u:1␤␤»
peteretep nom: say Real.^parents
p6eval nom 14c84d: OUTPUT«␤» 18:19
benabik .^parents excludes Any?
peteretep was indeed trying to get to Any
TimToady by convention .^methods and .^parents leave out anything Cool or above
add :all
peteretep nom: say Real.^parents:all
p6eval nom 14c84d: OUTPUT«Method 'parents:all' not found for invocant of class 'Perl6::Metamodel::ClassHOW'␤ in method dispatch:<.^> at src/gen/CORE.setting:796␤ in block <anon> at /tmp/wPlgVW81nB:1␤␤»
benabik nom: say Real.^parents(:all)
p6eval nom 14c84d: OUTPUT«Cool() Any() Mu()␤»
peteretep ah
TimToady otherwise you get a zillion conversion routines
peteretep Is :all a symbol like in Ruby? 18:20
TimToady it's a Pair object
benabik nom: say( (:all).perl ) 18:21
p6eval nom 14c84d: OUTPUT«"all" => Bool::True␤»
peteretep nom: say ( (:foo).perl )
p6eval nom 14c84d: OUTPUT«"foo" => Bool::True␤»
TimToady S03:3593
which the irclog links to perlcabal.org/syn/S03.html#line_3593 18:22
peteretep is considering skipping the rest of S02 to come back to later 18:23
TimToady er, except I should have said S02:3593
which points to perlcabal.org/syn/S02.html#Adverbial_Pair_forms 18:24
18:24 birdwindupbird joined
TimToady it's okay to skim the bits where your eyes glaze over :) 18:25
peteretep I have an irrational fear of reading out of date documentation, and then needing to relearn soething 18:26
TimToady just remember "There's something in there about xyzzy, which I can grep for later."
[Coke] (spunky), honestly, I'm more offended by all the religious connotations on the specs. If you're worried about "spunky", then you damn well BETTER have google safe search turned on.
peteretep I get the feeling that particular discussion has already been had, and positions already locked on polarized. 18:27
TimToady peteretep: we've all had to relearn a lot of things :)
but usually only for good reasons 18:28
peteretep hrm, +@array ... this is asking for @array in scalar context, or something more fundamental? 18:30
[Coke] peteretep: this is IRC. you're going to have people coming in that see conversations in backscroll and wish to comment on them.
TimToady numeric context
peteretep [Coke]: Oh, I meant simply that I think this conversation was had several years ago
[Coke]: Not that I'm through discussing it :-)
TimToady there are several conversations going on right now, and it's not clear which one is the referent 18:31
if it's 'spunky', then you should know we're a bunch of linguists here, and say the darnedest things all the time
au nom: <organized spunky religious>.pick(2) 18:32
p6eval nom 14c84d: ( no output )
au nom: <organized spunky religious>.pick(2).say
p6eval nom 14c84d: OUTPUT«organized spunky␤»
au \o/
peteretep TimToady: How many different contexts are there? As many as there are types? 18:33
TimToady it's a fractal concept, and lazily applied in Perl 6, unlike in Perl 5
so there's some correspondence to the type system, yes 18:34
but every method call supplies a context in some sense 18:35
every binding
peteretep What I think I was getting at is do Type Objects describe how they're coerced in to other types
TimToady they can
peteretep And is that essentially what's happening when @array is coerced in to a numeric context?
TimToady +@array calls @array.Numeric, which is a generic type 18:36
peteretep ah ha!
right
Do all operators have a Generic type they apply to their operands? 18:37
TimToady many of them do
for a lot of them, it's Cool
peteretep hasn't gotten to Cool yet
TimToady S02:1294 and S02:1874 18:38
peteretep Is there a simple answer to: what's the difference between: @array[] and @array[*]?
TimToady nom: say @array[].WHAT 18:39
p6eval nom 14c84d: OUTPUT«===SORRY!===␤Variable @array is not declared␤at /tmp/AHpHd7uxjO:1␤»
TimToady nom: my @array; say @array[].WHAT
p6eval nom 14c84d: OUTPUT«Array()␤»
TimToady nom: my @array; say @array[*].WHAT
p6eval nom 14c84d: OUTPUT«Parcel()␤»
TimToady is that simple enough?
peteretep Yes. I'll remember to keep an eye out for Parcel
TimToady a Parcel is a list that has not yet had a context applied to it, basically
peteretep Oh. OK, that makes sense on the other side too then 18:40
Uh, intuitive sense, I mean
TimToady the Zen slice, .[], is really a kind of no-op, though it has a parsing effect inside strings
it's a 0-dimensional slice, so it just returns the Array 18:41
whereas .[*] is a 1-dimensional slice
so returns the toplevel
peteretep ok
TimToady perl6: my @array = <a b c>; say [email@hidden.address] 18:42
p6eval pugs b927740, rakudo 14c84d, niecza v14-43-gc4ecd5c: OUTPUT«peteretep@array.com␤»
TimToady perl6: my @array = <a b c>; say "peteretep@array[].com"
p6eval niecza v14-43-gc4ecd5c: OUTPUT«Unhandled exception: No value for parameter 'index' in 'postcircumfix:<[ ]>'␤ at /home/p6eval/niecza/lib/CORE.setting line 0 (postcircumfix:<[ ]> @ 1) ␤ at /tmp/_3xmlwped8 line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3773 (ANON @…
..pugs b927740, rakudo 14c84d: OUTPUT«peteretepa b c.com␤»
TimToady niecza doesn't do Zen slice yet
peteretep ok 18:43
TimToady .[] is also a contextualizer, like @
just postfix
supposed to be a contextualizer, but maybe nyi
(not yet implemented)
peteretep When you say .[], is that distinct from []? 18:44
I hear [] and {} are just methods
TimToady any postfix may be expressed with or without the dot, so we often include the dot to distinguish postfixes from circumfixes 18:45
peteretep googles circumfix
Can you give me an example where you might confuse a circumfix with a postfix, and hence use the dot? 18:46
18:46 benabik left
TimToady well, I could have been talking about [1,2,3] the array composer, or {...} a block 18:46
peteretep oh, ok 18:47
of course, sorry
TimToady the . is a meta-notation for use in discussion, though it also works in code
18:47 benabik joined
TimToady perl6: my @array = <a b c>; say @array.[1] 18:47
p6eval pugs b927740, rakudo 14c84d, niecza v14-43-gc4ecd5c: OUTPUT«b␤»
18:47 GlitchMr joined
TimToady perl6: my $x = 'a'; say $x++; say $x.++ 18:47
p6eval rakudo 14c84d: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&postfix:<.>' called (line 1)␤» 18:48
..pugs b927740, niecza v14-43-gc4ecd5c: OUTPUT«a␤b␤»
TimToady ooh, rakudo parsefail
well, parseflub
18:48 Trashlord joined
TimToady the only place where the . is not optional is on normal method calls 18:49
perl6: say 4i; say 4.i
p6eval pugs b927740: OUTPUT«0 + 4i␤*** No such method in class Int: "&i"␤ at /tmp/D4wJI2wa7v line 1, column 13 - line 2, column 1␤»
..niecza v14-43-gc4ecd5c: OUTPUT«0+4i␤Unhandled exception: Unable to resolve method i in class Int␤ at /tmp/hNF3nfnRwh line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3773 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3774 (module-CORE @ 65) ␤ at /home…
..rakudo 14c84d: OUTPUT«0+4i␤Method 'i' not found for invocant of class 'Int'␤ in block <anon> at /tmp/bd4P0BDH_z:1␤␤»
TimToady going the other way, you can't use .i to mean the i postfix 18:50
nom: my $x = 4; say ($x).i; say $x\i; # these work though 18:51
p6eval nom 14c84d: OUTPUT«Method 'i' not found for invocant of class 'Int'␤ in block <anon> at /tmp/yE3jwxpTx8:1␤␤»
TimToady niecza: my $x = 4; say ($x).i; say $x\i; # these work though
p6eval niecza v14-43-gc4ecd5c: OUTPUT«Unhandled exception: Unable to resolve method i in class Int␤ at /tmp/WVllhreXIg line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3773 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3774 (module-CORE @ 65) ␤ at /home/p6ev…
TimToady duh
niecza: my $x = 4; say ($x)i; say $x\i; # these work though
p6eval niecza v14-43-gc4ecd5c: OUTPUT«0+4i␤0+4i␤»
TimToady nom: my $x = 4; say ($x)i; say $x\i; # these work though
p6eval nom 14c84d: OUTPUT«0+4i␤0+4i␤»
huf what makes one postfix work as a method and another not? 18:52
TimToady a postfix starting with alpha like 'i' is what distinguishes it
huf ah 18:53
TimToady .++ and ++ mean the same, but .i and i don't
peteretep OK, I think I am now done for the day
Thanks for the advice
TimToady shore
[Coke] au, masak: new Test.pm doesn't like fudge. 18:57
t/spec/S05-modifier/perl5_8.t
*** No compatible multi variant found: "&todo" at t/spec/S05-modifier/perl5_8.pugs line 75, column 1-24
18:58 noam_ left, noam_ joined
[Coke] and that line is: 18:58
#?pugs todo "pugs regression"
todo("pugs regression"); ok(("bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ~~ rx:P5/.X(.+)+X/), 're_tests 1115 (1319)');
(the actual call to todo())
au [Coke]: interesting. checking 19:00
[Coke] I have a change in progress to t/fudgeandrun that sets the PUGS_USE_EXTERNAL_TEST, and then uses ./Pugs/pugs to run the test, after fudging. 19:01
er, thought I did. might be missing the PUGS_USE... 19:02
(I was, but nope, dies same way) 19:03
au $ ./pugs -Iext/Test/lib -MTest -e 'todo("pugs regression");' 19:06
ok 1 - 2 # TODO pugs regression by Christmas
# Looks like you planned tests, but ran 1
er, that was 'todo("pugs regression"); ok(1,2)' 19:07
so seems to work for me
./pugs -Iext/Test/lib /home/coke/sandbox/Pugs.hs/t/spec/S05-modifier/perl5_8.pugs 19:08
ok 103 - re_tests 1214 (1418)
# FUDGED!
seems to wfm too.
(PWD is /home/audreyt/Pugs.hs/Pugs, PUGS_USE_EXTERNAL_TEST is set to 1)
(on feather)
maybe try adjusting the -I flag? 19:09
[Coke] adds the -I.
heh. ;)
au :)
[Coke] aye, that's it. 19:10
au++, sorry I know that was in the examples yesterday. 19:11
au np at all. 19:13
19:16 karamorf joined
karamorf I can't seem to figure out what the equivelent is for [^/] is in regex for perl6, anyone know? 19:18
moritz <-[/]>
karamorf thanks
[Coke] sweet, with "done", we automatically get several more test files. 19:21
TimToady karamorf: though if it's a single character, ^ '/' is probably more readable 19:23
oh wait
that's a negation, nevermind
[Coke] is glad to see even TimToady has brainos. ;)
TimToady for some reason I read it as ^[/]
either that, or I read the [] as p6 brackets :) 19:24
[Coke] waits for the p5->p6 regex translator. 19:27
TimToady finishing the STD_P5 parser is another of those things I have to do first next... 19:28
but it keeps turning into one of those things I have to do first later... 19:29
in the fwiw department, the P5 regex parsing is in the best shape
std: m:P5/foo\d/ 19:31
p6eval std 52f3895: OUTPUT«ok 00:01 120m␤»
TimToady hmm, though I see it's not parsing [a-z] correctly... 19:32
raiph riddle me this: if the answer is metadsl, what's the domain, what's the language, and does it work? 19:39
Perl 6 is a snaklab. (The Balkans is a region of many small countries, where many language families meet. The individual countries fight a lot and they're poor. Perl 6 turns this around, integrating the best from many language families into a rich and happy unity.) 19:42
19:47 fridim_ left 19:48 thou joined
TimToady well, Perl 6 is *a* metadsl, and bits of it work 19:50
raiph what about domain = marketing, lang = techspeak; does it work? 19:51
moritz meta marketing? that sounds scary :-)
19:51 kst` is now known as kst 19:53 thou left
moritz jnthn: I found out why 'use Test;' fails so spectacularly 19:54
jnthn: sink annotations aren't done in routines, thus also not in EXPORT_SYMBOL
sorear good * #perl6 19:55
moritz \o sorear
raiph o/ sorear 19:56
20:06 fridim_ joined
dalek gs.hs: e908a6b | coke++ | / (3 files):
update spec test/dirs for updated Test.pm
20:11
gs.hs: 7b09c64 | coke++ | t/spectest.data:
run more tests (now that we have "done")
20:14 pmurias joined
pmurias sorear: hi 20:14
sorear: i found out what's responsible for the unit_ magic, what i'm now trying to figure out is how to add lexicals (the stuff imported from the p5 module)
dalek ast: 1faa488 | moritz++ | .gitignore:
.gitignore *.pugs
20:15
pmurias and i don't know what the second argument to add_common_name is supposed to be
that now seems to be the wrong method 20:19
[Coke] masak: *** No such subroutine: "&nok" 20:25
moritz should be easy enough to add to Test.pm 20:27
pmurias do we really need nok 20:31
20:31 emss left
moritz no, but it's nice to have 20:31
in theory it would be enough to have just one test function, &ok
20:32 retupmoca joined
moritz but it's nice to provide some convenience to the test writers 20:32
sorear pmurias: add_common_name($lexical_name, $package, $in_package_name)
pmurias sorear: what does that do?
sorear: to add a sub i should use add_my_sub? 20:33
20:34 localhost joined
moritz blug: perlgeek.de/blog-en/perl-6/prisoner...sults.html 20:35
sorear pmurias: add_common_name is the business end of "our" declarations 20:41
$sub.add_common_name('$foo', $sub.cur_pkg, '$foo') is like 'our $foo'
pmurias sorear: thanks 20:42
sorear: add_my_sub for adding empty stubs works 20:49
moritz oh, it seems that the main code of a routine appears as the argument to .clone() call 20:51
(at rakudo's PAST level, that is)
and that's why Perl6::Sinker doesn't find it
20:54 pmurias left 20:58 birdwindupbird left 21:06 simcop2387_ joined, pothos_ joined 21:08 peterete1 joined, ocharles- joined 21:09 Yappoko____ joined, robins joined, fsergot left, peteretep left, simcop2387_ is now known as simcop2387, ocharles- is now known as ocharles, GlitchMr left 21:10 pothos_ left, fsergot joined, pothos joined
fsergot o/ 21:12
21:13 pothos left, pothos joined
sorear o/ fsergot 21:15
21:16 pothos left, pothos joined 21:19 pothos left, pothos joined
sorear colomon: I beleive that I have kept features up to date wrt niecza 21:25
colomon sorear: I don't have the page open at the moment, but we've got the Set, KeySet, KeyBag entry mostly covered (as an example) 21:28
and didn't you do ObjAt from WHICH?
and we've got more than regex protos now 21:29
sorear no, we still only have regex protos.
perl6: proto foo() { say "here" }; multi foo() { 5 }; foo;
p6eval pugs b927740, niecza v14-43-gc4ecd5c: OUTPUT«here␤»
..rakudo 14c84d: ( no output )
sorear blinks
"who implemented that?" 21:30
perl6: proto foo() { say "here"; {*} }; multi foo() { 5 }; say foo;
p6eval niecza v14-43-gc4ecd5c: OUTPUT«here␤Whatever.new(...)␤»
..pugs b927740: OUTPUT«here␤Inf␤»
..rakudo 14c84d: OUTPUT«===SORRY!===␤{*} may only appear in proto at line 1, near " }; multi "␤»
colomon sure wasn't me. I thought you did? 21:31
sorear ok, protos are still insufficiently implemented to be useful for anything
so I say still "-"
I haven't been tracking KeySet well enough to know what to put - colomon, do you know how to update features?
colomon no 21:32
sorear check out git://github.com/perl6/features
go in features.json
try line 448, "n-" becomes "n+-" or whatever 21:33
niecza doesn't have object hashes so n+ is definitely wrong
colomon okay, I'll take a look at that tonight. (working on cooking nom now)
might take a look at implementing qx as well, any hints where to hook that in? 21:34
21:34 tarch joined
sorear the compiler hook is already in place 21:35
niecza: say qx/ls/
p6eval niecza v14-43-gc4ecd5c: OUTPUT«Unhandled exception: Run NYI␤ at /home/p6eval/niecza/lib/CORE.setting line 1360 (die @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3183 (rungather @ 3) ␤ at /tmp/Zgp4E24gpd line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3773…
sorear I'm not sure what the return type of rungather is
and you'll have to fight the braindamaged process-start interface of mono 21:36
colomon right, but I think the internals of the shell command I already added are probably enough to brute-force qx
okay, found rungather in the source. danke! 21:37
sorear Mono.Posix seems to lack popen() 21:38
doy_ windows in general lacks popen(), cygwin has to go to ridiculous (gross) lengths to emulate it (if i remember correctly) 21:41
21:42 doy_ is now known as doy
masak does anyone remember a blog post by moritz asking (and answering) the question "what happens when Rakudo hits 100% spectest coverage?" 21:43
au would Process.Start not work?
21:45 noam_ left
dalek ast: 4e26707 | coke++ | S05-mass/properties-general.t:
pugs fudge
21:45
gs.hs: fac101c | coke++ | t/spectest.data:
run another fudged test
21:46 noam_ joined
sorear au: Process.Start is (not suprisingly) closely based on the CreateProcess api 21:46
[Coke] "pugs", 1718, 1, 389, 9, 2117, 22754 21:47
sorear au: which kind of sucks on Unix because there's no way to pass a pre-parsed @*ARGS, the command tail *has* to be passed as a single string
au yeah, one'd need a String::ShellQuote equivalent. 21:48
sorear colomon: insane idea of the day: use GLib.Process.SpawnSync if available. It takes string[] argv and string[] envp
doy: what does cmd.exe use for pipe redirections? is it still based on temp files like DOS 2 COMMAND.COM used? 21:49
colomon sorear: I will take a look at that?
s/that?/that/
sorear doy: wait, nevermind, got popen mixed up with the passing-pipe-HANDLEs-to-CreateProcess facility 21:50
[Coke] b: print 1718+280
p6eval b 1b7dd1: OUTPUT«1998»
21:58 MayDaniel joined
masak [Coke]++ 22:00
22:01 sftp joined
[Coke] IWBNI autounfudge's --jobs worked on a single file. 22:04
colomon IWBNI? 22:06
[Coke] it would be nice if 22:08
22:11 countley joined 22:15 cooper left 22:16 ribayr joined 22:19 kaare__ left 22:31 shachaf_ left, shachaf joined
raiph masak: perlgeek.de/blog-en/perl-6/when-we-...wrong.html 22:34
masak raiph: thank you. 22:45
22:53 raiph left
x3nU haven't been around for a while 22:57
so
pugs is now alive?
sorear yes
and so is au
x3nU great news :)
sorear well, I guess au was always alive, but ey came back to #perl6
o/ masak, x3nU 23:00
x3nU \o 23:01
where latest pugs source can be found?
github repo seems to be seriously out of date
geekosaur these days it's a proper package on haskell's hackage: hackage.haskell.org/package/Pugs 23:08
if there's a repo it'll be shown in the package details
23:11 bkolera joined
masak x3nU! \o/ 23:14
x3nU: github.com/perl6/Pugs.hs 23:15
23:23 snearch joined
x3nU thanks :) 23:31
and good night everyone o/
masak \o 23:37
23:46 fridim_ left 23:48 jferrero left 23:53 jferrero joined