»ö« 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! | Rakudo Star Released! Set by diakopter on 6 September 2010. |
|||
Tene | takadonet1: you tried to use a placeholder in a sub with a signature. | 00:03 | |
rakudo: sub foo($n) { say $^a }; foo(5); | |||
p6eval | rakudo a95c1d: OUTPUT«===SORRY!===Placeholder variable cannot override existing signature at line 22, near "; foo(5);"» | ||
Tene | see? | ||
takadonet1 | ... some wha | ||
what* | |||
Tene | takadonet1: placeholders are an *alternative* to using a signature. | 00:04 | |
takadonet1 | well i need a signature in this case | 00:06 | |
well i think so | |||
Tene | Then put the placeholder you're trying to use in the signature instead. | ||
Perhaps we could see the code? | |||
00:06
nymacro joined
|
|||
takadonet1 | Currently it's over two module and about to leave ..... | 00:07 | |
trying to golf it down as we speak | |||
Tene | takadonet1: quick explanation of placeholders: the following two functions are equivalent: sub foo($a, $b) { say $a + $b }; sub bar { say $^a + $^b }; | 00:08 | |
also: sub foo(:$a, :$b) { $a+$b }; sub bar { $:a + $:b } | |||
takadonet1 | ic | 00:09 | |
Tene | so instead of listing a formal signature, you annotate at least the first usage of that variable with a twigil, and all so-marked placeholder variables are aggregated, sorted alphabetically, and used to construct an implicit signature. | ||
This is incompatible with an explicitly-listed signature, as the combination would be non-obvious. | 00:10 | ||
So you're using $^foo or $:foo somewhere in your code, where you don't actually mean to be. | |||
So, search for those twigils | |||
takadonet1 | Tene: thanks for the help | 00:11 | |
sucks that I gtg :( | |||
Tene | takadonet1: np glad to help | ||
00:21
drbean_ is now known as drbean
00:41
ardeshir joined
01:03
obsd123 left,
Trashlord left
01:09
jedai_ joined
01:11
jedai left
01:13
morphbot joined,
morphbot left
01:21
lopnor is now known as lopaway
01:24
nym joined
01:27
nymacro left
01:37
shi left
01:53
obsd123 joined
02:10
drbean left
02:11
drbean joined
02:32
ponbiki left
02:41
lopaway is now known as lopnor
02:43
molaf__ joined
02:45
ponbiki joined
02:46
molaf_ left
02:49
felliott joined
03:00
f00li5h joined
03:05
whiteknight left
03:06
lopnor is now known as lopaway
03:07
lopaway is now known as lopnor
03:19
lopnor is now known as lopaway
03:32
felliott left
03:35
Bonham left
03:36
lamstyle left
03:42
adu joined
03:43
lamstyle joined
03:45
lamstyle left
03:47
adu left
03:49
lopaway is now known as lopnor
03:52
adu joined
03:53
lamstyle joined,
jferrero left
03:54
adu left
03:58
lopnor is now known as lopaway
04:04
lamstyle left
04:06
risou joined
04:10
Chillance left,
cognominal joined
04:11
ardeshir left
04:14
lamstyle joined
04:15
adu joined
04:20
Caffeine joined
04:22
plobsing joined
04:26
adu left
04:29
adu joined
04:33
uasi joined
|
|||
uasi | rakudo: class A::B {}; my $x = "A::B".new; say "alive"; $x.WHAT; | 04:40 | |
p6eval | rakudo a95c1d: OUTPUT«Null PMC access in get_repr() in main program body at line 22:/tmp/FvJxQWrYBc» | ||
uasi | class A {}; my $x = "A".new; $x.WHAT; say "alive"; | ||
rakudo: class A {}; my $x = "A".new; $x.WHAT; say "alive"; | |||
p6eval | rakudo a95c1d: OUTPUT«alive» | ||
Tene | .u ∿ | 04:43 | |
phenny | U+223F SINE WAVE (∿) | ||
TimToady | rakudo: "A".new.WHAT.say | 04:44 | |
p6eval | rakudo a95c1d: OUTPUT«Null PMC access in get_repr() in main program body at line 22:/tmp/fJmPPOils1» | ||
04:45
masonkramer_ joined,
masonkramer left,
masonkramer_ is now known as masonkramer
|
|||
TimToady | rakudo: "Int".new.WHAT.say | 04:46 | |
p6eval | rakudo a95c1d: OUTPUT«Int()» | ||
TimToady | that's just so wrong | ||
uasi | 'nested_or_non-our-scoped_class'.new causes Null PMC access | 04:47 | |
TimToady | it should create a Str | 04:48 | |
uasi | er, _or_nonexistent | ||
uasi nods | |||
TimToady | say "Int".WHAT | 04:49 | |
04:49
orafu left
|
|||
TimToady | rakudo: say "Int".WHAT | 04:49 | |
p6eval | rakudo a95c1d: OUTPUT«Str()» | ||
TimToady | rakudo: say "Int".WHAT.new.WHAT | ||
p6eval | rakudo a95c1d: OUTPUT«Str()» | ||
TimToady | :) | ||
uasi | oh | ||
TimToady | say "Int".bless(*).WHAT | 04:51 | |
rakudo: say "Int".bless(*).WHAT | |||
p6eval | rakudo a95c1d: OUTPUT«Int()» | ||
TimToady | wrong | ||
04:53
orafu joined
|
|||
TimToady | niecza: say "Int".bless(*).WHAT | 04:58 | |
p6eval | niecza 406e042: OUTPUT«Unhandled exception: Unable to resolve method bless in class Str at line 1 (MAIN mainline @ 2) at line 992 (SAFE G1322ANONC @ 1) at line 992 (SAFE module-SAFE @ 29) at line 992 (SAFE mainline @ 1) at line 0 (boot-MAIN @ 1) at line 0 (ExitRunloop @ 0)"mono" | ||
..unexpe… | |||
fith | Should "SomeChars".new.WHAT = Str? | ||
rakudo: "Blah".new.WHAT.say | 04:59 | ||
p6eval | rakudo a95c1d: OUTPUT«Null PMC access in get_repr() in main program body at line 22:/tmp/xkZYycZ9pr» | ||
fith | rakudo: "Int".new.WHAT.say | ||
p6eval | rakudo a95c1d: OUTPUT«Int()» | ||
fith | rakudo: "Str".new.WHAT.say | ||
TimToady | yes, .bless is supposed to only pay attention to the "WHAT" of its invocant | ||
p6eval | rakudo a95c1d: OUTPUT«Str()» | ||
uasi | TimToady: we've discussed 'Foo'.new thing a few days ago, and pmichaud said the problem can be worked around irclog.perlgeek.de/perl6/2010-12-14#i_3086639 | ||
fith | Ah okay, so what's between the ""'s shouldn't matter | ||
TimToady | sure, it can be worked around | ||
new and bless are only supposed to pay attention to the type; it's like asking what the "charge" of a particle is without paying attention to its other attributes | 05:01 | ||
fith | OHH, okay, I see what you mean now. | ||
TimToady | undefined type objects are just charge carriers that don't happen to have actual data | 05:02 | |
05:03
plobsing left
|
|||
uasi | phenny: tell masak 'A::B'.new *is* the bug. see irclog.perlgeek.de/perl6/2010-12-19#i_3103401 | 05:03 | |
phenny | uasi: I'll pass that on when masak is around. | ||
TimToady | seems the fundamental problem is actually in .bless | 05:05 | |
anyway, this is probably parrot's p5ish semantics showing through | 05:06 | ||
(p5 confused class names with strings all the time) | 05:07 | ||
::() is the only thing that knows how to turn a string into a class (without using eval, that is) | 05:08 | ||
05:19
obsd123 left
05:39
ch3ck left
05:50
satyavvd joined
05:53
satyavvd_ joined
05:54
satyavvd left,
satyavvd_ is now known as satyavvd
06:13
Helios left,
Helios joined
06:15
satyavvd left,
Helios left
06:18
Helios joined
06:24
redicaps left
06:57
obsd123 joined,
adu left
07:12
adu joined
07:32
satyavvd joined
07:37
flussence_ joined
07:39
flussence left
07:40
kfo joined
07:43
kfo_ left
07:48
ponbiki left,
ponbiki joined
07:55
satyavvd_ joined,
ponbiki left
07:57
satyavvd_ left
07:59
satyavvd left
08:00
ponbiki joined
08:16
envi joined
08:19
glow joined,
Trashlord joined
08:24
obsd123 left
08:27
jhuni left
08:28
adu left,
ponbiki left
08:35
ponbiki joined
08:43
ponbiki left
08:52
ponbiki joined
09:00
PacoLinux left,
ponbiki left
09:01
justatheory left
09:37
PacoLinux joined
09:44
_kaare joined
|
|||
moritz_ | good morning | 09:49 | |
cotto: which perl are you running? | 09:54 | ||
cotto | moritz_, whatever's default on feather | 09:56 | |
looks like 5.10.1 | 09:57 | ||
09:58
zby_home joined
|
|||
moritz_ | cotto: the default perl in $PATH is one in /usr/local/ | 09:59 | |
so it won't pick up packages installed via apt | 10:00 | ||
moritz_ installs a new Bot::BasicBot with cpanm | |||
10:09
redicaps joined
10:10
redicaps left
10:12
araujo left
10:31
rgrau joined
11:28
envi left
11:32
envi joined
11:33
risou left
11:34
dju joined
11:37
dju left
11:38
dju joined,
dju left,
dju joined
11:43
risou joined
11:45
am0c joined
11:48
am0c_ joined
11:52
am0c left,
MayDaniel joined
11:54
am0c_ left
12:15
MayDaniel left
12:27
neroxx joined
|
|||
uasi | rakudo: {}.hash | 12:40 | |
p6eval | rakudo a95c1d: OUTPUT«Method 'hash' not found for invocant of class '' in main program body at line 22:/tmp/MtYgzAJC02» | ||
Trashlord | what :| | ||
uasi | rakudo: (a => 1).hash.hash | ||
p6eval | rakudo a95c1d: OUTPUT«Method 'hash' not found for invocant of class '' in main program body at line 22:/tmp/9k7cyOL80J» | ||
uasi | rakudo: (a => 1).hash | ||
p6eval | rakudo a95c1d: ( no output ) | ||
uasi | rakudo: (a => 1).hash.WHAT.say | 12:41 | |
p6eval | rakudo a95c1d: OUTPUT«Hash()» | ||
moritz_ | rakudo: say (a => 1).hash.PARROT | ||
p6eval | rakudo a95c1d: OUTPUT«» | ||
moritz_ | ugh. | ||
uasi | :/ | ||
12:41
nero2x joined
12:43
nero__ joined
12:46
neroxx left,
nero2x left
12:47
whiteknight joined
12:51
wamba joined
12:55
jeeger joined
|
|||
jeeger | Greetings! Any tips on a perl6 book? I've finally caved in and installed rakudo^^ | 12:56 | |
tadzik | try The Perl 6 Book :) | ||
perl6.org/documentation/ | |||
moritz_ | github.com/perl6/book/downloads | ||
jeeger | tadzik: That's too easy^^ | 12:57 | |
tadzik | :) | ||
12:57
cognominal left
|
|||
jeeger | Hm, pity that there is no epub version. | 12:58 | |
moritz_ | jeeger: you could make one | 12:59 | |
if I understood correctly, epub is mostly xhtml + meta data | 13:00 | ||
there's already a HTML or xhtml make target | |||
jeeger | Hm, I'll try that | 13:01 | |
13:03
ardeshir joined
13:07
araujo joined
13:12
felliott joined
|
|||
jeeger | Hm, the epub version looks okay, but converting to lrf killed all structure and highlighting. I'll have a look at the epub version on my reader... | 13:22 | |
uasi | Adding a hash() method in src/core/Hash.pm solves the {}.hash problem: gist.github.com/747323 | ||
moritz_ | uasi: can you please send a pull request? | 13:26 | |
uasi | moritz_: sure | 13:27 | |
ardeshir | rakudo: say " "x 9-$_,"#"x$_*2-1 for 0..9,2 xx 3; | 13:29 | |
p6eval | rakudo a95c1d: OUTPUT«  # ### ##### ####### ######### ########### ############# ################################ ### ### ###» | ||
uasi sent | |||
13:31
cognominal joined
|
|||
moritz_ | moritz.faui2k3.org/tmp/using-perl-6.zip my very naive attempt of epub conversion | 13:32 | |
ardeshir | my Int $day = 23; $day = "Monday"; say $day; | 13:35 | |
Ah..type check fails.....nice | 13:37 | ||
is my Any $x == my $x | 13:39 | ||
jeeger | Hm, Perl6 is working towards being a lisp, but it's still a perl. Yay! | ||
moritz_ | jeeger: it tries to be lisp, but with proper syntax and good names :-) | ||
tadzik | :) | ||
ardeshir | rakudo: my Any $day = 23; $day = "sunday"; say $day; | 13:40 | |
p6eval | rakudo a95c1d: OUTPUT«sunday» | ||
tadzik | ardeshir: you can ommit Any | 13:41 | |
rakudo: my $a = 5; $a = "b"; $a.WHAT.say | |||
p6eval | rakudo a95c1d: OUTPUT«Str()» | ||
ardeshir | tadzik: so it is the same as my $x | 13:42 | |
i see | |||
p6 is sexy | 13:43 | ||
tadzik | ardeshir: have you used Perl 5? | ||
ardeshir | yes | ||
but i have not read much of the p6 docs yet, will be doing that before adding any more noise here ;) | 13:45 | ||
jeeger | moritz_: I converted it to epub with calibre ebook-convert, and it looks pretty nice on my reader. | ||
moritz_ | jeeger: I tried it via the calibre GUI (from the html file), and it mangled the code sections | 13:46 | |
ie removed whitespaces | |||
jeeger | moritz_: Hm, I've yet to see a code section. | 13:47 | |
moritz_ | jeeger: scroll down :-) | ||
jeeger | moritz_: Yep, mangled. | ||
hmmm | |||
moritz_: Hm, the html target doesn't output html. That could be the problem. | 13:49 | ||
ah, forget it. Less filtered the tags | |||
moritz_ | it's HTML, but without header (iirc) | ||
jeeger | Hm, reading code on an ereader is not really a good idea | 13:51 | |
ardeshir | from within p6's REPL (./perl6 !argc) can one load a script? | 13:56 | |
14:02
Trashlord left
14:03
Trashlord joined
|
|||
moritz_ | eval slurp 'filename.pl' | 14:07 | |
ardeshir | slurpit... thnx moritz_ | 14:08 | |
jeeger | Aaaaaand we're back on the road to awful, terrible, innuendorific puns. | 14:09 | |
moritz_ | jeeger: that was harmless. Just wait until jnthn has something to say again :-) | 14:10 | |
14:11
shi joined,
felliott left
14:31
am0c joined
14:34
Trashlord left
14:37
timbunce joined
14:40
timbunce left
14:46
jeeger left
14:52
uasi_ joined
14:53
MayDaniel joined
14:54
uasi left
15:06
felliott joined
15:16
shi left
15:32
risou left,
risou joined
15:38
Intensity left
15:39
Patterner left,
rgrau left
15:40
Psyche^ joined,
Psyche^ is now known as Patterner
15:43
PerlJam left,
PerlJam joined
15:44
nym left
15:46
Chillance joined
15:48
skangas joined
15:52
nero__ left
16:04
am0c left
16:15
rhr left
16:18
jeeger joined
16:21
rhr joined
|
|||
dalek | kudo: a82071b | uasi++ | src/core/Hash.pm: Implement Hash.hash Signed-off-by: Moritz Lenz [email@hidden.address] |
16:30 | |
shortcircuit | This channel went on a pun spree, and I missed it? :( | 16:35 | |
16:39
MayDaniel left
16:45
plobsing joined,
masonkramer left,
masonkramer joined
|
|||
moritz_ | wasn't really much punning | 16:47 | |
16:51
tobij is now known as churchill
17:00
sftp left
17:01
sftp joined
17:23
masak joined
|
|||
masak | y0, zebras. | 17:23 | |
phenny | masak: 05:03Z <uasi> tell masak 'A::B'.new *is* the bug. see irclog.perlgeek.de/perl6/2010-12-19#i_3103401 | ||
masak | well, yes and no. | ||
I'm already aware that Str.new shouldn't behave like it does in Rakudo. | 17:24 | ||
17:24
felliott left
|
|||
masak | so... on second thought, maybe this Null PMC access wasn't really worth reporting. | 17:24 | |
(because it'll be fixed once the Str.new security hole is plugged) | |||
tadzik | hey masak | ||
17:24
wamba left
|
|||
masak | hi! \o/ | 17:24 | |
17:31
MayDaniel joined
17:34
justatheory joined
17:37
cschimm1 joined
|
|||
uasi_ | masak: I mean, RT #80958 is missing the point | 17:44 | |
masak | yes. thinking of merging it with the ticket that isn't :) | 17:47 | |
17:47
Trashlord joined,
Util left,
Util joined
|
|||
masak | uasi_: rt.perl.org/rt3/Ticket/Display.html?id=73144 | 17:50 | |
17:50
MayDaniel left
|
|||
masak merges | 17:50 | ||
uasi_ | masak++ | 17:51 | |
17:57
envi left
18:06
ch3ck joined
|
|||
uasi_ | masak: it would be enough just to close #80958, since doing .WHAT doesn't matter | 18:07 | |
masak | true. I could have done that, too. | 18:08 | |
dalek | kudo: 96d7e0d | KodiB++ | src/core/Temporal.pm: [Temporal] Made the seconds part of Instant.Str use a leading 0 like DateTime.Str. Thanks to perl6advent.wordpress.com/2010/12/1...omment-559 for the observation. |
18:09 | |
uasi_ | thinking how I can fix that | 18:15 | |
uasi_ needs parrot-fu | |||
takadonet1 | hey all | 18:26 | |
tadzik | hey | ||
moritz_ | a parrot walks into a bar and says "Null PMC access in Beer" | 18:27 | |
takadonet1 | ... | 18:28 | |
tadzik | the bartender says: I'm shaked, not mixed | ||
or: .WHAT? | 18:30 | ||
18:36
Axius joined
18:42
abhi_ joined
|
|||
abhi_ | hi | 18:42 | |
anyone there | |||
colomon | o/ | ||
moritz_ | oh hai | 18:43 | |
abhi_ | o/ colomon | ||
takadonet1 | abhi_: yo | ||
moritz_ just wondered why booting my laptopt didn't work with the self-built kernel | |||
turned out I forgot ext4 support, and guess what the root file system is... :-) | |||
takadonet1 | hehe | 18:44 | |
colomon | whoops! | ||
abhi_ | newbie to iRC | ||
moritz_ | now building a new kernel, and wishing for more cores | 18:45 | |
abhi_: welcome | |||
abhi_ | thanks moritz | ||
sorry for your laptop thing | 18:46 | ||
moritz_ | no problem, just own stupidity :-) | ||
18:46
risou left
|
|||
abhi_ | you all guys are working on perl 6 | 18:47 | |
tadzik | some on, some in | ||
masak | some merely interested. | ||
moritz_ | some are learning it, some are using it | 18:48 | |
masak | some are lurkers with very persistent sessions ÖP | ||
:P | |||
18:49
shi joined
|
|||
abhi_ | and some r masters!!!!!!!! | 18:49 | |
i have used perl 5 in ma college days | |||
18:50
MayDaniel joined,
flussence_ is now known as flussence
|
|||
abhi_ | how perl 6 is different from perl 5 | 18:50 | |
?? | |||
masak | rakudo: say "like this! :)" | 18:51 | |
p6eval | rakudo 96d7e0: OUTPUT«like this! :)» | ||
masak | rakudo: class A { method foo { say "We have classes built-in" } }; A.new.foo | ||
p6eval | rakudo 96d7e0: OUTPUT«We have classes built-in» | ||
flussence | .oO( I wouldn't doubt a few people here have actually mastered R ) |
||
moritz_ | abhi_: we tried to correct all those errors that perl 5 made | ||
masak | rakudo: say 01234 | 18:52 | |
p6eval | rakudo 96d7e0: OUTPUT«1234» | ||
masak submits rakudobug | |||
moritz_ | std: 01234 | ||
p6eval | std 625303c: OUTPUT«Potential difficulties: Leading 0 does not indicate octal in Perl 6; please use 0o1234 if you mean that at /tmp/qREqji4lGW line 1:------> 01234⏏<EOL>ok 00:01 118m» | ||
flussence | rakudo: say 0o1234 | ||
masak | right. | ||
p6eval | rakudo 96d7e0: OUTPUT«668» | ||
flussence | rakudo: say '0o1234'.Int # works too | ||
moritz_ | masak: it should warn, but the outcome is OK | ||
p6eval | rakudo 96d7e0: OUTPUT«668» | ||
masak | moritz_: nod. | ||
flussence | (is Str.Int just parsing the Str using normal grammar?) | 18:53 | |
moritz_ | flussence: not yet | ||
masak | moritz_: another place where turning off a particular warning with a pragma would be potentially useful. | ||
abhi_ | oh that really cool | ||
let me start playing with perl | 18:54 | ||
moritz_ | abhi_: have you found perl6.org/ already? | ||
abhi_ | yes moritz | 18:55 | |
moritz_ | great | ||
abhi_ | hey moritz those documentation books are enough for exploring or any other useful blogs | 18:57 | |
colomon | planetsix.perlfoundation.org/ | 18:59 | |
abhi_ | thanks colomon | 19:02 | |
19:02
betterworld left,
MayDaniel left
19:03
betterworld joined
|
|||
masak | abhi_: perl6advent.wordpress.com/ | 19:04 | |
colomon | masak: planetsix is carrying perl6advent too. :) | 19:05 | |
masak | yes, but only this year's posts :) | ||
colomon | oh, fair enough. | 19:07 | |
abhi_ | thanks to all that was a great help!! | ||
masak | o/\o | ||
lue | ohai world o/ | 19:09 | |
masak | lue: hi. nice blog post. | 19:12 | |
19:13
molaf__ left
|
|||
lue | thank you. It'll be interesting to look at my pod parser code and laugh in embarrasment today :) | 19:13 | |
masak | I find I laugh in embarrassment over my old code, but less and less. | 19:14 | |
19:14
lamstyle left
|
|||
masak | seems I'm converging on something asymtotically. maybe due to discipline. | 19:14 | |
lue | I'm going to hunt down what 'actions' are and how to use them, in case I might find them useful. | 19:17 | |
masak | mind if I give you the quick tour? | ||
moritz_ | lue: did you read the grammar chapter in the book? | 19:18 | |
abhi_ | i will be back soon with more queries | ||
bye for today | |||
masak | abhi_: we await you with open arms. | ||
colomon | o/ | ||
abhi_ | thanks o/ | 19:19 | |
masak | \o | 19:20 | |
lue | You mean *The Book* ? I honestly have never looked at it, I probably should. | ||
masak | lue: | ||
rakudo: grammar G { regex TOP { ^ abc $ } }; say ?G.parse("abc") | |||
p6eval | rakudo 96d7e0: OUTPUT«Bool::True» | ||
masak | rakudo: grammar G { regex TOP { ^ abc $ } }; class G::Actions { method TOP($/) { say "TOP matched" } }; say ?G.parse("abc", :actions(G::Actions.new)) | ||
p6eval | rakudo 96d7e0: OUTPUT«TOP matchedBool::True» | ||
19:20
Patterner left
19:21
kfg joined,
abhi_ left
|
|||
masak | that should tell you how to plug in an actions object. | 19:21 | |
that's half of the secret of action classes. the other half is the built-in function &make. | |||
19:21
kfg left
|
|||
masak | with which you can adorn the tree of Match objects produced by the grammar. | 19:22 | |
every Match object has an .ast attribute, and calling &make sets it. | |||
rakudo: grammar G { regex TOP { ^ abc $ } }; class G::Actions { method TOP($/) { make "Life, the Universe, and Everything" } }; G.parse("abc", :actions(G::Actions.new)); say $/.ast | 19:23 | ||
p6eval | rakudo 96d7e0: OUTPUT«Life, the Universe, and Everything» | ||
masak | lue: any questions? | ||
19:23
lamstyle joined
|
|||
lue | Why would you want to use actions? I see "accessing the results in an easier fashion" as the answer, but I'm not sure. | 19:27 | |
moritz_ | that's exactly it | 19:28 | |
tadzik | also, it scales well | ||
19:28
hercynium joined
|
|||
tadzik | as the last year advent calendar entry says :) | 19:28 | |
masak | usually, what you want to do when you get the tree of matches from the grammar parse, is to traverse that tree. actions are an easy way to do that *while parsing*, with much of the traversal boilerplate hidden. | 19:29 | |
tadzik | actions are one of the most terrifying things before, and the most amazing once you learn them | ||
s/once/after/ | |||
masak | actions are the natural next stepping stone after one learns grammars. | 19:30 | |
arnsholt | Actions are bloody brilliant | 19:31 | |
=) | |||
lue | [looking at book] Seems like actions are natural for such things as Pod parsers. I think I will most likely use them, after reading up on them. | ||
colomon | actions++ | 19:33 | |
masak | lue: sounds excellent. ask as soon as you have more questions -- so far they've been great. | ||
arnsholt | lue: Actions are a natural thing for parsers =) | ||
lue | It would explain why I thought &parse was a bloody difficult thing to use. colomon++ for his advent post (day 18), for without it I would have only known of actions as a file in rakudo :) | 19:34 | |
colomon | Glad it was useful to you. :) | 19:35 | |
for sure grammars + actions are fantastic. | |||
masak | I think pmichaud mentioned that he invented actions (in Perl 6). | 19:36 | |
colomon | really? I just assumed it was part of the original grammar scheme. | ||
masak | no, I think not. | ||
one nice thing is that one can have several action classes for the same grammar. | |||
depending on the desired backend, for example. | 19:37 | ||
colomon | I've been wondering how well that will work in practice. | ||
masak | time will tell. | ||
colomon | I've noticed that I've tweaked the ABC grammar to make it work better with the actions I am currently writing. | ||
masak | that sounds like a very sane thing to do. | 19:38 | |
colomon | not clear that the tweaks would work properly for a completely different set of actions. | ||
masak | well, the actions are a sort of "client" to the grammar. | ||
colomon | I think it will be very interesting to see where best practices for them lands four or five years from now. | ||
masak | so making the grammar conform to what the action(s) desire is only natural. | ||
of course, with many action classes, there might be competing constraints. | |||
but there likely would have been anyway, due to waterbedding :P | 19:39 | ||
lue | rakudo: Grammar G { regex TOP { ^ <alpha>+ $ } }; class G::Actions { method TOP($/) { make "You said $/" } }; G.parse("hello", :actions(G::Actions.new)); say $/.ast; | 19:43 | |
p6eval | rakudo 96d7e0: OUTPUT«===SORRY!===Confused at line 22, near "Grammar G "» | ||
lue | rakudo: grammar G { regex TOP { ^ <alpha>+ $ } }; class G::Actions { method TOP($/) { make "You said $/" } }; G.parse("hello", :actions(G::Actions.new)); say $/.ast; | ||
masak | small 'g' in 'grammar' | ||
p6eval | rakudo 96d7e0: OUTPUT«You said hello» | ||
lue | I thought so. | 19:44 | |
masak | lue: very good. now answer me this: are actions top-down or bottom-up? | ||
lue | .oO(hm. I would guess, but that's not the point.) based on what I've seen so far, I would guess top-down. |
19:45 | |
flussence | is there a way in rakudo to write a MAIN(Str ~~ any(@command-names)) so that the auto-generated help text lists the @command-names? | ||
tadzik | I'd go for writing my own USAGE | 19:46 | |
masak | lue: they're bottom-up. | ||
lue: smaller rules finish before the bigger rules do. TOP finishes last. | |||
flussence | oh wow, there's a USAGE sub? learning something new every day :) | 19:47 | |
tadzik | :) | ||
the “help text” is the default USAGE sub | |||
lue | I can tell there are some implications to that, but I don't see it. [TOP stomps on smaller rules' asts?] | 19:48 | |
tadzik | lue: the smaller tokens are "make"'d first | 19:49 | |
time for me, see you zebras! | |||
masak | tadzik: \o :) | ||
tadzik | (and I plan to come back with one or 2 Rakudo patches, but shh!) | 19:50 | |
masak | lue: in practice it means that in any given action method, you can see the .ast attributes of all descendent match objects. | ||
lue | o/ tadzik | ||
masak | ++tadzik | ||
tadzik | (if you want write them before) | ||
o/ | |||
lue | aaah. | ||
masak | & | 19:52 | |
colomon | huh | ||
rakudo: my $a = 10; say $a[0] | |||
p6eval | rakudo 96d7e0: OUTPUT«10» | 19:53 | |
colomon | I think I understand why it happens, but I'm not sure if it's a good idea or not... | ||
lue | rakudo: my $a = (1,2); say $a[1] # just checkin' | 19:54 | |
p6eval | rakudo 96d7e0: OUTPUT«2» | ||
19:56
molaf joined
20:00
Psyche^ joined,
Tedd1 left
|
|||
lue | Is look at rakudo's Actions.pm (a good idea|insane) for learning about actions? | 20:01 | |
look*ing* | |||
20:01
Psyche^ is now known as Patterner
|
|||
moritz_ | it's a bit big for that :-) | 20:02 | |
colomon | lue: rakudo's Actions.pm is very complicated. | ||
20:03
jhuni joined
|
|||
lue | So the answer is any(Bool::False, Bool::True) ? [if I remember the output format correctly] | 20:03 | |
20:05
PacoLinux left,
Tedd1 joined
|
|||
colomon | rakudo: say ^1 | 20:06 | |
p6eval | rakudo 96d7e0: OUTPUT«0» | ||
20:07
Axius left
20:09
Eevee left
20:12
glow left
20:18
Eevee joined
|
|||
arnsholt | rouen886 | 20:22 | |
Er, wrong window | |||
20:40
thundergnat joined
|
|||
thundergnat | Good * #perl6 | 20:41 | |
colomon | \o | 20:44 | |
thundergnat | When you have a sort modifier block, is it legal to have a secondary sort term in the modifier block? I vaguely remember seeing code like that somewhere but can't seem to find it anywhere. | 20:50 | |
Or does that even make sense? | |||
colomon | I'm not sure. | ||
thundergnat | for instance, sort by word length with a secondary ASCII sort: my @sorted = @unsorted.sort: { $^a.chars, $^a }; | ||
colomon | ah! | 20:51 | |
I think that's legal in theory but NYI in Rakudo. | |||
thundergnat | I sort of works locally | ||
but it is buggy if it is legal | |||
colomon | sure, if you encode both things to a single thing that cmp works on it will probably work already. | 20:52 | |
flussence | rakudo: <duck cake umbrella cardboard>.sort({ $^a.chars, $^a }).Str.say # now I'm curious | ||
p6eval | rakudo 96d7e0: OUTPUT«cake duck umbrella cardboard» | ||
colomon | I'm trying to remember what the name is of the official type. Ordering, or something like that... | ||
flussence | rakudo: <duck cake umbrella cardboard>.sort(*.chars, *).Str.say # will this work? | 20:53 | |
p6eval | rakudo 96d7e0: OUTPUT«Too many positional parameters passed; got 3 but expected between 1 and 2 in 'Parcel::sort' at line 1395:CORE.setting in main program body at line 22:/tmp/eCzVnSjbDI» | ||
flussence | it'd be nice if that did... | ||
colomon | Ordering, indeed. | ||
thundergnat | it ""works" except it does a string comparison on the word lengths. | ||
so length 10 sorts before length 2 | 20:54 | ||
colomon | still don't know where it's defined in the spec, alas. | ||
thundergnat | colomon: yeah, I couldn't find it either... | ||
colomon | it's definitely NYI in Rakudo. | ||
you can do this the other way, though... | |||
thundergnat | Sigh. That would (will) be so cool... | 20:55 | |
colomon | rakudo: <duck cake umbrella cardboard>.sort({ $^a.chars <=> $^b.chars || $a leg $b }).Str.say | ||
p6eval | rakudo 96d7e0: OUTPUT«cake duck umbrella cardboard» | ||
thundergnat | Since sort is stable, could easily do my @sorted = @unsorted.sort.sort: { $^a.chars }; | 20:56 | |
colomon | Hmmm... you may well be right about that, but I don't see stable in the spec, and I'm not sure I'd trust Rakudo actually have stable sorts yet. And writing out the comparison the long way does work now. | 20:59 | |
rakudo: <duck cake umbrella cardboard>.sort.sort(*.chars).Str.say | 21:00 | ||
p6eval | rakudo 96d7e0: OUTPUT«cake duck umbrella cardboard» | ||
colomon | well, that works. thundergnat++ | ||
flussence | grr... trying to write a MAIN sub so I can do "perl6 ./program commandname", but it's not working: | 21:03 | |
multi sub MAIN(Str $command where { $_ ~~ @commands }) { } | |||
moritz_ | flussence: did you mean: $_ ~~ any @commands ? | 21:04 | |
flussence | probably :) | ||
colomon | moritz_++ | ||
flussence | that's the one... I'd been trying a bunch of different things and that was what I gave up at | 21:05 | |
thundergnat | colomon: according to the perl6 book github.com/perl6/book/blob/master/...asics.pod, perl6 has stable sort, and I am willing to take that as authoritative. | ||
moritz_ is wililng to take the spec as authoritative | 21:07 | ||
colomon is willing to take TimToady as authoritative ;) | 21:09 | ||
21:09
timbunce joined
|
|||
colomon | some days, anyway. | 21:09 | |
thundergnat | heh | ||
flussence | hmm, now it won't fall through to USAGE() when I feed it a non-matching string... | ||
colomon | rakudo: my ($s, $t) = 0.1, 0.2; say $s ~~ (0, 1) && $t ~~ (0, 1) | ||
p6eval | rakudo 96d7e0: OUTPUT«Bool::False» | ||
colomon | precedence? | ||
rakudo: my ($s, $t) = 0.1, 0.2; say ($s ~~ (0, 1)) && ($t ~~ (0, 1)) | 21:10 | ||
p6eval | rakudo 96d7e0: OUTPUT«Bool::False» | ||
masak | er. | ||
colomon | yah, er | ||
masak | are you trying to treat parcels as ranges? | ||
colomon | doh! | ||
masak | why not use ranges instead? :) | ||
colomon | thought I was. | ||
21:11
timbunce left
|
|||
colomon | :| | 21:11 | |
well, that's an easy enough fix, maybe | |||
I wanted the ^..^ op, just spelled it entirely incorrectly. | 21:12 | ||
ah, that's the last piece I needed for p2 | 21:14 | ||
21:15
lamstyle left,
masak left,
sftp left,
zby_home left,
Helios left,
Caffeine left,
sukria left,
HarryS left,
diakopter left,
jjore left,
ruoso left,
moritz_ left,
rbuels left,
takesako left,
avuserow left,
cxreg left,
patch left,
cibs left,
c1sung left,
eternaleye left,
mdxi left,
IRSeekBot left,
charsbr_ left,
sjohnson left,
plobsing left,
PerlJam left,
orafu left,
hudnix left,
awwaiid left,
spinclad left,
Kovensky left,
mux left,
frooh_ left,
rokoteko left,
shortcircuit left,
takadonet left,
ashleydev left,
Sarten-X left,
yahooooo left,
cls_bsd left,
jasonmay left,
mtve left,
TiMBuS left,
wolverian left,
meteorja1 left,
szabgab left,
saaki left,
Lorn left,
Grrrr left,
zostay left,
pjcj left,
broquaint left,
PZt left,
Maddingue left,
jql left,
jrockway left,
Tedd1 left,
wooden left,
starcoder left,
pothos left,
zorgnax left,
slavik1 left,
cosimo left,
robinsmidsrod left,
stepnem left,
horror21 left,
ch3ck left,
Trashlord left,
lestrrat left,
p6eval left,
tylerni7 left,
Juerd left,
fith left,
TimToady left,
flatwhatson left,
szbalint left,
nperez left,
nadim__ left,
Raynes left,
elb0w left,
ingy left,
chitragupt left,
scp1 left,
frodwith left,
pnu left,
JodaZ left,
hcchien left,
bartolin left,
allbery_b left
|
|||
lue | I have a lot of stuff in my code that involves finding what's in the match object, and then one line to do something about it. Think that could be replace with actions? :) | 21:16 | |
colomon | sounds likely. | 21:17 | |
colomon reluctantly decides 2 R%% [+] is just too cutesy | |||
lue waits for the net.join('') :) | 21:18 | ||
arnsholt | What's the %% operator? | ||
flussence | lue: wouldn't that be a net.cat? :P | ||
lue | not in Perl 6 land (unless there is a cat sub) | 21:19 | |
flussence | S32:52... | ||
lue | .oO[ which S32? :) ] | ||
flussence | any()! (ok, containers) | 21:20 | |
21:20
Tedd1 joined,
lamstyle joined,
ch3ck joined,
Trashlord joined,
sftp joined,
plobsing joined,
PerlJam joined,
zby_home joined,
Helios joined,
orafu joined,
Caffeine joined,
fith joined,
hudnix joined,
lestrrat joined,
awwaiid joined,
wooden joined,
p6eval joined,
saaki joined,
starcoder joined,
pothos joined,
sukria joined,
cibs joined,
tylerni7 joined,
elb0w joined,
Lorn joined,
Juerd joined,
zorgnax joined,
spinclad joined,
slavik1 joined,
Kovensky joined,
cosimo joined,
Grrrr joined,
zostay joined,
szbalint joined,
HarryS joined,
TimToady joined,
mux joined,
frooh_ joined,
robinsmidsrod joined,
nperez joined,
shortcircuit joined,
rokoteko joined,
stepnem joined,
takesako joined,
nadim__ joined,
Raynes joined,
takadonet joined,
gibson.freenode.net sets mode: +v p6eval,
charsbr_ joined,
ashleydev joined,
horror21 joined,
ingy joined,
flatwhatson joined,
pjcj joined,
chitragupt joined,
diakopter joined,
scp1 joined,
Sarten-X joined,
broquaint joined,
jjore joined,
PZt joined,
ruoso joined,
yahooooo joined,
hcchien joined,
cls_bsd joined,
jasonmay joined,
frodwith joined,
mtve joined,
pnu joined,
JodaZ joined,
bartolin joined,
allbery_b joined,
TiMBuS joined,
Maddingue joined,
wolverian joined,
moritz_ joined,
jql joined,
jrockway joined,
c1sung joined,
rbuels joined,
meteorja1 joined,
eternaleye joined,
patch joined,
cxreg joined,
avuserow joined,
mdxi joined,
sjohnson joined,
IRSeekBot joined,
szabgab joined
|
|||
colomon | lue: cat is the lazy string type | 21:20 | |
21:20
pothos_ joined
|
|||
colomon | but it's NYI, and mostly Not Yet Spec'd. | 21:20 | |
21:20
pothos left
|
|||
lue | [ ah! the netjoin hath occured! \o/ ] | 21:21 | |
arnsholt | colomon: Re your statement above, it'd be "sum is divisible by two", no? | 21:22 | |
21:22
pothos_ is now known as pothos
|
|||
colomon | arnsholt: yes | 21:22 | |
21:25
soroush joined
21:41
soroush left,
soroush joined
21:46
thundergnat left
|
|||
colomon is getting quite frustrated that his point in loop code isn't working. | 21:50 | ||
jnthn | o/ from Cologne | 21:57 | |
Not quite where I expected to be today but... :) | |||
arnsholt | At least they should have beer =) | 21:59 | |
jnthn | They *do* have beer. | ||
I enjoyed some, before having to come back and try and fix my travel plan up. | 22:00 | ||
In theory, I may make it back to the UK tomorrow. | |||
lue | hi jnthn o/ | ||
jnthn | o/ lue | ||
lue | .oO(must... avoid... puns... [they'd have people hoppin'!]) |
||
flussence | jnthn: getting the train? All the airports here are closed from what I read. | 22:01 | |
22:02
colomon joined
|
|||
jnthn | flussence: Not all :) | 22:10 | |
flussence: No, the train plan was EPIC FAIL. Long story. | |||
flussence: Basically, the whole thing fell apart before I even got out of Sweden. | |||
flussence | ouch. | 22:11 | |
I went on long-distance rail for the first time in years last month, wasn't as bad as I thought it'd be. | 22:12 | ||
jnthn | The incompetence and lack of any organization was disgusting. Seeing people fighting each other to get on the few replacement bus services there were was just sad (one guy looked pretty bad, lying in the freezing snow). | ||
Thankfully, in Denmark they actually have a clue how to make stuff work and treat people. | 22:13 | ||
22:13
aloha joined
|
|||
jnthn | But there was no way to really recover the trip overall. I missed the critical connection I needed to get, and with that missed, the whole lot was screwed. | 22:14 | |
I do a lot of long-distance rail and it usually is very pleasant and works just fine. | |||
22:17
youwin_ joined
|
|||
jnthn | Ah well. At least I got some nice German beer out of it. :) | 22:17 | |
22:17
zby_home left
22:18
youwin_ left
|
|||
flussence | the only other time I went long-distance, it was because we'd got on the wrong train and didn't realise for a while :) | 22:19 | |
jnthn | lol | 22:21 | |
I laugh but I'm sure I'll manage that one day too | 22:22 | ||
Thankfully my "wrong train" incidents tend to have been confined to underground railways in cities, where on can't go that long a way without finding out "oops" :) | |||
*one | |||
The cool places have circular lines. Then even if you do get on the train going in the wrong direction, you still get there...eventually. :-) | 22:23 | ||
22:23
youwin_ joined
22:24
hercynium left
|
|||
arnsholt | I once took the wrong last train for the night | 22:25 | |
Thankfully it was summer =) | |||
flussence | .oO( I wouldn't want to be stranded in this weather, day or night... ) |
22:26 | |
arnsholt | Yeah. I could just walk back to the city and wait for the first train the next morning | 22:27 | |
jnthn | arnsholt: d'oh. | 22:28 | |
arnsholt: Yes, doing that with the last train is...problematic. | |||
lue is wishing trains existed in USA, to share in this storytelling | 22:29 | ||
22:32
ardeshir left
|
|||
flussence | they're only buses on rails here anyway, you're not missing a lot :P | 22:32 | |
(in the UK anyway; mainland EU gets all the fun stuff...) | 22:33 | ||
lue | but still, the best we got here is government-sanctioned sexual harassment and pornography at the airport :/ | 22:34 | |
arnsholt | jnthn: Yeah. But it was during the summer holiday, so I got a good story out of it and no major problems =) | ||
flussence | lue: those aren't much better here. I'd rather take the boat these days... | 22:37 | |
lue | .oO(What happens when a child goes through a full-body scanner?) |
22:38 | |
flussence | cooks 'em faster. | 22:40 | |
(oh c'mon google, why can't I look up my own IP address on gmaps?) | 22:41 | ||
22:42
uasi_ left
|
|||
jeeger | It goes over it's head | 22:45 | |
lue | time for me to go the way of the nom (nomdō ?). Bai! o/ | 22:46 | |
jnthn | nomdo :D | 22:51 | |
arnsholt | Huh. The competition is teaching me all kinds of useful stuff | 22:54 | |
22:56
dju_ joined,
sji joined
22:57
shi left
22:59
dju_ left,
dju left
23:00
dju joined
23:01
dju left
23:02
Caffeine left
|
|||
jnthn takes some rest & | 23:03 | ||
23:03
nymacro joined
23:13
felliott joined
23:19
Khisanth left,
felliott left
|
|||
dalek | rixel: 042032b | diakopter++ | / (20 files): push of updated sprixel files |
23:21 | |
23:25
MayDaniel joined
|
|||
dalek | rixel: 79fcca0 | diakopter++ | sprixel/s (6 files): add the antlr-generated lexer/parser/compiler |
23:26 | |
23:27
dju joined,
dju left,
dju joined
23:32
Khisanth joined
23:33
_kaare left
23:43
jeeger left
23:59
whiteknight left
|