»ö« 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.
00:02 mj41 left
skids r: my @permuted = [^5], { [ (1,3,2,4,0)[$_[]] ] } ... *[0] == 4; @permuted.perl.say; # my most interesting use of ... so far. 00:02
p6eval rakudo c8de2e: OUTPUT«Array.new([0, 1, 2, 3, 4], [1, 3, 2, 4, 0], [3, 4, 2, 0, 1], [4, 0, 2, 1, 3])␤»
00:10 jeffreykegler joined 00:16 gattschardo left 00:24 mj41 joined 00:29 jeffreykegler left 00:55 cognominal left 00:58 cognominal joined, nuba left 01:00 nuba joined 01:04 cognominal_ joined, erkan left, cognominal left 01:09 cognominal_ left 01:17 anuby joined 01:28 hypolin joined 01:36 raiph joined 01:49 MayDaniel left
Abcxyz r: my $t; $_ > 5 && last or 11 % $_ or $t = 1 and last for 1..20 01:55
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Undeclared routine:␤ or used at line 1␤␤»
Abcxyz What is wrong with this?
I can see no grammar errors from this line... 01:56
raiph o/ Abcxyz 02:12
02:13 dayangkun joined
sorear wonders if Abcxyz is diakopter 02:18
n: my $t; $_ > 5 && last or 11 % $_ or $t = 1 and last for 1..20
p6eval niecza v24-12-g8e50362: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'or' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1443 (die @ 5) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) ␤ at /home/…
raiph nr: my $t; ($_ > 5) && last or 11 % $_ or $t = 1 and last for 1..20 02:19
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Undeclared routine:␤ or used at line 1␤␤»
..niecza v24-12-g8e50362: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'or' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1443 (die @ 5) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) ␤ at /home/…
raiph nr: my $t; ($_ > 5 && last) or 11 % $_ or $t = 1 and last for 1..20
p6eval rakudo c8de2e, niecza v24-12-g8e50362: ( no output )
sorear Abcxyz: it's not a grammar error. it's an undeclared routine error
Abcxyz OK 02:23
But or is not routine
Should be a bug, right?
BTW, I am not diakopter
02:25 thou_ left
Abcxyz r: my @s = qw/ 123 456 789 /; say @s.join.comb 02:28
p6eval rakudo c8de2e: OUTPUT«1 2 3 4 5 6 7 8 9␤»
Abcxyz r: my @s = qw/ 123 456 789 /; say @s.join.split: ''
p6eval rakudo c8de2e: OUTPUT«1 2 3 4 5 6 7 8 9␤»
Abcxyz r: my @s = qw/ 123 456 789 /; say split '', join @s
p6eval rakudo c8de2e: OUTPUT«Nil␤»
Abcxyz What's the difference from " @s.join.split: '' ", and " split '', join @s "? 02:29
sorear Abcxyz: "last" takes an optional argument. last or ... parses as last(or(...)) 02:31
raiph r: say <a b>.join.split ' '; say split ' ', join <a b>
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/0rJEQTnm36:1␤------> say <a b>.join.split ⏏' '; say split ' ', join <a b>␤ expecting any of:␤ method arguments␤ postfix␤ infix or meta-infix␤ infix stopper␤ …
Abcxyz r: say <a b>.join.split ' '; 02:32
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/WGVxACWq10:1␤------> say <a b>.join.split ⏏' ';␤ expecting any of:␤ method arguments␤ postfix␤ infix or meta-infix␤ infix stopper␤ statement end␤ …
Abcxyz r: say <a b>.join.split: ' ';
p6eval rakudo c8de2e: OUTPUT«ab␤»
Abcxyz r: say split ' ', join <a b>
p6eval rakudo c8de2e: OUTPUT«␤»
raiph Abcxyz: did u see my recent reply on perlmonks re euler? 02:34
Abcxyz: if you wish you can do private evals: /msg p6eval r: say Whatever 02:35
Abcxyz r: my $t; $_ > 5 && last() or 11 % $_ or $t = 1 and last for 1..20 02:40
p6eval rakudo c8de2e: ( no output )
Abcxyz r: my $t; $_ > 5 && last or 11 % $_ or $t = 1 and last for 1..20
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Undeclared routine:␤ or used at line 1␤␤»
diakopter sorear: lol
Abcxyz raiph: I've seen it. 02:46
Thanks.
Nice and succinct solution!
[Coke] sorear: (length vs. chars) argh. And I had already fixed that in 4 other places! Thank you. 02:50
02:56 hash_table joined
Abcxyz is heredoc working in Rakudo? 03:02
sorear I thin so 03:04
Abcxyz OK, then it is my own problem. 03:05
I couldn't make it work in my script, it always reports the next variable not to be declared. 03:06
[Coke] gets close on t2, but the damn thing is hanging. 03:19
03:22 anuby left, anuby joined 03:37 FROGGS_ left 03:38 FROGGS_ joined 03:40 Chillance left 03:41 bowtie left, tcpr1347 left 03:42 tcpr1347 joined 03:49 FROGGS_ left, FROGGS_ joined
[Coke] r: my %l; %l<5><32>.elems.say; # why is this 1 and not 0? 03:50
p6eval rakudo c8de2e: OUTPUT«1␤»
[Coke] n: my %l; %l<5><32>.elems.say; 03:52
p6eval niecza v24-12-g8e50362: OUTPUT«1␤» 03:53
lue r: my %l; say %l.perl; say %l<5>.perl; say %l<32>.perl;
p6eval rakudo c8de2e: OUTPUT«().hash␤Any␤Any␤»
lue r: my %l; say %l.perl; say %l<5>.perl; say %l<5><32>.perl;
p6eval rakudo c8de2e: OUTPUT«().hash␤Any␤Any␤»
03:54 tcpr1347 left
Abcxyz [Coke]: I think you should use %l.elems instead 03:57
[Coke]: %l<1>.elems is a scalar container, I guess.
I think the hash value should always be a scalar container, which contains "refs" to other objects. 04:01
04:04 Tabrenus joined
[Coke] r: my %l; my @a = %l<5><32>; say @a.elems; 04:13
p6eval rakudo c8de2e: OUTPUT«1␤»
04:13 mikemol left 04:20 mikemol joined 04:23 am0c joined
Abcxyz [Coke]: r: Nil.elems 04:24
r: Nil.elems
p6eval rakudo c8de2e: ( no output )
Abcxyz r: say Nil.elems
p6eval rakudo c8de2e: OUTPUT«0␤»
Abcxyz r: say Any.elems
p6eval rakudo c8de2e: OUTPUT«1␤»
Abcxyz r: my %h; say %h<2 3 4>.elems 04:25
p6eval rakudo c8de2e: OUTPUT«3␤»
Abcxyz Hash always give the required number of elements.
Just that you are receiving 3 elements of undef here. 04:26
each element is represented by an Any object
which has count of 1, but is undef, and in Boolean context, evaluates to False. 04:27
Only Nil will give you zero element count, because Nil represents an empty list.
While Any represents a scalar, being undef, it is still a scalar 04:28
[Coke] makes the autoviv less than useful.
Abcxyz and it is counted as one element. 04:29
Why?
It is not autovivified, is it?
04:30 Guest1875 joined
Guest1875 haiii 04:31
04:31 Guest1875 is now known as barbie_kaneyo
barbie_kaneyo helloww 04:31
04:32 barbie_kaneyo left
[Coke] r: my %l; @(%l<5><32>).elems.say; # this also autovivs to a single element list of Any. 04:33
p6eval rakudo c8de2e: OUTPUT«1␤»
raiph goodnight all 04:39
Abcxyz Good night
04:39 raiph left
Abcxyz But Any means undef in Perl6 04:40
Is this still considered as autovivification?
04:46 kaleem joined 04:47 kaleem left
[Coke] (I misspoke, not a 1 elem list, but Any.elems == 1) 04:51
04:52 thou joined
Abcxyz %l.elems still equals 0 04:52
Any.elems == 1 is always true 04:53
04:54 kaleem_ joined, xilo_ left 04:57 hash_table left 05:09 Abcxyz left 05:12 am0c left, cognominal joined 05:25 cognominal_ joined 05:26 cognominal left 05:30 kaleem joined 05:32 kaleem_ left 05:47 kaleem left 05:48 kaleem joined 05:54 kaleem left, kaleem joined, kaleem left, kaleem joined 05:57 Tabrenus left 06:09 arlinius left 06:23 lolage left 06:29 birdwindupbird joined
[Coke] rakudo's .lines doesn't seem to be very lazy. (takes 18s to get to the die in "for $fh.lines -> $line { die "done" }" where $fh is a file with 235886 lines. 06:32
diakopter ... 06:33
[Coke] ***
diakopter what has that many l~nes 06:34
perl6 cant handle substantial input yet 06:35
[Coke] Hacking on p6cc2012
diakopter I'll haiku you 06:36
[Coke] if I keep the lexicon down to about 2500 words, it's not horrible. 06:39
... aaahhha, just found a great lexicon. 06:43
06:43 SamuraiJack joined 06:44 quester joined 06:50 Khisanth joined 06:57 quester left 06:59 noggle left 07:00 noggle joined 07:11 xinming left 07:16 cognominal joined, cognominal_ left 07:38 xinming joined
[Coke] rn: say so "soüth" ~~ /:m 'south' /; 07:41
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Unrecognized regex modifier :m␤at /tmp/pZGoLiUtru:1␤------> say so "soüth" ~~ /:m⏏ 'south' /;␤»
..niecza v24-12-g8e50362: OUTPUT«===SORRY!===␤␤Action method mod_internal:sym<:m> not yet implemented at /tmp/QefPPJlpt3 line 1:␤------> say so "soüth" ~~ /:m⏏ 'south' /;␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.settin…
[Coke] that's a bummer. :( 07:44
07:45 skids left, Woodi joined
[Coke] dissolve groundwork cramp / transfer hairy taboo span / schoolyard leopard charge 07:53
\o/
I need the :m for my cool lexicon to work, I'll make that a stretch goal.
08:04 mj41 left 08:05 cognominal left 08:07 cognominal joined, kaare_ joined 08:12 azawawi joined
azawawi hi 08:12
sorear: ping 08:13
phenny: tell sorear im trying to integrate farabi web-based REPL with Niecza.exe. Please see code... somehow im not getting it right. Rakudo worked like a charm. paste.debian.net/218732/ 08:15
phenny azawawi: I'll pass that on when sorear is around.
08:24 mj41 joined
sorear azawawi: do you realize that rakudo and niecza use different terminal input libraries? 08:28
phenny sorear: 08:15Z <azawawi> tell sorear im trying to integrate farabi web-based REPL with Niecza.exe. Please see code... somehow im not getting it right. Rakudo worked like a charm. paste.debian.net/218732/
08:28 GlitchMr joined 08:30 GlitchMr left, GlitchMr joined
sorear azawawi: sorry, that was unnecessarily harsh. what I meant is that this is not a bug and I lack the time/energy to help you 08:30
08:30 mj41 left, mj41 joined 08:31 GlitchMr left, GlitchMr joined
azawawi sorear: no problem 08:31
sorear: :) 08:32
sorear: im basically sending output through IPC::Run and reading it back 08:34
sorear: i'll check it more and report back. thx
sorear I need a new weekend project. $work is so much more fun than doing anything with niecza 08:36
azawawi feather.perl6.nl:3030/ # Farabi 0.21 released... Refactored, Better REPL and stability 08:40
Woodi sorear: niecza refactor time come :) for Rakudo it help a lot...
azawawi metacpan.org/source/AZAWAWI/Farabi-0.21/Changes # Changes 08:41
sorear Woodi: I would like very much to never touch programming languages again 08:42
azawawi then play games :)
it helps
Woodi it destroys too, watch my programming skills :)
08:43 mj41 left
au there are also programming games, such as SpaceChem :) 08:43
sorear o/ au
au \o
Woodi hallo au 08:44
au greetings
sorear au: should I come to yapcna?
au good question 08:45
June 3-7 is a bit far to plan for me
Woodi sorear: I have colegue I wanted to bring to YAPC::EU once (to capture him into p6 world :) ) he is good programmer but finished pragmatist too... I couldn't convince him to future-be-great-Perl6 :) becouse he thinked .Net is good enought... sometimes you just want to shoot that be-right-pragmatists :) 08:49
anyway, I hear in North America are just two kinds of apples - red and green... But someone tell me it's not true :) 08:52
08:58 LlamaRider joined 09:00 GlitchMr left 09:07 sbox joined 09:11 GlitchMr joined
sorear We used to have rainbow striped apples but now they're all black and white. 09:13
09:22 mj41 joined 09:24 rindolf joined 09:26 noggle_ joined 09:29 noggle left 09:37 arkydo joined 09:43 arkydo left 09:44 Patterner left
Woodi I think winter is here 09:46
09:46 Psyche^ joined, Psyche^ is now known as Patterner 09:51 rindolf left 09:55 azawawi left 09:57 rindolf joined 10:01 hypolin left 10:03 anuby left 10:06 dayangkun left 10:10 LlamaRider left 10:12 MayDaniel joined 10:36 FROGGS_ left, FROGGS_ joined 10:38 spider-mario joined
dalek ecs: 77f6462 | moritz++ | S32-setting-library/Containers.pod:
[S32] spec uniq
10:47
10:50 GlitchMr left 10:58 jerome joined 11:08 GlitchMr joined 11:09 FROGGS_ left, FROGGS_ joined 11:16 kaleem left 11:30 noggle_ left, noggle joined 11:32 rummik left 11:33 rummik joined 11:35 mj41 left 11:37 sbox left 11:44 mj41 joined 12:17 att__ left 12:18 PacoAir joined, att__ joined 12:41 hash_table joined 12:49 cognominal left, cognominal joined 13:07 Kharec joined 13:19 SamuraiJack left 13:23 noggle left 13:27 noggle joined 13:32 geekosaur joined 13:36 geekosaur left 13:37 geekosaur joined
masak hola, #perl6 13:40
allow me to project a bit of love and warmth from the masak household. Merry Christmas, people. 13:41
13:44 Chillance joined 13:46 mj41 left 13:57 bbkr joined
moritz merry Christmas from the moritz.families housholds too :-) 13:57
14:00 cognominal left 14:01 cognominal joined 14:06 mj41 joined
masak moritz.families>>.households :) 14:07
er, moritz.families>>.household, I mean.
14:09 Chillance left 14:15 mj41 left 14:17 pmurias joined 14:23 hash_table left 14:24 pmurias left
mikemol So, someone referred me to this list yesterday: www.cs.yale.edu/quotes.html 14:24
Here's something for the perl 6 folks to ponder: #59: In English every word can be verbed. Would that it were so in our programming languages. 14:25
I'm not even certain what that means in a programming context, but I expect there are people in here who will enjoy playing with the notion. :) 14:26
14:29 rurban joined, rurban is now known as rurban_, mj41 joined 14:31 rurban_ left 14:32 rurban joined 14:37 GlitchMr left 14:40 lolage joined
masak "verbing" in programming would correspond to making it into something callable. 14:41
cognominal mikemol: verbing names and changing the grammatical category of words is a recurrent theme in #perl6
Deep thought about world gramatical category is everywhere in Perl 6. See A04 "In the first place, as a quasi-linguist, I loathe the keywords switch and case. I would prefer keywords that read better in English. Much as I love verbing nouns, they don't work as well as real verbs or real prepositions when topicalizers are called for. After thrashing over several options with Damian and other folks, we've settled on using given instea 14:43
d of switch, and when instead of case"
s/world/word 14:44
mikemol cognominal: "Deep thought about world gramatical category is everywhere in Perl 6." I know. It goes with the mindset of you guys. Which is why I dropped that quote in here. 14:45
cognominal :)
mikemol Started reading the spec a while back, got interrupted by life. :)
cognominal Apocalypses are historical, but I quoted them to show that this kind of tought is nothing new in Larry's mind. 14:47
mikemol Oh, I'm _certain_ it's nothing new in his mind; he's got the linguist bug more than any other technically-apt person I know.
I'm just amazed he doesn't pun more. :) 14:48
cognominal that's why we all love Perl; and some programmers don't because they seem to forget about their skills because their mind is shaped by computer languages which have been constrained by physical limits that are becoming irrelevant today. 14:51
14:57 stopbit joined, azawawi joined
azawawi hi 14:57
feather.perl6.nl:3030/ # Farabi now has editor tabs.. new and open file works :) 14:58
masak azawawi++
azawawi perl6 REPL works also 14:59
just dont press enter :)
masak who would ever press Enter in a REPL... oh. 15:00
:P
azawawi i have simplified it a lot... ALT-A opens the action menu... which lists all the actions that work with farabi
feedback is welcome 15:02
15:04 mj41 left
timotimo when i press enter in the repl, it works. what am i doing wrong? 15:05
azawawi works sometimes... not all the time 15:06
basically it is a shared REPL process at the moment
no session
once i add a persistent configuration store, things will start to show up... persistent editor session, options, ...etc 15:07
masak nice.
what's it like building a web application such as this?
azawawi fun 15:08
at first i was like im gonna to write a lot of javascript to get this done
but then i started researching here and there
15:08 mj41 joined
azawawi farabi6 was an interesting experiment (Farabi JS on Perl 6 backend) 15:09
i learned a lot from it and moved stuff back into Farabi (Perl backend)
im going to cut on dependencies though 15:10
if you have Perl::Tidy, then Farabi will enable that feature
if you have perl6, ... same
timotimo hm, how good is padre for perl6 by now?
hoelzro tries to figure out how he's differentiate $a / $b vs / regex / and $a < $b vs < words > 15:11
timotimo does it integrate the debugger for instance?
azawawi nop
btw... padre::plugin::perl6 is my work :)
timotimo is padre the kind of ide that would integrate a debugger?
azawawi it has a nice perl debug interface but that's for perl not perl 6 15:12
timotimo i see. maybe there will be something compatible one day :) 15:13
azawawi jnthn previously suggested adding a web API for perl6-debug... once that's there, i will be more than happy to integrate it.
timotimo i should check out padre and tell you how much i like it :)
gotta run now, though
hoelzro hang on...do regexes in Perl 6 *have* to begin with m? (as in m/.../) 15:16
masak no.
hoelzro damn.
masak if they do, they're executed in-place.
if they don't, they're regex objects. 15:17
masak just had a need for a .join which inserts separators outside of the elements, too, like this: |e|e|e|
masak defined a local sub outerjoin for this :)
cognominal there is a need for a method join($inner, $before = $inner, $after = $inner) { … } 15:19
masak nah :) 15:21
it's important to provide the right primitives for a language. it's also important to know when to stop.
Patterner the PHP-Effect? 15:22
masak PHP suffers more from lack of "provide the right primitives" than from lack of "know when to stop", if you ask me. 15:23
to the extent that PHP suffers, that is :)
Patterner there are so many primitives, pure statictics makes it unlikely that all of them are wrong :) 15:25
masak if only that were true. 15:26
this may interest some people on-channel: cstheory.stackexchange.com/question...e-automata 15:27
r: enum Day <Sun Mon Tue Wed Thu Fri Sat>; say Day(3) 15:30
p6eval rakudo c8de2e: OUTPUT«Wed␤»
masak \o/
15:33 stevan_ left, azawawi left 15:34 stevan_ joined
masak 28 people have signed up for p6cc2012! still a few days left before registration closes. 15:41
I wonder if there's anything I can do to make more people sign up. would be nice to break last year's record of 35 signups. 15:42
15:45 FROGGS_ left, FROGGS_ joined 15:46 mj41 left 15:49 cognominal left 15:50 cognominal joined 15:55 cognominal left 15:56 cognominal joined 15:59 stevan_ left 16:07 stevan_ joined 16:10 stevan_ left 16:17 Kharec left 16:18 GlitchMr joined 16:28 Celelibi left, kaare__ joined 16:30 kaare_ left, kaare_ joined 16:33 kaare__ left 16:34 jaldhar left 16:35 Celelibi joined 16:44 jaldhar joined 16:50 Tabrenus joined 17:00 jaldhar left 17:01 jaldhar joined 17:09 fgomez left 17:10 fgomez joined 17:11 stevan_ joined 17:13 SamuraiJack joined 17:15 birdwindupbird left 17:30 lorn left 17:31 nyuszika7h left 17:34 rummik left 17:35 kaare_ left 17:37 nyuszika7h joined 17:39 Tabrenus left 17:40 rummik joined, lorn joined 17:45 cognominal_ joined 17:46 cognominal left 17:49 jaldhar left 17:53 cognominal__ joined 17:54 cognominal_ left 17:59 cognominal__ left 18:00 jaldhar joined 18:06 SamuraiJack left 18:09 cognominal__ joined 18:17 popl joined 18:22 cognominal__ left 18:23 cognominal__ joined 18:28 cognominal__ left 18:34 cognominal joined 18:36 fgomez left 18:38 fgomez joined
pmichaud good morning, #perl6 18:40
18:41 kaleem joined
pmichaud actually, good afternoon I guess 18:41
masak pmichaud! \o/ 18:42
ggoebel o/ 18:44
pmichaud glad to see we all survived the mayan apocalypse. I wasn't sure I'd make it through... :-) :-) (long story, not for web publication) 18:47
oh, I'm being called for lunch, will bbl 18:48
masak glad to hear you made it through too, then.
18:48 cognominal left
popl If I see one more joke about the apocalypse... 18:48
masak popl: ...you might decide to trigger it, a few days late? 18:49
18:49 kaleem left 18:50 cognominal joined
popl IÄ! IÄ! CTHULHU FTHAGN! PH'NGLUI MGLW'NAFH CTHULHU R'LYEH WGAH-NAHL FHTAGN! 18:53
:( 18:55
It didn't work.
18:55 cognominal left
masak popl: www.youtube.com/watch?v=FnbYcB9ctu8 :) 18:56
popl haha 18:58
that's awesome
19:01 GlitchMr left 19:04 cognominal joined 19:11 cognominal left 19:19 cognominal joined 19:33 Pleiades` left 19:39 abcxyz joined
abcxyz r: substr '1234567890', 0, -50 19:42
p6eval rakudo c8de2e: OUTPUT«Length argument to substr out of range. Is: -50, should be in 0..Inf; use *-50 if you want to index relative to the end␤current instr.: 'throw' pc 329649 (src/gen/CORE.setting.pir:147534) (src/gen/CORE.setting:9196)␤called from Sub 'sink' pc 358851 (src/gen/CORE.se…
19:42 Pleiades` joined, cognominal left
FROGGS_ good evening 19:45
abcxyz Is there any way to let substr return an empty string with: " r: say substr '1234567890', 0, *-50 " without using conditional?
Good evening.
Since I am translating my working Perl5 code. And I needed to do this because I do not know the length of the input string: I want it to be truncated to empty string if it is too short. 19:46
r: say substr '1234567890', 0, *-5
p6eval rakudo c8de2e: OUTPUT«12345␤»
abcxyz r: say substr '1234567890', 0, *-50
p6eval rakudo c8de2e: OUTPUT«Length argument to substr out of range. Is: -40, should be in 0..Inf; use *-40 if you want to index relative to the end␤ in method gist at src/gen/CORE.setting:10337␤ in sub say at src/gen/CORE.setting:7514␤ in block at /tmp/KV8rN9R9aH:1␤␤»
19:49 cognominal joined 19:56 popl left
sorear good * #perl6 19:57
20:00 _jaldhar joined 20:01 jaldhar left
masak sorear! \o/ 20:02
sorear masak! \o/ 20:09
abcxyz I figured it out! 20:10
r: say substr '1234567890', 0, 0 max *-50
p6eval rakudo c8de2e: OUTPUT«␤»
20:12 FROGGS joined
FROGGS hi there 20:16
20:18 aindilis left 20:20 aindilis joined
sorear hi FROGGS. 20:22
FROGGS hi sorear 20:23
20:25 Pleiades` left 20:27 Pleiades` joined 20:45 cognominal left 20:46 cognominal joined 20:48 Pleiades` left 20:54 Pleiades` joined
masak abcxyz: nice! 20:54
r: say 0 max *-50 20:57
p6eval rakudo c8de2e: OUTPUT«0␤»
masak abcxyz: though you might have a precedence problem...
hm, no. that should work out right. infix:<-> binds tighter. 20:58
r: say 0 > *-50; say 0 < *-50
p6eval rakudo c8de2e: OUTPUT«WhateverCode.new()␤WhateverCode.new()␤»
abcxyz yeah
max is very low precedence
masak loose precedence, yes :)
hm, is there something wrong with infix:<max> and the whatever star? 20:59
abcxyz I am thinking about reinplementing the perl5 style substr myself. It seems to be simple.
Just add: multi substr(Str $s, Int $pos where { $pos < 0 }){ $s.substr(0 max *-$pos) }
Something like this.
It will wrap the negative indice and polish them into what Perl6 expects. 21:00
masak aye. 21:01
that's definitely playing by the rulebook.
21:01 flussence joined
abcxyz What do you mean by "playing by the rulebook"? 21:01
Sorry, my English needs to be improved...
masak in that it's not a horrible solution that breaks good practices in any way. 21:02
although I guess it could be argued that you force the reader to familiarize themselves with your version of substr before understanding your code...
abcxyz Ah, yeah.
That's just for fun. 21:03
masak if the dimension optimized for is "fun", rather than "maintainability", then I don't see the harm. 21:04
go forth and multi.
abcxyz :) 21:05
for readability AND fun, we can do this: 21:06
sub-str(Str $s, Int $pos where { $pos < 0 }){ $s.substr(0 max *-$pos) }
sub_MINUS_str 21:07
masak :)
abcxyz I am still think about yesterday's 1..10 problem. 21:17
What if you do a simple forward tracking after '1.', to make sure it is a single '.' or a double '..'? 21:18
21:23 cognominal left
masak you could do that. 21:24
but that would insert an exception into the parser.
which maybe doesn't sound so bad until you realize that that parser is simply a Perl 6 grammar. it literally runs on rules, not exceptions.
it's not that it isn't possible. it's that it would hurt future extensibility. 21:25
and for what? for being able to write numbers like '1.'
the cost outweighs the benefit.
abcxyz I see. 21:26
That's a design decision.
masak aye.
abcxyz But I am think about a new feature. 21:27
Called "forgiveness"
Since one difference between computer language and human language
is that computer can understand things when they are grammatically correct, as human do; 21:28
rindolf Hi all.
abcxyz but when the input is not grammatically correct, computer has to complain and pass the error message for human to treat it. 21:29
While human being are just more forgiving, and can still go on and understand the sentence, as long as there is no severe ambiguity.
To implement the feature of "forgiveness", 21:31
moritz forgiveness or magic is very dangerous
becaues it usually comes back to byte you in some way or another 21:32
abcxyz Please let me express my idea first.
the first layer is the same: just define and implement a strict and complete grammar system.
moritz example: perl 5's reverse()
abcxyz Including the afore-mentioned "1.".reject rule.
But right before it generates a error message, the computer can do one more thing. 21:33
timotimo is day24 about to be released?
abcxyz Instead of saying directly: There is no operator defined to be used in this way! This sentence doesn't make sense! 21:34
moritz dunno, PerlJam has claimed the slot
timotimo OK
abcxyz It can say, Umm, let me re-think about it, may be he just simply means "1 .. 10" without puting the spaces in? 21:35
timotimo i've been inspired to try and implement a general multiplayer-capable card game framework, a bit similar to what masak did for his Game::Adventure module and implement a simplish game and AI for it some time ...
abcxyz: and then if someone in some module implements a postfix:<..> or even postfix:<.> operator, the parser will have to interpret the same code in a different way and it will break :( 21:36
abcxyz Then it decides to interpret it this way, and at the same time generates an (optional) warning message: (Although your sentence does not have strictly correct grammar, but Perl6 understands that you are saying: "1 .. 10") 21:37
timotimo: That's why this feature is called forgiveness, and it executes the next layer after the correct grammar parsing. 21:38
timotimo so, you'd get a warning, but it would run. and if you 'use' a module that makes it change its mind you won't get the warning any more 21:39
so because the warning is missing you'll know you've got a different interpretation now?
abcxyz It means that if someone actually implements something like postfix:<.>, then the sentence would be grammatically correct, and the pathway I have mentioned will not be triggered at all. 21:40
This keeps the extensibility of what masak mentions, but it also adds in all the good features of Perl5's heuristics in. 21:41
It's just like an exception list: if the sentence is grammatically incorrect, then catch the exception and treat it this way. 21:42
Microsoft Word corrects our typos in this way also. 21:43
This can make a more high-level, in the sense that it is closer to human-language. 21:44
If the sentence is already grammatically correct, then the exception handling wouldn't be triggered at all, since this is probably what you are intending to do anyway. 21:45
flussence I'd prefer not having to think like microsoft word when reading someone else's code.
timotimo :D
abcxyz Remember, even with the current implementation, yesterday I have shown that defining infix:<< ...^*> >> can change the parsing of the current working code also. 21:46
timotimo oh, that's true.
also, a bit irritating 21:47
i will make sure to always put enough whitespace everywhere i go ...
abcxyz But I consider this definition: infix:<< ...^*> >> as malicious.
It means that a good programmer probably shouldn't do this kind of definition to begin with.
C++ enforces operator overloading only uses the current known operators, that C++'s decision. 21:48
timotimo also, what about simply adding a postfix:<.> to allow numbers to be written as 1.?
abcxyz Perl allows in general any operators, but the user should limit themselves.
timotimo it could even be spec'd, could it not? 21:49
abcxyz i.e. defining certain operators are grammatically legal, but can be considered ethically immoral.
timotimo seems cleaner than to add it as a special case to the grammar
masak abcxyz: if I understand your concept of "forgiveness", it would actually make some new programs compile that didn't before.
abcxyz: as such, it would actually fail to catch some errors the parser caught before.
abcxyz masak: That depends. 21:50
masak I must say I prefer errors to be caught rather than forgiven, in the case of parsing.
now, having said that, the Perl 6 compilers are actually able to keep parsing in some cases where the errors are recoverable.
abcxyz masak: Since the exception list is added by human, you can decide what condition is truly clear, and what are pretty ambiguious and you still pass it on as an error.
timotimo you always say forgiveness > permission :P
masak timotimo: depends on the context, I guess :) 21:51
abcxyz: even if the exception list is added by a human, it hinders future extensibility.
timotimo if there's a nqp-js backend and i want to create javascript for a website to be served by another module, would it be possible to rely on panda to get nqp-js?
masak which was the point of not allowing '1.' in the first place.
timotimo masak: do you think the game state + event mechanism is a good fit for card games? 21:56
masak timotimo: I don't see why not. 21:57
timotimo cool
lue
.oO(when slangs are implemented, you can unstrict the grammar however much you please.)
timotimo and a html websockets based frontend could be done, too
masak lue: "all is fair if you predeclare", yes.
lue: that is, you can implement your own subjective opinion of a good idea, as long as the end user has to 'use'-statement it to get it going. 21:58
timotimo good night! 21:59
lue use SyntaxLike::Python;
timotimo well, good *, really
lue good knight, timotimo o/
masak 'night, #perl6 22:00
lue ♞, masak o/ 22:01
22:26 thou left 22:27 c1sung joined 22:30 am0c joined 23:10 stopbit left 23:18 pmurias joined
pmurias timotimo: nqp-js is not yet a panda package 23:18
abcxyz: giving a warning for compile time things is annoying 23:25
abcxyz: as they force to either fix the situation or live with an annoyance 23:29
s/force/force you
abcxyz: their main benefits is that they can be introduce without breaking backwards compatibility 23:31