»ö« 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.
dalek blets: 2c73ee9 | (Herbert Breunung)++ | docs/ (3 files):
explaining: term, expression and statement
00:18
[Coke] lichtkind: why do you ask? 00:32
(if you're trying to answer it for a specific context, that'll help. Someone did, I thought, a pretty good job of answering this question in backscroll, so I'm wondering why that wasn't sufficient.) 00:33
www.webopedia.com/TERM/E/expression.html is a decent generic answer. 00:35
dalek blets: e43e7be | (Herbert Breunung)++ | docs/appendix-g-glossary.txt:
explaining context
00:45
uvtc Logical `and` and `or` are still low-precedence forms of `&&` and `||`, correct? 00:46
lichtkind yes 00:48
uvtc: its in the index :)
uvtc thanks, lichtkind
lichtkind [Coke]: i looked into wp but wanted get sure get the usage in p6 right 00:49
uvtc: not forgetting the xor and ^^ pair and we have // :)
which in contrary to p5 has low precedence equivalent of err 00:50
uvtc Why does 1 .. 4 => 1 2 3 4, but 'a' .. 'd' yields an object (rather than a list)? 00:51
lichtkind good night
uvtc Wait. Belay that.
Sorry. They both seem to return a Range.
Ah, you can do eager(1 .. 4) to get the list. 00:53
If you need it.
lichtkind, g'night 00:54
sorear good * #perl6 01:01
dalek blets: 55b137a | (Herbert Breunung)++ | / (2 files):
report count now also autogenerated header as items
01:47
moritz \o 05:49
sorear o/ moritz 06:20
frettled \o/ 06:35
tadzik /o\ 06:36
jnthn oh shark 07:47
tadzik oh shark! 07:51
moritz shouldn't there be a new HPMoR chapter today? 07:52
moritz looks
"The next progress update will appear in the Author's Notes on June 1st at 10PM Pacific Time."
:(
sorear o/ jnthn 07:54
I actually thought 'oh hai' was a backformation from ohayo
jnthn hi sorear 07:55
fglock hi all 08:07
arnsholt 'lo 08:08
frettled "oh hai" has jumped the shark 08:45
moritz in sovjet russia, sharks jump on you! 09:06
brrt still likes lolcats 09:07
sorear sleep&
moritz n: say $?LINE 09:17
p6eval niecza v17-2-gb8fcf85: OUTPUT«1␤»
moritz n: my $?LINE
p6eval niecza v17-2-gb8fcf85: OUTPUT«===SORRY!===␤␤Variables with the ? twigil cannot be declared using my; they are created using 'constant'. at /tmp/9Y3aBLaSpj line 1 (EOF):␤------> my $?LINE⏏<EOL>␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/nie…
moritz n: constant $?LINE = 2; say $?LINE
p6eval niecza v17-2-gb8fcf85: OUTPUT«1␤»
moritz thought so :-)
jnthn moritz: You pondering implementing $?LINE in Rakudo? :) 09:19
moritz jnthn: yes 09:27
jnthn moritz: Nice 09:28
moritz jnthn: currently I just consider a special case in make_variable
jnthn BTW, I also figured out how to do -M
moritz \o/
and I have a local patch for nqp that allows -Ilib without the space 09:29
but not a machine that I currently have access to :/
so needs to wait until tonight
jnthn moritz: In comp_unit, before calling <statementlist> but after all the other stuff, just look for M in the options list, and if it's there just do exactly what "use" does (which is a couple of calls on $*W).
moritz jnthn: nice 09:30
sounds doable
except we ned to be careful not re-load the modules when inside an eval
and things like that
jnthn yeah 09:31
Well, we already can know if we're in an eval ('cus we have to know not to re-load the setting etc.)
dalek rlito: b4f4a35 | (Flavio S. Glock)++ | / (40 files):
Perlito5 - perl5: "use" is compile-time (the emitted code contains all modules used)
09:53
dalek kudo/nom: 7836d2f | moritz++ | / (3 files):
implement $?LINE and $?FILE
09:56
jnthn \o/ 09:58
timotimo is the fedora packaging for rakudo star still maintained? the fedora wiki page says the targeted release is fedora 12, that's a bit old, isn't it? 09:59
moritz that was surprisingly simple, and worked on the frist try.
... and of course I screwed up the exception throwing :/
timotimo apparently the rakudo star i can get in fedora 17 is 0.0.2011.07_3.6.0-4, that's not very current :( 10:07
moritz that's before nom time
n: say $?FILE 10:08
p6eval niecza v17-2-gb8fcf85: OUTPUT«/tmp/ZVUAGLudlX␤»
dalek kudo/nom: 97f9756 | moritz++ | src/Perl6/Actions.pm:
fix exception throwing from previous commit
10:11
timotimo nom time is good time. 10:12
sisar r: my @a; @a[1] = 42; say @a; 10:50
p6eval rakudo 7836d2: OUTPUT«use of uninitialized value of type Any in string context in method Str at src/gen/CORE.setting:670␤␤ 42␤»
sisar moritz: this ^ does not report the line no. Is this bug already filed ? 10:51
sisar moritz: RT #67808 was a similar bug. 10:56
moritz sisar: I'ma aware of it. Not sure if it's in RT 11:24
MContagious can I get location for code fix done to support -I for perl6 11:27
moritz MContagious: github.com/rakudo/rakudo/commit/4c...ea3f84a558 11:29
tadzik MContagious: are you thinking about implementing -M? 11:30
moritz I'm already locally testing a patch for -M
tadzik great, moritz++ 11:31
moritz not working yet :(
tadzik yay, a failing test! :) 11:32
moritz $ ./perl6 -I lib -M Test -e 'use Test; ok 1; done' ok 1 - 11:41
1..1
moritz erm, I shouldn't 'use Test' inside 11:43
tadzik cool 11:44
moritz if I leave out the inner 'use Test', it doesn't work :/
JimmyZ r: use Test; use Test; 11:48
p6eval rakudo 97f975: OUTPUT«===SORRY!===␤Cannot import symbol '&plan', since it already exists in the lexpad␤»
JimmyZ LTA? 11:49
moritz I find it quite awesome
JimmyZ n: use Test; use Test;
p6eval niecza v17-2-gb8fcf85: OUTPUT«Unhandled exception: Illegal redeclaration of symbol 'Test' (see line 0)␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1364 (die @ 3) ␤ at /home/p6eval/niecza/src/NieczaBackendDotnet.pm6 line 173 (ANON @ 8) ␤ at /home/p6eval/niecza/src/NieczaBackend…
JimmyZ doesn't think so, it's not easy to debug... 11:52
moritz well, it could report the name of the module it's currently loading 11:53
JimmyZ aye 11:54
moritz JimmyZ: shouldn't be too hard to fix 11:56
JimmyZ moritz: +1 to fix :P 11:57
moritz JimmyZ: want to do it?
moritz ok, I have a basic test for -M working 12:00
JimmyZ doesn't know how to fix it 12:01
moritz JimmyZ: I can tell you
at least I think I can :-)
JimmyZ I can give it a try, but I'm not sure 12:02
moritz JimmyZ: ok. The first step is to locate the error message
ack 'Cannot import symbol' src/
=> src/Perl6/World.pm line 228 12:03
now you just have get a handle on the module name 12:04
luckily there's $package in scope
so you can get at its name with $package.HOW.name($package)
include that in the error message, be happy
tadzik Good Guide Moritz :) 12:05
moritz :-)
moritz always happy to lure^W help new committers
JimmyZ oh', that's why I can't locate it, my rakudo is too old
arnsholt moritz: *prod?* 12:09
moritz arnsholt: reprod 12:10
arnsholt Hehe. Did you ever get a chance to check out my new dyncall branch yesterday? 12:14
It should either fix your sqlite stuff or give me more bug reports =)
moritz arnsholt: no. Will try to it tonight or tomorrow 12:17
*try to do it
arnsholt Excellent. I think it should work, but I'm still a bit wary of my NQP/6model skills, so testing would be awesome 12:25
dalek p: 42329b4 | moritz++ | src/HLL/CommandLine.pm:
remove some debugging output
12:30
p: 88f00e1 | moritz++ | / (2 files):
fix and test multiple uses of same command line option
uvtc Hi #perl6. Should the following get me 'a' .. 'z'? `.say for 'a' .. *;` 12:36
On my machine, it just prints "a" and waits.
moritz it's probably some problem with eagerness 12:37
r: .say for 'a' .. *
p6eval rakudo 97f975: OUTPUT«(timeout)a␤»
uvtc r: .say for eager('a' .. *); 12:38
p6eval rakudo 97f975: OUTPUT«(timeout)a␤»
[Coke] r: .say for 'a'..'z'
p6eval rakudo 97f975: OUTPUT«a␤b␤c␤d␤e␤f␤g␤h␤i␤j␤k␤l␤m␤n␤o␤p␤q␤r␤s␤t␤u␤v␤w␤x␤y␤z␤»
uvtc [Coke], right. 12:39
dalek kudo/nom: 93a44d7 | moritz++ | / (4 files):
Implement -M option

Currently only works for proper modules, not pragmas like fatal or MONKEY_TYPING.
Also bumps NQP revision to get command line parser fixes
12:41
MContagious moritz and tadzik:Yeah I am thinking to implement -M, You can provide me if you have already implemented 12:43
sisar moritz: i've reported the missing line no. bug: RT #112724
moritz MContagious: the patch that I just pushed did it already 12:44
MContagious can you share me that patch ? 12:47
moritz MContagious: dalek reported a review URL
MContagious: simply follow it
MContagious thanks 12:48
uvtc Trying to figure out how the "..." operator works... 12:56
r: for (1, 3 ... *) -> $i { if $i > 10 { last } else { $i.say } }
p6eval rakudo 97f975: OUTPUT«1␤3␤5␤7␤9␤»
uvtc How does perl6 know? 12:56
PerlJam uvtc: how does it know what?
colomon how does perl6 know what?
PerlJam uvtc: are you asking how ti figures out the sequence?
flussence_ that $^b - $^a = 2?
uvtc How does it know how many to skip between values?
PerlJam, Yes. How does it figure out the sequence? 12:57
colomon if there are two values, it subtracts the first from the second and uses that as an increment
that's easy.
uvtc colomon, Oh, Ok. Thanks. 12:57
moritz uvtc: S03 has some details
uvtc colomon, How do I tell it: "run this single-arg fn on the prev value to get the next one"? 12:58
moritz search for 'sequence operator'
moritz $first, &routine ... *; 12:58
colomon what moritz++ said
uvtc moritz, what do I use as the prev value in the routine? $_?
$a?
colomon r: for (1, *+2 ... *) -> $i { if $i > 10 { last } else { $i.say } }
p6eval rakudo 97f975: OUTPUT«1␤3␤5␤7␤9␤»
moritz uvtc: it is passed as an argument to that function 12:59
colomon r: for (1, *+.2 ... *) -> $i { if $i > 10 { last } else { $i.say } }
p6eval rakudo 97f975: OUTPUT«1␤1.2␤1.4␤1.6␤1.8␤2␤2.2␤2.4␤2.6␤2.8␤3␤3.2␤3.4␤3.6␤3.8␤4␤4.2␤4.4␤4.6␤4.8␤5␤5.2␤5.4␤5.6␤5.8␤6␤6.2␤6.4␤6.6␤6.8␤7␤7.2␤7.4␤7.6␤7.8␤8␤8.2␤8.4␤8.6␤8.8␤9␤9.2␤9.4␤9.6␤9.8␤10␤»
PerlJam uvtc: S03:1806 or there abouts. Start reading :)
moritz r: sub foo($x) { 2 * $x + 1 }; say (1, &foo ... *)[^5]
p6eval rakudo 97f975: OUTPUT«1 3 7 15 31␤»
uvtc r: for (1, {$_ + 2} ... *) -> $i { if $i > 10 {last} else {$i.say}} 12:59
p6eval rakudo 97f975: OUTPUT«1␤3␤5␤7␤9␤»
colomon r: for (1, -> $x { $x + 2 } ... *) -> $i { if $i > 10 { last } else { $i.say } } 13:00
p6eval rakudo 97f975: OUTPUT«1␤3␤5␤7␤9␤»
uvtc eeek!
colomon lots of different ways to specify that.
uvtc colomon, thanks, I'm seeking the "baby Perl 6 way" at the moment. :)
dalek blets: 86215ce | (Herbert Breunung)++ | docs/appendix-g-glossary.txt:
explain file handle and add some more terms to explain later
colomon uvtc: I'm not sure anyone knows what that is yet. :)
moritz baby Perl 6 is loop (my $i = i; $i < 21; $i += 2) { ... } 13:01
colomon ick
uvtc moritz, hm. Well, maybe a little more perlish than that.
moritz 1, 3 ... *
erm
1, 3 ... 21 13:02
or
(1, 3 ... *)[^10] # first ten values
or if you want to be explicit
PerlJam for 0..10 { my $i = $_ * 2 + 1; ... } # adolescent perl 6 ?
moritz (1, * + 2, ... *)[^10]
uvtc
.oO( Dad, can I borrow the hash keys? )
moritz :-) 13:03
uvtc (And that's on only a half a cup of tea. Wait 'til I get going!)
moritz waits
btw one idiom I really love for cycling through values is 13:04
r: for ^10 { say <red green blue>[$_ % *] }
p6eval rakudo 97f975: OUTPUT«red␤green␤blue␤red␤green␤blue␤red␤green␤blue␤red␤»
jnthn oooh :) 13:09
That's cute.
mikec__ what does the * do? 13:10
moritz discovered while writing SVG::Plot, some years ago :-)
mikec__: it creates a closure, with a formal parameter instead of the *
colomon r: for (<red green blue> X *)[^10] { .say }
p6eval rakudo 97f975: OUTPUT«red␤*␤green␤*␤blue␤*␤»
flussence r: say <red green blue>[^10 X% 3]
p6eval rakudo 97f975: OUTPUT«red green blue red green blue red green blue red␤»
PerlJam It is timtowtdi day today? :)
colomon flussence++ 13:11
moritz mikec__: so it's the same { 3 % $_ }
flussence: yours repeats the number of elements
colomon moritz: you mean 3 % $_, no?
moritz r: say <red green blue>[^10 X% *]
p6eval rakudo 97f975: OUTPUT«Cannot call 'Real'; none of these signatures match:␤:(Mu:U \$v, Mu *%_)␤␤ in method Real at src/gen/CORE.setting:656␤ in sub infix:<%> at src/gen/CORE.setting:2350␤ in block <anon> at src/gen/CORE.setting:10585␤ in sub coro at src/gen/CORE.setting:4926␤ in met…
colomon moritz: dang it, $_ % 3
moritz colomon: yes
uvtc r: say (1, 3 ... 10); 13:12
hm.
p6eval rakudo 97f975: OUTPUT«(timeout)»
moritz r: say (1, 3 ... * > 10 )
p6eval rakudo 97f975: OUTPUT«1 3 5 7 9 11␤»
moritz r: say (1, 3 ...^ * > 10 )
p6eval rakudo 97f975: OUTPUT«1 3 5 7 9␤»
flussence r: given <red green blue> { $_[^10 X% +$_] } 13:13
p6eval rakudo 97f975: ( no output )
flussence r: given <red green blue> { say $_[^10 X% +$_] }
p6eval rakudo 97f975: OUTPUT«red green blue red green blue red green blue red␤»
uvtc Ah, ok, thanks, moritz.
flussence r: say $_[^10 X% +$_] given <red green blue> 13:14
p6eval rakudo 93a44d: OUTPUT«red green blue red green blue red green blue red␤»
uvtc moritz, ack. Wait. 1, 3 ... * > 10? Greater than? I want all the nums where whatever is less than 10, no? 13:15
moritz uvtc: the RHS of the ... is the stop condition
uvtc r: my @odds = 1, 3 ... * < 10; say @odds
p6eval rakudo 93a44d: OUTPUT«1␤»
moritz uvtc: not the "what I want" condition
uvtc moritz, Ohhhhhhh.
moritz, thanks. 13:16
moritz uvtc: do read the specs when we point you to them :-)
uvtc moritz, right. 13:18
uvtc If you could take a moment, please let me know if you see any glaring omissions, blatant falsehoods, or run-of-the-mill nonsense in this section of the mostly harmless docs: wiki.perl6.org/Mostly%20Harmless%20.../Operators . Thanks. 13:29
uvtc Again, it's supposed to be brief, easy, and not scary. 13:31
moritz my-obj-with-a-long-name = my-obj-with-a-long-name.method-call # you can instead do
my-obj-with-a-long-name .= method-call
I'd use a $variable there
"object with a long name" sounds rather vague and badly defined 13:32
unless you mean a type
in which case you should say type, not object
uvtc moritz, thanks. changed that to $variable-with-a-long-name. I wanted it to be obvious that it saves you from typing out that long name twice. 13:33
dalek kudo/nom: 0059aa6 | duff++ | src/Perl6/Grammar.pm:
Fix typo in subrule
13:42
[Coke] r: for (100, * %% 2 ?? * / 2 !! (* * 3) + 1 ... *<=1 ) { .say } 13:42
p6eval rakudo 93a44d: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in block <anon> at /tmp/QNNmEUKzrv:1␤␤»
PerlJam why expected 2? 13:43
jnthn r: say ((* * 3) + 1 ... *<=1).WHAT 13:44
p6eval rakudo 93a44d: OUTPUT«List()␤»
jnthn Hm, I thought it may be taking the lot as one big WhateverCode
uvtc Is Perl 6's Nil like Perl 5's undef? 13:46
tadzik std: undef 13:48
p6eval std fab64fc: OUTPUT«===SORRY!===␤Unsupported use of undef as a value; in Perl 6 please use something more specific:␤ Mu (the "most undefined" type object),␤ an undefined type object such as Int,␤ :!defined as a matcher,␤ Any:U as a type constraint,␤ Nil as the absense
..…
tadzik many things are the Perl 5's undef :)
PerlJam uvtc: Nil is the absence of a value. 13:49
uvtc Thanks.
r: my $x = Nil; say $x 13:50
p6eval rakudo 93a44d: OUTPUT«Nil␤»
uvtc r: ?Nil
p6eval rakudo 93a44d: ( no output )
uvtc r: (?Nil).say
p6eval rakudo 93a44d: OUTPUT«False␤»
PerlJam r: my @a = (Nil, Nil, Nil); say +@a; 13:51
p6eval rakudo 93a44d: OUTPUT«0␤»
PerlJam If you fill an empty bucket with Nil, the bucket remains empty :) 13:52
uvtc Tried to boil it down here: wiki.perl6.org/Mostly%20Harmless%20...0Falsehood
moritz uvtc: maybe worth mentening that '' is false too 13:53
uvtc moritz++ 13:54
moritz as well as type objects
uvtc "empty objects"?
moritz type objects.
uvtc (ooh, forgot to mention, "everything else is true"
)
moritz like, Int
uvtc r: ?Int 13:55
p6eval rakudo 93a44d: ( no output )
uvtc r: (?Int).say
p6eval rakudo 93a44d: OUTPUT«False␤»
uvtc moritz, may have to add a types section. Thanks. 13:56
JimmyZ moritz: I gave up, compile rakudo is slow.... and $package.HOW.name($package) outputs DEFAULT 14:01
jnthn Probably because it's pulling stuff out of EXPORT::DEFAULT... 14:02
JimmyZ well, most time is compiling.. 14:04
jnthn Yes, beefy hardware is useful when working on Rakudo :) 14:05
moritz r: package A { }; say A.HOW.name(A) 14:25
p6eval rakudo 0059aa: OUTPUT«A␤»
PerlJam could Coke's example be that ?? !! is turning into 2 WhateverCodes instead of just 1 ?
moritz hm
_-`user0 Hi, i want to learn perl6 from beginning, can you tell me where can i learn it ? 14:49
TimToady do you know Perl 5? 14:50
_-`user0 TimToady: no
PerlJam _-`user0: Have a look at perl6.org/documentation for some learning resources
TimToady have you programmed in any language before? 14:51
uvtc _-`user0, just noticed, the link to the [beginner's book](github.com/perl6/book) download is out of date. I'll update that now. 14:53
_-`user0 TimToady: html/css,php,sql,bash, a little C
uvtc: Thank you :)
TimToady do you like to learn from examples, of from tutorials? 14:53
if examples, you might visit rosettacode.org/wiki/Category:Perl_6 14:54
_-`user0 okay 14:55
TimToady php is similar enough to perl that perlgeek.de/en/article/5-to-6 might be useful
dalek href="https://perl6.org:">perl6.org: 736c5de | (John Gabriele)++ | source/documentation/index.html:
updated the github book download link from 2011.01 to 2011.07
14:56
_sri is there a usable perl6 to perl5 compiler yet? 14:57
uvtc _-`user0, y/w. :) May take a few minutes for that page to automatically update. 14:58
_sri it would be interesting to target rakudo and perl5 with the same code base
PerlJam _sri: perlito 14:59
_sri PerlJam: but is it actually usable?
fglock _sri: both 5-to-6 and 6-to-5 development are mostly stopped 14:59
PerlJam I can't comment on its degree of usability.
fglock: why exactly? 15:00
fglock: (would a TPF grant help?)
_sri compiling 6 to 5 is pretty much the best (only?) chance i see for perl6 to ever really take off inside the perl5 community 15:02
JimmyZ moose ? 15:02
moritz thinks that embedding is a better way 15:03
people don't like generated code
_sri embedding still means wasted resources
fglock _sri: most development at the moment is focusing on either linking perl6 and perl5 in the same binary, or porting both perl6 and perl5 to a common platform
_sri embedding helps with the 5 to 6 porting process, but won't make anyone want to develop new code targeting 6 15:04
moritz _sri: compilation also means wasted resources
TimToady agrees with moritz, because the semantic models are different enough that cross-compiling results in running an interpreter in an interpreter, which will be very slow
the other approach is to hack more P6 primitives into the P5 core 15:05
like pervasive laziness
_sri i'm very interested in porting mojolicious to perl6, but i just don't see myself sacrificing resources for it that could be spent making the perl5 version better
TimToady and a type system
moritz perverse laziness :-)
fglock one of the big problems is that perl5 is just not the same without XS
moritz TimToady: well, adding a type system would be a pretty big departure from current p5
somehow I don't see that happening any time soon 15:06
TimToady XS is more or less a poor-man's type system...
the reason we can do something else in P6 is precisly because we have a type/trait system
_sri moritz: wasted cpu time yes, but developer time is much more valuable 15:07
TimToady and the whole approach to scalar types is subverted; P5 doesn't really want to know the type of a scalar, and P6 really does
arnsholt As jnthn++ explained to me, the combination of representation polymorphism and a type system is pretty much what makes zavolaj go 15:08
Speaking of XS
TimToady I kinda keep the rep poly under the "type system" category in my mind
it's just low-level rather than high-level
arnsholt True dat 15:09
moritz arnsholt: fwiw I'd appreciate it if you declared the string argument to explicitly-manage as 'is rw' 15:10
TimToady I think it's much more likely that the real migration path will be to emulate Perl 5 in Perl 6, once our theoretical optimizations and native backends happen
moritz it's not enforced, but you do modify the argument
moritz _sri: fwiw I considered starting to port the util classes of Mojo (those that don't depend on the runloop) to p6; we should have enough features in rakudo to make that mostly a pleasant experience 15:11
TimToady writing an XS-to-zavolaj translator is probably halting-problem territory though 15:12
moritz like, Mojo::{JSON,DOM,Cookie}
_sri moritz: i believe almost everything can be ported now
sjn moritz: I'd love that :)
phenny sjn: 01 May 18:18Z <uvtc> tell sjn I'm a fan of markdown too. I haven't read S26 too carefully, but it would be nice if I could just do =begin markdown ... =end markdown and write all my docs in markdown.
fglock (backlogging, I've lost connection for a while) 15:13
moritz _sri: should I do it in the Mojo namespace, or would you rather have me do it with a different name first?
arnsholt TimToady: We did talk about a header-to-zavolaj utility during the hackathon in Oslo, but I'm not gonna touch XS if at all possible I think
[Coke] jnthn: (one big whatevercode) is there a way to avoid that?
is it a bug?
TimToady also, I suspect that most P5 module programmers will choose to learn P6 by porting their modules
PerlJam Perl 5 is migrating a MOP inward, maybe they can do the same with one of the type systems on CPAN 15:14
TimToady because that's where the motivation is, if there is any
dalek volaj/cstr: a4f37b4 | (Arne Skjærholt)++ | lib/NativeCall.pm6:
Make Str parameter of explicitly-manage rw. moritz++
_sri moritz: since there's no CP6AN yet, does it matter?
PerlJam doubts that Perl 5 will *ever* get pervasive laziness though
moritz _sri: there's modules.perl6.org 15:15
TimToady it's just not comprehensive yet
moritz and it's not an archive either
more like a tracker
_sri shrugs 15:16
[Coke] ah.
r: for (100, {$^a %% 2 ?? $^a / 2 !! ($^a * 3)} + 1 ... *<=1 ) { .say }
p6eval rakudo 0059aa: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \$v, Mu *%_)␤␤ in method Numeric at src/gen/CORE.setting:648␤ in sub infix:<+> at src/gen/CORE.setting:2329␤ in block <anon> at /tmp/vXGkIbGvCe:1␤␤»
jnthn [Coke]: Well, I tried to see if it was doing what I thought it may be, and that wasn't the issue... 15:17
[Coke] r: for (100, {$^a %% 2 ?? $^a / 2 !! ($^a * 3) + 1} ... *<=1 ) { .say }
p6eval rakudo 0059aa: OUTPUT«100␤50␤25␤76␤38␤19␤58␤29␤88␤44␤22␤11␤34␤17␤52␤26␤13␤40␤20␤10␤5␤16␤8␤4␤2␤1␤»
TimToady why are you adding 1 to a closure?
[Coke] r: for (1000, {$^a %% 2 ?? $^a / 2 !! ($^a * 3) + 1} ... *<=1 ) { .say }
p6eval rakudo 0059aa: OUTPUT«1000␤500␤250␤125␤376␤188␤94␤47␤142␤71␤214␤107␤322␤161␤484␤242␤121␤364␤182␤91␤274␤137␤412␤206␤103␤310␤155␤466␤233␤700␤350␤175␤526␤263␤790␤395␤1186␤593␤1780␤890␤445␤1336␤668␤334␤167␤502␤251␤754␤377␤1132␤566␤283␤850␤425␤1276␤638␤319␤958␤479␤1438␤719␤2158␤1079␤3238␤161…
jnthn decommutes, bbl 15:18
[Coke] TimToady: misplaced }
[Coke] "played" that on his first electronic calculator for hours. ah, my misspent youth.
PerlJam [Coke]: I think your original was more like : for (100, { {$^a %% 2 ?? $^b / 2 !! ($^c * 3) +1 } ... *<=1) { .say }
TimToady and why are you being superstitious about *<=1 ?
[Coke] PerlJam: mayhap, aye.
TimToady I'm trying to remember what that's called on RC 15:19
[Coke] TimToady: if the sequence doesn't happen to hit one, it'll never stop. 15:19
[Coke] that sequence always does though, I think. 15:19
TimToady rosettacode.org/wiki/Hailstone_sequence 15:20
[Coke] r: for (500, {$^a %% 2 ?? $^a / 2 !! ($^a * 3) + 1} ... 1 ) { .say a}
p6eval rakudo 0059aa: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 2␤» 15:20
[Coke] r: for (500, {$^a %% 2 ?? $^a / 2 !! ($^a * 3) + 1} ... 1 ) { .say }
p6eval rakudo 0059aa: OUTPUT«500␤250␤125␤376␤188␤94␤47␤142␤71␤214␤107␤322␤161␤484␤242␤121␤364␤182␤91␤274␤137␤412␤206␤103␤310␤155␤466␤233␤700␤350␤175␤526␤263␤790␤395␤1186␤593␤1780␤890␤445␤1336␤668␤334␤167␤502␤251␤754␤377␤1132␤566␤283␤850␤425␤1276␤638␤319␤958␤479␤1438␤719␤2158␤1079␤3238␤1619␤485…
TimToady r: sub hailstone($n) { $n, { $_ %% 2 ?? $_ div 2 !! $_ * 3 + 1 } ... 1 }; say hailstone(27)
p6eval rakudo 0059aa: OUTPUT«27 82 41 124 62 31 94 47 142 71 214 107 322 161 484 242 121 364 182 91 274 137 412 206 103 310 155 466 233 700 350 175 526 263 790 395 1186 593 1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276 638 319 958 479 1438 719 2158 1079 3238 1619 4858…
TimToady that's the one on RC 15:21
fglock perlito6 works fine if you use the subset of Perl6 that has semantics like perl5 (or whatever backend it compiles to); once you get into things not supported by the backend, performance suffers and the code gets much bigger and complex
fglock everything is possible, but some things are not practical 15:21
TimToady fglock: what you say is true of the other implementations too :) 15:22
fglock yes
perlito5 works fine in node.js, because the semantics are more or less ok, and there is some spare speed to emulate the mismatches (but still no XS) 15:25
[Coke] TimToady: why "div" instead of "/" ? 15:26
TimToady to keep it in integers rather than rats 15:27
awwaiid hmm... idea! Dependency graph of Perl6 features as a guide to better understand the path of subset implementations
TimToady I dunno, one person's light post is another person's fog... 15:28
moritz awwaiid: the dependency graph greatly depends on how thorough you do things
awwaiid well that's the idea though -- you would make two differnt nodes in your graph, one for "simple integer addition" and one for "addition as secretly a method" or something. Then the second one would depend on fancy things and the first wouldn't. 15:30
awwaiid handwaves details
fglock decommutes 15:33
flussence awwaiid: if that ever gets made, it might be a starting point for `make -j`-able core.setting compilation :) 15:35
moritz it's certainly doable, but much effort 15:39
or put differently, I can imagine lots of things that provide higher benefit/effort ratios today 15:40
awwaiid probably not very maintainable either 15:42
TimToady Even with "simple integer addition", there are differing kinds of "simple" 15:43
awwaiid true that
TimToady P6's integer addition is simple *because* it's based on bigints
dalek osystem: a4f859c | tadzik++ | META.list:
Add Template::Mojo
colomon oooooo
awwaiid I'm imagining something like a graph of dependencies between test cases
TimToady it's sorta saying that everyone has to put the circularity saws in the same spot, which P6 doesn't require 15:44
TimToady the dependencies between test cases can run different directions under different implementations 15:45
awwaiid maybe it could be metadata in the test suite -- if test X test passes then test Y should already have passed
moritz well, it would have lots of cycles, that graph
awwaiid sure it would
it would be a delicious mess!
anyway. popped into my head and I thought I'd throw it out there :) 15:46
moritz throws it back at awwaiid :-) 15:46
awwaiid leaps into the air to catch it in his teeth 15:46
moritz r: :a(1)(2) 15:47
p6eval rakudo 0059aa: OUTPUT«Method 'postcircumfix:<( )>' not found for invocant of class 'Pair'␤ in <anon> at src/gen/BOOTSTRAP.pm:815␤ in any <anon> at src/gen/BOOTSTRAP.pm:811␤ in block <anon> at /tmp/zXiJAaBeOP:1␤␤»
moritz r: :16(3)(4) 15:48
p6eval rakudo 0059aa: OUTPUT«Nominal type check failed for parameter '$str'; expected Str but got Int instead␤ in sub unbase at src/gen/CORE.setting:4144␤ in block <anon> at /tmp/p1PgwPoyPX:1␤␤»
moritz tries to find out which case PerlJam++ fixed in his last commit 15:48
that colonpair rule has | (\d+) <identifier> 15:49
moritz ah, that's for 2nd, 3rd 15:49
r: say ( :1st ).perl 15:50
p6eval rakudo 0059aa: OUTPUT«===SORRY!===␤Malformed radix number␤at /tmp/d7UcZXKor6:1␤»
moritz r: m:1st / . /
p6eval rakudo 0059aa: OUTPUT«Method 'match' not found for invocant of class 'Any'␤ in block <anon> at /tmp/XvhayZrlFk:1␤␤»
moritz r: m:1st(3) / . /
p6eval rakudo 0059aa: OUTPUT«===SORRY!===␤2nd argument not allowed on pair at line 1, near " / . /"␤»
moritz ah, that's it
TimToady std: say ( :1st ).perl 15:53
p6eval std fab64fc: OUTPUT«ok 00:00 41m␤»
TimToady LTM damage, I guess
[Coke] ok, that's 10 points of LTM damage. Roll for spot check. 15:54
bbkr rakudo: :2() # LTA message, it should complaint about missing param, not about bad type
p6eval rakudo 0059aa: OUTPUT«Nominal type check failed for parameter '$str'; expected Str but got Parcel instead␤ in sub unbase at src/gen/CORE.setting:4144␤ in block <anon> at /tmp/OzRQ79NLFt:1␤␤»
PerlJam moritz: I actually found the typo via ack looking for something else and it took me a few minutes to figure out what case that was for too :) 15:55
masak lol shark, #perl6 15:59
tadzik lol masak, shark 16:00
TimToady 'same' to you 16:03
TimToady phenny: ja en "same"? 16:03
phenny TimToady: "same" (ja to en, translate.google.com) 16:03
masak GT doesn't do phonetic Japanese, AFAIK ;0 16:04
;)
TimToady phenny: ja en "さめ"?
phenny TimToady: "Shark" (ja to en, translate.google.com)
bbkr perl6: say so * 16:07
p6eval rakudo 0059aa: OUTPUT«WhateverCode.new()␤»
..pugs: OUTPUT«1␤»
..niecza v17-2-gb8fcf85: OUTPUT«{ ... }␤»
bbkr hm 16:08
"so" should enforce boolean context, right?
bbkr reports 16:10
masak notabug.
masak phenny: sv en 'same'? 16:11
phenny: sv en "same"?
phenny masak: "Sami" (sv to en, translate.google.com)
masak phenny: tell lichtkind re github.com/perl6/tablets/blob/2c73...y.txt#L197 -- I believe you meant s/terms and statements/terms and operators/ 16:14
phenny masak: I'll pass that on when lichtkind is around.
daxim reindeers and stuff
uvtc Looks like I can still use curly braces to create a local scope. wiki.perl6.org/Mostly%20Harmless%20Docs/Scope But I've read that curlies are for creating code blocks. Is that the same thing here? 16:16
Hm. That appears to be explained in S04. But that's a rather long read. 16:19
Will have to get back to this another time I guess.
masak a code block always carries a local lexpad with it, so yes, it defines a scope. 16:24
masak bbkr++ # rejecting his own mistickets ;) 16:26
fglock_ _sri: v6.pm in CPAN allows a module to be used in both p5 and p6; you would be the first user ever, so YMMV 16:30
PerlJam v6.pm allows for a module to be used in p5? that's ... odd. 16:33
_sri fglock_: is there documentation for which features are supported? 16:34
PerlJam oh. /me tries it. 16:35
fglock_: Have you updated perlito since Oct 2011? 16:36
fglock_ _sri: no, there are the tests only
_sri fglock_: i see :/
fglock_ PerlJam: I didn't release new versions to cpan
I mostly stopped development because perlito5 was more interesting, but if you find it useful I could start again 16:38
note you can run the same code in the browser, it also passes the tests (except for things that require file i/o) 16:39
masak today's autopun: twitter.com/sixthformpoet/status/19...0416565248 17:32
sisar phenny, tell lichtkind, the navigation links at the top of Appendix A are broken, especially the symbols row. I tried to fix it, but my markdown knowledge is limited. 17:48
phenny sisar: I'll pass that on when lichtkind is around.
sisar phenny: tell lichtkind, i meant the navigation links just above the heading "Punctuation" 17:59
phenny sisar: I'll pass that on when lichtkind is around.
_sri which perl6 module is the best example for what a good perl6 distribution should look like? 18:57
masak _sri: that's hard to answer. we don't have a CPAN, so we tend to think in modules, not "distributions". 19:00
masak that said, there are certain guidelines that tadzik++/panda likes if you follow. 19:00
_sri well, which module is the best example then? :) 19:01
especially regarding tests and documentation
masak good question. I don't know. 19:02
I wish I had more time to study other people's modules. :/
_sri i've found a lot of proof-of-concept type code on github, but so far nothing that looked finished 19:03
masak well, there's a page from yesterday's backlog which will tell you which modules build correctly and pass all their tests. 19:05
maybe that'll help.
jnthn github.com/jnthn/zavolaj is an OK example. Modules and tests in the right place, docs that cover all but the stuff currently being added, a META.info. 19:06
_sri looks 19:07
jnthn Arguably it should pod document stuff. 19:08
There's not really been a cultural push for ubiquitous Pod though...
_sri oh, say() to emit TAP :S
jnthn Oh, don't follow that example. 19:09
There's a good reason.
Those tests also call C code
Which also emits ok's.
Most if not all modules use Test.pm.
_sri i see
colomon jnthn: not all, Damian's use his Testing module instead. 19:10
masak using say() to emit TAP is definitely not common practice in the Perl 6 community :)
colomon: is that online? 19:11
colomon yes, and in the ecosystem.
(though I believe it only works with Rakudo at the moment.)
_sri one thing i always loved about perl5 was the documentation culture
jnthn masak: Writing and testing native call interfaces is a fairly minority exercise too :)
masak nod. 19:12
jnthn I suspect once modules.perl6.org starts rendering Pod docs in modules, there'll be more uptake. 19:16
jnthn At least, I'll find it a motivator to do it :) 19:17
masak ooh 19:18
_sri Test does look rather pleasant to use
masak it's not bad.
_sri it does not look like a good example itself though 19:20
masak of what? good test coverage? 19:20
_sri style 19:21
masak keep in mind that Test.pm looks the way it does for many reasons having to do with Rakudo's coming of age.
_sri github.com/rakudo/rakudo/blob/nom/...st.pm#L226 # is that a magical comment?
masak surely not. 19:22
_sri has not found documentation on POD and comments in perl6 yet 19:22
masak perlcabal.org/syn/S26.html 19:23
_sri thanks 19:24
TimToady perlcabal.org/syn/S02.html#Multiline_Comments
masak doesn't understand why he hasn't heard of the en.wikipedia.org/wiki/Ulam_spiral until now 19:30
[Coke] Did you major in math? 19:32
TimToady you did hear of it, but suppressed the memory :) 19:34
masak [Coke]: haven't majored in anything, but math has always held a special place in my heart. 19:35
moritz \o 19:36
arnsholt: fwiw t/07-writebarrier.t fails here with "Cannot locate native library '07-writebarrier.so'" 19:41
[Coke] 19:42
moritz arnsholt: ah, needs is native('./07-writebarrier') 19:43
I can fix that later 19:44
arnsholt moritz: Derp. Must've forgotten to run the test suite before committing
moritz arnsholt: are you on macos?
arnsholt Yeah
moritz arnsholt: that explains it 19:45
arnsholt Oh? 19:45
moritz arnsholt: that fix is only needed on linux
moritz arnsholt: different defaults in library paths 19:45
arnsholt Oh. The ./ in front? 19:46
moritz yes
arnsholt Right. I'll try to remember that next time. In that case I might've broken a couple of other test file as well, I think
moritz all other tests pass
arnsholt Good, good 19:49
moritz arnsholt: \o/ all but on test pass 19:50
and that one is my own fault, I assume
moritz (the failing test is ok $dbh.finish, it fails with SQLITE_BUSY) 19:53
arnsholt Excellent! 19:54
moritz I just wonder how much memory I leak 19:55
arnsholt Let's not think too hard about that ;) 19:58
But IIRC, all the structures you create in Perl 6 should be properly freed when the wrapper object is GCed 19:59
Stuff returned from C isn't freed though, I think
moritz I just wonder if my stuff gets GCed :-)
arnsholt Oh, right. I think Parrot's GC is better than Perl 5's refcounting, so it's pretty hard to leak that way I think 20:00
Dunno if you keep references to everything in a cache somewhere or so, though =) 20:01
moritz I leak statement handles :/
on the C side, that is 20:02
arnsholt Oh?
moritz well, I need to call $sth.finish each time one is GC'Ed
but we don't have DESTROY submethods yet
arnsholt I see 20:03
tadzik istr DESTROYs were quite an easy patch, in fact. It's just that they were very hard to get per spec
ordering of them, etc
moritz well, a partial DESTROY would quite well for me
tadzik I'll grep the ir clogs for hints once I get some nom 20:04
masak .oO( let's just hope people haven't said DESTROY DESTROY DESTROY too much in the ir clogs ) 20:07
moritz or maybe DESTROYALL 20:10
dalek Iish: a5f4ae0 | moritz++ | t/10-mysql.t:
fix mysql tests
20:12
Iish: 9b33943 | moritz++ | lib/DBDish/SQLite.pm6:
[SQlite] use explicit memory management for strings. arnsholt++
tadzik moritz: pointer: irclog.perlgeek.de/perl6/2011-12-30#i_4899708 20:13
I seem to recall making it work somehow, at least I remember it was virtually impossible to test 20:14
arnsholt Yeah, that's one of those really hard to test things, isn't it. Maybe the Parrot folks have some ideas on how to test it 20:15
moritz tadzik: well, the proper thing to do is to call a method DESTROYALL, which walks all classes and then calls DESTROY on each it if exists 20:16
tadzik yeah
moritz tadzik: but, that will make *all* object destructions slower
and we destory a lot of objects
moritz so I think a better option is to set a flag in the class if there is at least one DESTROY method 20:17
and only then call DESTROYALL
so that needs some more C hacking 20:18
jnthn It ain't gonna work without more changes than that to Parrot's GC.
jnthn Imagine we have two objects A and B, where A -ref-> B. 20:19
jnthn There's no promise that A's DESTROYALL will be called before B's. 20:19
Which isn't in itself an issue apart from there's no "call a finalizer" vs "free memory" distinction right now either. 20:20
So any solution that says "oh, we just hook the destory v-table method" means you're going to start writing code that can potentially reach into freed memory. 20:21
masak doesn't the Perl 5 runtime have the same set of issues? 20:23
jnthn I'm not saying it's an intractable problem, just that Parrot afaict doesn't tract it at the moment. 20:28
moritz masak: not as much 20:34
moritz masak: since structures are refcounted, you only free them if they have no more backreferences 20:38
masak moritz: unless it's time to shut down the program, at which point all the things, including things with cycles, get out of the pool. 20:39
moritz ah, the mythical Global Destruction 20:44
eval: use 5.010; sub DESTROY { say "destroying" }; my $x = bless []; push @$x, $x; $x = undef; say "not yet" 20:45
buubot_backup moritz: not yet 1destroying
PerlJam if you free your structures and they come back to you, it must be love^Wrefcounting
dalek Iish: 4a8d025 | moritz++ | lib/DBDish/SQLite.pm6:
[SQLite] collect and finish off statement handles in the connection class
21:10
jnthn moritz: Do we now have a pretty much working SQLite driver? :) 21:11
moritz jnthn: yes 21:13
jnthn \o/
moritz++ arnsholt++
moritz arnsholt++ did most of the hard work :-)
jnthn Wow. The code looks nice. :) 21:16
It's pretty cool that we can write a SQLite driver in pure Perl 6 in ~250 lines :) 21:17
jnthn is curious why some of the calls get { * } and some of them get { ... } even though it doesn't matter. 21:17
moritz jnthn: it's quite simple: some were written after our discussion at the hackathon :-) 21:18
fwiw, 40 of these lines are pretty generic, and should be factored out in DBDish::ConnectionHandle 21:19
jnthn Even better :)
moritz and it misses about 10 lines for column_names, which is currently NYI 21:20
dalek Iish: 2534dea | moritz++ | t/99-common.pl6:
[t] compare more numbers by number.

Now all tests pass for SQLite
21:21
moritz ok, 11 lines :-) 21:26
moritz but my patch causes or exposes another problem 21:26
dalek Iish/sqlite-column_names: ce8eda8 | moritz++ | lib/DBDish/SQLite.pm6:
[SQLite] implement column_names
21:27
p/toqast: aba8043 | jnthn++ | src/QAST/Node.nqp:
Slots for slurpy and named.
21:28
p/toqast: 9191efb | jnthn++ | src/QAST/Compiler.nqp:
Start to get support for local parameters in place, including natively typed ones.
p/toqast: 85b021d | jnthn++ | t/qast/qast.t:
A couple of tests for local parameters.
moritz sqlite++ # being stricter than other DBs, thus uncovering some mistakes in the tests 21:31
moritz it's weird, I've always thought of sqlite as being quite lax, because it has only integers and varchars and somehow manages to wiggle through with that 21:32
moritz but the C API has helped me discover several small inconsistencies in the tests 21:32
dalek Iish: ce8eda8 | moritz++ | lib/DBDish/SQLite.pm6:
[SQLite] implement column_names
21:37
Iish: 46bff63 | moritz++ | t/99-common.pl6:
commit fetchrow_arrayref tests
Iish: 4abaacc | moritz++ | t/10-mysql.t:
[mysql] fix last failing tests. All tests pass now \o/
moritz and with that, all tests pass.
time for sleeping here :-)
jnthn \o/
sleep well :)
moritz thanks
tomorrow: add DBIish to ecosystem
dalek blets: dbb68e9 | (Herbert Breunung)++ | docs/appendix-g-glossary.txt:
explain camelia and polish file handle
22:49
sorear good * #epr6l 23:37
colomon good question 23:43
sorear colomon: what question? 23:44
colomon oh, whoops. must have been backlogged and not realize it.
jnthn is curious why some of the calls get { * } and some of them get { ... } even though it doesn't matter.
^ that question. 23:45
in github.com/perl6/DBIish/blob/maste...SQLite.pm6
I was just wondering if we could implement the same thing in Niecza using a .NET interface to SQL...
sorear: how are you doing? 23:47
sorear good
tuit infusion occured 23:48
colomon \o/
sorear I should be able to at least deal with the email backlog
colomon I suffered a tuit free day, except that part of the day required me to get some music processed, so I did a bit of incidental work on ABC.
colomon is listening to a very tired three year old sing "Casey Jones" on the monitor. :) 23:51