»ö« 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:01
fsergot left
00:12
skipper left
00:18
donaldh left
00:24
fsergot joined
00:31
tokuhiro_ joined,
tokuhiro_ left
00:32
tokuhiro_ joined,
overrosy joined
00:36
overrosy left
00:37
fsergot left
00:58
fsergot joined
01:04
envi_ left
01:07
wolfman2000 joined
01:08
lestrrat left
01:09
lestrrat joined
01:11
Vespakoen joined
01:12
scott___ joined
01:33
tokuhiro_ left
|
|||
jlaire | masak: "optimaztion" @ strangelyconsistent.org/blog/t3-addition-chains | 01:39 | |
01:43
Jerkwad left
|
|||
jlaire | strangelyconsistent.org/p6cc2011/t3/zbiciak/ "The code uses a mixture of K&R and Allman style." | 01:49 | |
\n{ for functions is K&R | |||
01:56
nnunley left,
whiteknight left
02:03
Vespakoen left,
cbk1090 left
|
|||
cognominal | why masak's blogs entry are coming from the future? I wish he could do so with source code. | 02:11 | |
jlaire | and btw, from wikipedia: "A number of other papers state that finding a single addition chain is NP-complete, citing this paper, but it does not claim or prove such a result." | ||
02:15
fsergot left
02:38
fsergot joined
03:03
fsergot left
03:42
sftp_ left
03:46
lestrrat left
03:47
lestrrat joined
03:58
leprevost joined
04:00
orafu left,
orafu joined
04:02
leprevost_ joined
04:03
leprevost left
04:05
leprevost_ is now known as leprevost
04:20
skids left,
overrosy joined
04:24
overrosy left
04:27
havenn joined
04:29
envi_ joined
04:43
sporous left,
sporous joined,
tyatpi joined
04:55
xinming left
05:00
overrosy joined
05:17
eternaleye joined
05:22
overrosy left,
`10 left
05:27
birdwindupbird joined
05:29
xinming joined
05:35
stepnem joined
05:39
envi_ left
05:41
overrosy joined
05:46
kaleem joined
05:52
mdupont left
05:53
birdwind1pbird joined
06:21
overrosy left
06:23
mdupont joined
06:24
birdwind1pbird left
06:26
birdwind1pbird joined
06:31
mdupont left,
mdupont joined
06:40
sudokode left
06:46
wtw joined,
libertyp1ime joined
06:47
libertyprime left,
libertyp1ime left
06:48
libertyprime joined
06:52
overrosy joined
07:00
birdwind1pbird left
07:03
colomon left
07:10
NamelessTee joined
07:16
awwaiid_ joined,
birdwind1pbird joined
07:17
gfldex_ joined
07:21
birdwindupbird left,
awwaiid left,
gfldex left
07:31
kaleem left
07:32
kaleem joined
|
|||
moritz | \o | 07:37 | |
07:50
tyatpi left
07:52
havenn left
08:12
mj41 joined
08:20
NamelessTee left
08:33
shachaf_ joined,
shachaf_ left
08:44
nightlord joined
08:52
odoacre_ joined
09:01
pernatiy left
09:02
pernatiy joined
09:11
nightlord left
09:21
odoacre left
|
|||
tadzik | o/ | 09:25 | |
09:27
jevin left
09:28
geekosaur left
|
|||
moritz | good morning tadzik. It's quiet here today. | 09:29 | |
tadzik | a bit, yes | ||
09:32
envi_ joined
09:42
eviltwin_b joined
09:43
am0c joined,
jevin joined
|
|||
masak | good antenoon, #perl6 | 09:47 | |
tadzik | good afternoon masak | ||
...hey! | 09:48 | ||
it's even morning | |||
masak | :P | ||
not really. | |||
09:48
geekosaur joined
|
|||
tadzik | impossibru | 09:48 | |
10:48:58 | 09:49 | ||
where is thee if it's afternnon already? | |||
09:52
kaleem left
09:56
geekosaur left
09:57
eviltwin_b is now known as geekosaur
|
|||
masak | now there's a bit of a semantic confusion here, I notice. | 10:00 | |
just because it's not morning anymore does not mean it has turned into afternoon. | |||
maybe it does mean that in Polish. it sorta does in Swedish. it doesn't, as far as I know, in English. | |||
the problem being, of course, that there's no real established word for "the time after morning but before noon". | 10:01 | ||
but I'm pretty sure you can't say "good morning" when it's 11 o'clock. | |||
...and now I feel like Sheldon Cooper :P | |||
tadzik | in Polish you never say "dobre rano" or "dobre popołudnie". It's always "good day", or sometimes "dobry wieczór", when it's dark already | 10:02 | |
moritz | ... unless you're a student. Then "good morning" works perfectly fine at 11am | ||
tadzik | yes | ||
and breakfast on 1 PM is just fine | |||
masak | phenny: pl en "dobre rano, dobre popołudnie, dobry wieczór"? | 10:04 | |
phenny | masak: "good morning , good afternoon, good evening" (pl to en, translate.google.com) | ||
masak thought so | |||
phenny: eo en "rano"? | |||
phenny | masak: "frog" (eo to en, translate.google.com) | ||
masak | :P | ||
tadzik | :P | ||
phenny: "poranek"? | |||
phenny | tadzik: "morning" (pl to en, translate.google.com) | ||
tadzik | that's less ambigous | ||
masak | "poranek" sounds cute. | 10:05 | |
moritz | phenny: "vormittag"? | ||
phenny | moritz: "morning" (de to en, translate.google.com) | ||
moritz | eeks | ||
masak | moritz: there's the problem. | ||
moritz | aye | ||
masak | it's too inexact. | ||
10:05
kaleem joined
|
|||
tadzik | masak: "poranek" sounds a bit like "after rano" | 10:05 | |
moritz | antenoo describes t | ||
*it better | |||
but I guess that's not a common word in english, is it? :-) | |||
I mean, outside of #perl6 :-) | 10:06 | ||
masak | nope. | ||
it just sounds good. :) | |||
tadzik | masak: the Dictionary of Polish Language describes "poranek" as "time just after the sunrise" | ||
moritz | only 40k hits on google | ||
tadzik | or rather "the beginning of the day, just after sunrise" | ||
masak | phenny: en pl "dawn"? | ||
phenny | masak: "świt" (en to pl, translate.google.com) | ||
tadzik | yeah, świt | ||
oh wait | 10:07 | ||
"świt" is actually "just before sunrise" | |||
TIL | |||
masak | moritz: 40k ought to be good enough for any neologism :) | ||
moritz | curiously I've been in police stop-and-search operation just past midnight, and they greeted me with "good morning" | ||
masak | maybe they were police students. | 10:08 | |
10:08
dakkar joined
|
|||
moritz | :-) | 10:09 | |
masak | dakkar: good morning. | ||
tadzik | moritz: is it the same one I've seen? | ||
10:09
daxim joined
|
|||
dakkar | masak: thank you, although I suspect your tab-key misdirected you salutation :) | 10:10 | |
masak | dakkar: no, just experimenting with time-of-day greetings. but I sincerely meant the "good" part ;) | ||
dakkar | masak: thank you twice then :) and yes, it's morning here in London | 10:13 | |
moritz | tadzik: no | 10:18 | |
felher | good morning # /me is a student so he can say that :) | 10:19 | |
tadzik | eek. If my HDD throws IO errors and hangs when I try to compile parrot, it's time to get a new one, right? :/ | 10:20 | |
bonsaikitten | yep | ||
tadzik | crap | ||
masak | also time to think about what sits on that HDD that you haven't backed up yet. | 10:22 | |
tadzik | yeah, the answer is "like, all my life" | ||
which is scary | |||
it seems to hang only on writes | 10:23 | ||
masak | dakkar: in England in common speech, does it cease to be morning exactly at noon, or slightly before? | ||
tadzik | and please, don't say "so far" | ||
bonsaikitten | tadzik: welp, get new disk, restore from backups | ||
masak | tadzik: I don't have to. you know what to do. | ||
tadzik | yes. Which company produces nice SSDs? | 10:24 | |
geekosaur | several | 10:25 | |
geekosaur likes micron/crucial... | |||
10:29
xinming left
10:31
xinming joined
|
|||
tadzik | okay, I got a 120gb OCZ | 10:34 | |
tadzik goes to the store for some dvds | |||
dakkar | masak: I'm not sure… I think it's fuzzy | ||
masak | :) | 10:37 | |
10:48
pmurias joined
10:51
xinming left
10:52
scott___ left
|
|||
masak | this seems relevant: it's not just about improving the language, it's about lots of non-functional aspects that together provide the experience for the end user: blog.empathybox.com/post/1912612130...oh-god-why | 10:52 | |
10:56
xinming joined
|
|||
arnsholt | masak: Yeah, I had a similar thought | 11:02 | |
Certainly compiler speed and error messages and such are important, but macros are a very impressive/powerful feature | 11:03 | ||
[Coke] | masak: "good morning" at 11 is informal and ok. "good day" is proper. IME. | 11:04 | |
ooh, we have someone on channel in London. sadly, probably still too far away for a visit in Leeds. | 11:05 | ||
masak | [Coke]: I once read a book about various Swedish-English cultural clash issues. a Swede saying "good morning" at 11 o'clock, thereby quietly shocking her British host, was one of the clashes. | 11:07 | |
[Coke] | oh, british people are just crazy. | ||
True story. | |||
11:07
colomon joined
|
|||
tadzik | :) | 11:08 | |
[Coke] | As an American, an adopted New Yorker, former resident of the great (big) state of Texas... good morning at 11 am is fine with me. | ||
mikec | what? weird | 11:09 | |
i'm fine with good morning as long as it's in daylight hours | 11:10 | ||
[Coke] | mikec: where are you at/from? | ||
[Coke] should clarify, not only is 11am good morning nice, it's a heckuva lot better than the 6:45 good morning I just got. ugh. why am I even UP now? | 11:11 | ||
huf | i've never noticed english speakers make the distinction between morning and pre-noon | ||
dont even know what it'd be called ;) | |||
mikec | hehe | ||
england :) | |||
huf | my first language has this distinction so "morning" always felt strange tome | 11:12 | |
masak | maybe there are two distinct usages of "good morning". one meaning being "oh hai, I just woke up" (possible at any time of the day), the other being "the sun is rising at my geographical location, and I think it's a pretty good sunrise". | ||
mikec | haha | ||
huf | i think "good morning" works at any time before noon, which i've always felt odd | ||
mikec | and at work "oh hai, this is the first time i've seen you today" | ||
huf | but this is just different mappings of concepts accross languages or something | 11:13 | |
masak | mikec: surely if you happen upon a co-worker at 4 o'clock in the afternoon, you don't greet her with "good morning"?! | ||
[Coke] is often lazy and just says "mornin'. Afternoon." | |||
masak: if I did, she would certainly not be "quietly shocked". | |||
mikec | masak: i guess 4 is a bit too late | ||
masak | huf: there's a nice example of how Italian has a word meaning something between "a group of trees" and "a forest", which doesn't map nicely to many other languages. | 11:14 | |
huf | masak: hungarian doesnt have a word for "frown" | ||
which i wasnt aware of until i learned english... | 11:15 | ||
masak | neither does Swedish, I think. | ||
phenny: en hu "frown"? | |||
phenny | masak: "homlokát ráncolja" (en to hu, translate.google.com) | ||
masak | phenny: en sv "frown"? | ||
phenny | masak: "frown" (en to sv, translate.google.com) | ||
masak | bogus translation. | ||
huf | the .hu translation isnt too bad, but it literally means "furrowed brows" | ||
masak | huf: also the fact that many languages (Italian, Russian, IIRC) consider "blue" and "light blue" to be distinct enough to have proper names. we think this is funny and quirky, but we have absolutely no problem with distinguishing "light brown" as "yellow". | 11:16 | |
huf: also, Hungarian is funny because it has two words for "red"! | |||
huf | :) | ||
and even we dont know the logic :) | |||
masak | it's "pirosh", and... what, again? | 11:17 | |
huf | piros and vo:ro:s | ||
masak | ah. | ||
moritz | masak: I've just read that scalar article you linked to. Very interesting for us indeed. | ||
masak | vörös? | ||
huf | yeah | ||
masak | huf: I know that one of them is used for color of hair and blood, and in general "natural" things. is that about right? | ||
I'm pretty sure "piros" is for the traffic light color. | 11:18 | ||
huf | masak: well, flowers are natural and they're piros | ||
masak | dang. :) | ||
huf | but the earth is voros, and so's blood | ||
masak | oh, there's the mixup between red and brown, too. | ||
huf | the commie flag is voros, but the red in the current .hu flag is piros | ||
no. logic. at. all. :D | |||
moritz | and I'm pretty sure that the topic that sjn++ and the other folks set for the Oslo hackathon aims at the same direction: we need to improve the whole Perl 6 experience, not just the language | 11:19 | |
szbalint | vörös is slightly pinker than piros :) | ||
huf | pinker? | ||
it's browner if anything | |||
masak | Mandarin calls brown sugar 红糖 ("red sugar") | ||
szbalint | darker maybe | ||
hard to describe :) | |||
huf | but still, red soviet flag vs red white green flag | 11:20 | |
same color, different word | |||
masak | szbalint: that's because there is no distinction! arrgh! :) | ||
szbalint | masak: colours are hard | ||
huf | you can treat it as an irregular word that manifests differently depending on context :D | ||
and then it's not two words, but one | |||
11:20
xinming left
|
|||
szbalint | huf: to frown = fancsali képet vág? | 11:21 | |
masak is reminded of blog.xkcd.com/2010/05/03/color-survey-results/ | |||
arnsholt | The words for colour are quite interesting. All languages have words for black and red, and there's a hierarchy of words after that | ||
huf | szbalint: that, or "lefele gorbul a szaja"? *shrug* | ||
11:21
xinming joined
|
|||
moritz | arnsholt: you don't happen to know a good overview page for that? | 11:21 | |
arnsholt | (For words that are properly colour-words, not words like orange, which describes the color of oranges) | ||
huf | arnsholt: what, some dont have "white"? | ||
masak | arnsholt: I hear the order is black/white scale, red (meaning just "color" at this point), blue&green, refinement. | 11:22 | |
arnsholt goes digging for references | |||
masak | it'd be interesting to tie this to biological factors. | ||
arnsholt | Red is the colour we perceive the best, which has been suggested as an explanation | 11:23 | |
masak | ooh: en.wikipedia.org/wiki/Distinguishin...n_language | ||
huf | i used to mix up blue and green for a while when i was little... | 11:24 | |
arnsholt | Yeah, that fits with what I've read. If a language has a separate word for green, they also have blue | ||
Latin and (ancient) Greek for example has one word for blue/green | 11:25 | ||
moritz | huf: me too. I insisted that traffic lights were blue :-) | ||
arnsholt | en.wikipedia.org/wiki/Basic_Color_T..._Evolution is the paper I've been reading about | 11:26 | |
geekosaur | there are some places where they are, or at least are visibly bluer than in other places | 11:27 | |
masak | they're actually blue in Japan. | 11:38 | |
I recall there being some cultural reason for that, but I might be misremembering. | |||
flussence | .oO( this blue LED fad has gone *too far*! ) |
||
11:39
NamelessTee joined
|
|||
jnthn | good morning, #perl6 | 11:40 | |
;-) | |||
tadzik | hello jnthn | 11:42 | |
11:48
benabik joined
|
|||
moritz | oh hai jnthn | 11:50 | |
colomon | \o | 11:56 | |
bbkr | is anyone working on URI module resurrection on NOM? | 11:58 | |
tadzik | o/ | 11:59 | |
bbkr: doesn't it work? | |||
12:00
broquaint left
|
|||
bbkr | no, it doesn't. and Perl without set of network modules is pretty much worthless :( i'm thinking about fixing this module if nooone else is working on it. | 12:01 | |
tadzik | hmm | ||
tadzik has no machine to try to run it or fix it right now | 12:03 | ||
star: use LWP::Simple | |||
p6eval | star 2012.01: OUTPUT«===SORRY!===Could not find LWP::Simple in any of: lib, /home/p6eval/.perl6/lib, /home/p6eval/rakudo-star-2012.01/install/lib/parrot/3.11.0/languages/perl6/lib, .» | ||
tadzik | right | ||
bbkr | this is weird situation - we have awesome language with tons of awesome features and still there is no such basic thing as working HTTP::Request/Response available. | ||
12:04
envi_ left
|
|||
tadzik | there's Bailador::Request/Response :) | 12:04 | |
and if winds will help, I hope to change that situation during GSoC | |||
bbkr | Baliador is PSGI based AFAIK, it is not the same as standalone control over requests and responses | 12:10 | |
12:10
bluescreen10 joined
|
|||
moritz | yes, we should have modules for cookies, request, response, URIs and so on | 12:11 | |
bbkr | Maybe there should be grants for HTTP:: modules? Those are not core features, I'm aware of that. But without those Perl 6 won't gain popularity. | 12:13 | |
moritz | I don't really think grants are the solution | ||
tadzik | bbkr: I have an idea for a web-oriented GSoC project, which should show off a bit "Perl 6 ready to do useful stuff" | 12:14 | |
moritz | I think we have room for at least two such projects | 12:15 | |
though it might require some coordination to detangle them in a useful way | |||
flussence still intends to implement a PHP-quality web framework for AFD :) | 12:16 | ||
moritz | maybe I should make a small checklist of stuff we should aim to have | ||
AFD? | |||
bbkr | nice, I'm willing to participate | ||
tadzik | sound like a plan | ||
flussence | moritz: irclog.perlgeek.de/perl6/2012-03-08#i_5263231 :) | 12:19 | |
moritz | ah | ||
12:22
mdupont left
|
|||
dalek | : 107ae9e | moritz++ | misc/web-plan.txt: rough plan for what modules we need for web development |
12:22 | |
moritz | there you go. Feel free to add or edit stuff | ||
would also be nice to add some info about what we have, and how good and complete it is | 12:23 | ||
12:25
sftp joined
|
|||
sjn | Q: Would it be meaningful to send a paper about Perl 6 to these guys here? www.dynamic-languages-symposium.org...index.html | 12:30 | |
give these guys a reason to put Perl (and most importantly, Perl 6) on their radar.... | |||
masak | sure. | 12:31 | |
sjn | pmichaud: This isn't too far from you, is it? :) | ||
maybe it would be worth spending a little time on jotting together someting for this at the hackathon? | 12:34 | ||
something* | |||
12:36
M_o_C joined
|
|||
dalek | : 7f6d1c0 | tadzik++ | misc/web-plan.txt: Update misc/web-plan.txt |
12:37 | |
: 8077dcc | tadzik++ | misc/web-plan.txt: Add some info on URI |
12:39 | ||
12:39
mdupont joined
|
|||
moritz | does that mean that LWP::Simple doesn't work either? | 12:40 | |
12:41
sisar joined
|
|||
tadzik | yes | 12:42 | |
moritz | eeks | ||
tadzik | or so says "State of modules on nom" | ||
12:42
gfldex_ is now known as gfldex
|
|||
masak | one thing that I've long wanted/planned/dreamt of for Perl 6, is CSS manipulation. | 12:43 | |
arnsholt | masak: In what sense? | ||
masak | that is, the browser has certain rules for which bits of CSS to apply to which elements. | ||
emulate that, and then enable various "refactorings", or finding dead bits of CSS, etc. | |||
arnsholt | So static analysis of HTML/CSS, in a way? | 12:44 | |
masak | right. | ||
operations such as "take this inline CSS and turn it into a CSS file with classes and IDs" | |||
arnsholt | Yeah, that might be cool | ||
masak | or "take these five CSS files and turn them into one optimized CSS file" | ||
or just "show me what CSS selectors apply to this element". | 12:45 | ||
I suspect this is outside of a web grant, though. | |||
it'd just be a cool app to have. | |||
arnsholt | Certainly. It'd be a pretty significant undertaking, I think | ||
flussence | I tried writing a grammar based on the CSS3 syntax spec a long time ago... it scared me away pretty fast once I realised the spec wasn't quite sane | 12:46 | |
arnsholt | What're the problems with it? | 12:47 | |
flussence | from memory, I think I found statements contradicting each other and gave up then. It seemed to have a horrible equivalent of <.ws> too. | 12:48 | |
masak | tadzik: Ratel is the low-end solution for HTML templating. Genshi/Hitomi (feel free to rename) is the more high-end one. | 12:49 | |
flussence | (plus, rakudo was slow as molasses back then...) | 12:50 | |
masak | tadzik: I believe having both is a good idea. | ||
12:50
leprevost left
|
|||
tadzik | sure | 12:50 | |
it's just that only the low-end solution works for now :) | |||
masak | oh, that's a pity. | ||
12:51
mtk joined,
grondilu joined
|
|||
masak | but I guess I agree with the sentiment of starting from working stuff. :) | 12:52 | |
tadzik | :) | ||
grondilu | perl6: package Foo { our multi bar { say "ok" } }; Foo::bar; | ||
p6eval | pugs b927740: OUTPUT«ok» | ||
..niecza v15-4-g1f35f89: OUTPUT«Potential difficulties: &bar is declared but not used at /tmp/tSKejnuOxD line 1:------> package Foo { our multi bar ⏏{ say "ok" } }; Foo::bar;ok» | |||
..rakudo 34b7b1: OUTPUT«Could not find symbol 'Foo::&bar' in block <anon> at /tmp/oy7NCa08PA:1» | |||
12:52
pernatiy left
12:53
NamelessTee left
|
|||
grondilu | please guys do something about this "our multi" thing. | 12:53 | |
12:55
Teratogen left
|
|||
masak | grondilu: do you know if it's been RT'd? | 12:58 | |
a cursory search doesn't find it. | |||
12:58
pmurias left
|
|||
grondilu | I'm pretty sure it was | 12:58 | |
I mean, last time I complained, someone said there was a ticket. | 12:59 | ||
moritz | yes, it's been RTed | 13:01 | |
masak | ok, fine. | ||
moritz | r: package Foo { our proto bar(|$) { * }; multi bar { say 'ok' } }; Foo::bar | 13:03 | |
p6eval | rakudo 34b7b1: OUTPUT«ok» | ||
moritz | easy enough to work around if you want | ||
grondilu | nom: sub contfrac($x) { gather { take my $a = $x.Int; take &?ROUTINE(1/($x - $a)) unless $x == $a } }; say contfrac(pi)[^5] | 13:05 | |
p6eval | rakudo 34b7b1: OUTPUT«3 7 15 1 292» | ||
grondilu | this continuous fractions stuff is pretty neat :) | ||
13:06
awwaiid_ is now known as awwaiid
|
|||
moritz | fwiw I can easily see where the 'our multi' bug is coming from | 13:09 | |
in Actions.pm method routine_def | |||
grondilu | can you fix it? | ||
moritz | there's a check for if $*MULTINESS eq 'multi' { | ||
and the check for if $*SCOPE eq 'our' happens only in the else-branch | 13:10 | ||
I fear I can't | 13:11 | ||
because I don't know the desired semantics | |||
consider | 13:12 | ||
proto a(|$) { * }; multi a(somesig) { }; package Foo { our multi a() { } } | |||
what does that mean? | |||
one candidate of a multi is added to the package table, but the proto isn't? | 13:13 | ||
that kind of turns the proto and candidate relation upside down | |||
masak | interesting. | ||
jnthn | multis are never installed anywhere other than the dispatch list of a proto. | ||
moritz | so, what does that do? | 13:14 | |
auto-gen a proto to be our'ed? | |||
(but not installed in the lexical scope?) | |||
I'd... rather forbid that case, and require you to use a proto with 'our' | |||
grondilu | perl6: package Foo { our proto bar { * }; our multi bar { say "ok" } }; Foo::bar; | ||
p6eval | pugs b927740, rakudo 34b7b1: OUTPUT«ok» | ||
..niecza v15-4-g1f35f89: OUTPUT«===SORRY!===Two definitions found for symbol ::GLOBAL::Foo::&bar first at ??? line 0 second at ??? line 0 at /tmp/bGKDT2d4Gm line 1:------> oo { our proto bar { * }; our multi bar ⏏{ say "ok" } }; Foo::bar;Pote… | |||
jnthn | If it's gonna work, the auto-gen proto would get our scope, yeah | 13:15 | |
grondilu | nom: package Foo { our proto bar(|$) { * }; our multi bar { say "ok" } }; Foo::bar; | ||
p6eval | rakudo 34b7b1: OUTPUT«ok» | ||
grondilu | I see | ||
moritz | I mean, we can make the case work where no outer proto is found | ||
grondilu didn't know a proto was assumed where declaring a multi | 13:16 | ||
moritz | you only ever call protos and only-subs when you write someting like a() | ||
and if it's a proto, the proto re-dispatches to one of the &a candidates | 13:17 | ||
jnthn | Note that our scope implies lexical installation also | ||
So our multi ... need only mean "if you happen to auto-gen a proto because there's none already in this lexical scope, then also install it as our scope" | 13:18 | ||
grondilu | that would make sense | ||
jnthn | And if you're silly enough to do multi foo() { }; our multi foo($a) { }; then you won't get what you want at all, but tough luck. | 13:19 | |
Well, if you write that you don't know what you want. :) | |||
moritz | which is why I'd propose a helpful error message | ||
grondilu | I just want to use a sub with polymorphism, outside from its package | ||
moritz | then an 'our proto' is the safes approach | 13:20 | |
grondilu | ok | ||
jnthn | moritz: Well, in that case we always forbid "our multi" consistently. | 13:21 | |
And if you want that, write an our proto | |||
Then just "multi foo() ..." | |||
In fact, scope declarators on individual candidates are pretty senseless anyway | |||
So maybe we should just always complain. :) | |||
moritz | ok, I'll do that | 13:22 | |
complaining is something I'm good at these days :-) | |||
masak | :P | ||
benabik | And if you want non-default scoping on the protos, declare the proto explicitly? | ||
moritz | correct | ||
benabik | What is the default scope on protos anyway? my? | ||
moritz | yes | ||
just like ordinary subs | 13:23 | ||
13:24
daxim left
|
|||
grondilu | why is that by the way? I think a default "our" would be nice. | 13:25 | |
moritz | we don't nearly look as often into package tables as perl 5 did | 13:26 | |
so you don't get much benefit from our-subs | |||
the cleaner approach is to explicitly import/export the subs to where you want them | |||
grondilu | but exporting messes up the local lexical scope. In Perl5, it is discouraged. | ||
moritz | erm, what? | 13:27 | |
which lexical scope is messed up? | |||
oh, and we can do better than p5 at importing (at least in theory :-) | |||
grondilu | well, isn't there a motto saying: "don't export anything" ? | ||
moritz | grondilu: no, the motto is just "don't export anything *BY DEFAULT*" | ||
13:27
pernatiy joined
|
|||
moritz | we have to think about how much sense that makes in the context of p6 | 13:28 | |
grondilu | I just like to be explicit about where the routine I use come from. If I have a foo function in a Bar package, I like to call it Bar::foo | 13:29 | |
moritz | I guess currently we're a bit biased towards exporting too much stuff by default, simply because importing selectively doesn't work well yet | ||
13:29
skids joined
13:31
M_o_C left
|
|||
masak | grondilu: all you have to do to refer to it as Bar::foo is to mark the sub or proto as 'our'. | 13:31 | |
grondilu | yeah I get it. But I wish it was "our" by default. | 13:32 | |
In other words, I don't think strict encapsulation is necessary for packages. | 13:33 | ||
benabik | Then all your multis would be, essentially, public by default. | ||
grondilu | benabik: yes | ||
benabik | It's generally better to have the default be the safe option. And having to explicitly mark what functions users can call is safer so internal functions don't accidentally get exposed. | 13:34 | |
(IMNSHO) | |||
grondilu | I can understand that for classes. But in my opinion packages should more "relaxed". | 13:35 | |
s/should/& be/ | |||
and doing so, P6 package would behave more like P5 packages. | 13:36 | ||
moritz | we want to avoid that kind of special-casing | 13:37 | |
benabik | Packages can have internal functions too. Thought should go into the external API, rather than just giving access to everything all the time. | 13:38 | |
Maybe someone can add a `use our` or something to make that easy for you. :-D | |||
grondilu | yes, or an adverbial form for declaring packages. | 13:39 | |
something like: package Foo :visibility<public> { ... } | |||
moritz | package Foo { use default :scope<our>; ... } | 13:40 | |
grondilu | yes | ||
that would make me happy :) | 13:41 | ||
dalek | kudo/forbid-our-multi: b4caaa4 | moritz++ | src/ (2 files): forbid scopes on individual multi candidates |
||
grondilu | nom: package Foo { use default :scope<our>; sub talk { say "hello" }; Foo::talk; | 13:43 | |
p6eval | rakudo 34b7b1: OUTPUT«===SORRY!===arglist case of use not yet implemented. Sorry. at /tmp/amyc_tetyb:1» | ||
grondilu | perl6: package Foo { use default :scope<our>; sub talk { say "hello" } }; Foo::talk; | 13:44 | |
p6eval | rakudo 34b7b1: OUTPUT«===SORRY!===arglist case of use not yet implemented. Sorry. at /tmp/bNj8eTfoh9:1» | ||
..pugs b927740: OUTPUT«pugs: *** No such subroutine: "&require_default" at /tmp/GP55fv07eq line 1, column 1» | |||
..niecza v15-4-g1f35f89: OUTPUT«===SORRY!==='use' with arguments NYI at /tmp/BTVRHZtVAA line 1:------> package Foo { use default :scope<our>⏏; sub talk { say "hello" } }; Foo::talk;Potential difficulties: &talk is declared but not used at /tmp/B… | |||
moritz | nope, was pure speculation on my part | ||
grondilu | ok, I was not sure | ||
13:46
simcop2387 left
|
|||
felher | "forbid scopes on individual multi candidates"? Does that mean one won't be able to do someting like ' sub do-something { my postfix:<!>(MyStrangeRepresentationOfInt $a) { .... }; more code }' anymore, because postfix:<!> is a multi and i have my-scope on that special multi-candidate? | 13:48 | |
benabik | Hm. | ||
13:48
nnunley joined
|
|||
benabik | Is there a way to create a new proto that includes all the protos from another version of itself? | 13:48 | |
13:49
simcop2387 joined
13:50
kaleem left
|
|||
felher better backlogs in case he just missed something and got "forbid ..." totally out of context :) | 13:50 | ||
moritz | felher: no, first your postfix isn't a multi, and second 'my' is still allowed | 13:54 | |
13:55
bluescreen10 left
|
|||
felher | moritz: it should be a multi. I just forgot it ;). But since my is still allowed i'm happy in any case :) | 13:55 | |
moritz: thanks :) | |||
masak | felher: you must do either 'my sub' or 'my multi'. | ||
moritz | or 'my multi sub' :-) | ||
masak | yeah, but don't do that ;) | 13:56 | |
save the long form for 'multi method'. | |||
13:57
snearch joined
|
|||
felher | yeah, i wanted to write 'my multi postfix...' :) And i forgot that there is no facultiy-postfix-operators already defined ... :) | 13:57 | |
jlaire | jaa | 14:01 | |
no onneks zeikkokaan ei oo hereillä | |||
masak | no, onneksi. | 14:02 | |
jlaire: ww? | |||
moritz | phenny: "no onneks zeikkokaan ei oo hereillä"? | ||
phenny | moritz: "Luckily no zeikkokaan not oo awake" (fi to en, translate.google.com) | ||
jlaire | masak: thanks... | 14:04 | |
dalek | kudo/nom: b4caaa4 | moritz++ | src/ (2 files): forbid scopes on individual multi candidates |
||
jlaire | "well, fortunately zeikko's not awake either" | 14:05 | |
14:07
kaleem joined
|
|||
dalek | ast: eb6edd6 | moritz++ | S32-exceptions/misc.t: test X::Declaration::Scope::Multi |
14:08 | |
masak | the details around this stray phrase, the true identity of zeikko, and the significance of being awake or asleep, are all such that leaving them unspecified only heightens the mystery and intrigue. | 14:09 | |
moritz | it reminds me a bit of en.wikipedia.org/wiki/Carthago_delenda_est | ||
masak | maybe we should rename the END phaser to FINNISH? :P | 14:10 | |
14:10
bluescreen10 joined
|
|||
tadzik | what does a Nordic Funeral and Mortal Combat have in common? | 14:10 | |
masak | som pun, most likely. | ||
tadzik | Finnish Hymn! | ||
masak | some^ | ||
masak groans | |||
I'm Nordic but not Finnish, you insensitive clod! :) | 14:11 | ||
tadzik | :) | ||
jlaire | oh my, what have i started | ||
opening irc <10s after waking up considered harmful | 14:12 | ||
moritz | jlaire: happens to all of us (starting... stuff) | ||
benabik | s/\<10s after waking up // | ||
jlaire | heh | ||
moritz | just search for 'tsm' in the recent-ish IRC logs :-) | ||
masak | oh my :) | 14:13 | |
14:15
grondilu left
14:18
kaleem left
14:19
kaleem joined
14:24
wolfman2000 left
14:32
kaleem left
14:35
fsergot joined
14:36
mdupont left
|
|||
masak | unfortunately, you can't search for 'tsm' with the built-in search function in the IRC logs, due to the three-char limit. | 14:39 | |
fsergot | hi #perl6 o/ | ||
masak | using Google works fine, though. | ||
fsergot! \o/ | |||
14:39
xenu joined
|
|||
tadzik | hello fsergot | 14:39 | |
14:50
PacoAir joined
14:53
NamelessTee joined
|
|||
jnthn | Time to go spend O(16 hours) flying (along with O(5 hours) in airports)...back in...at least 24 hours I guess :) | 14:56 | |
mikec | have fun! | ||
jnthn | o/ | 14:58 | |
masak | have a nice, appropriately offline vacation :) | 15:01 | |
sisar | re rosettacode.org/wiki/Balanced_brackets#Perl_6, the generated bracket sequence isalways supposed to be well-balanced, or it might produce unbalanced as well ? | 15:02 | |
(coz i'm getting only well-balanced ones) | 15:04 | ||
(the Depth counter solution) | 15:05 | ||
15:05
jnthn left
|
|||
masak | sisar: I think part of the assumption of "balanced brackets" is that they be balanced. | 15:05 | |
hence the "balanced". | 15:06 | ||
sisar | masak: well, the task description says generate an arbitrary sequence & then check if it is balanced or not | ||
masak | oh! | 15:07 | |
so it does. | |||
benabik | Does xx thunk the LHS? if so, it could be <[ ]>.pick(1) xx $n instead | 15:08 | |
15:08
bluescreen10 left
|
|||
benabik | r: <[ ]>.pick(1) xx 3 | 15:08 | |
p6eval | rakudo b4caaa: ( no output ) | ||
benabik | r: say <[ ]>.pick(1) xx 3 | ||
p6eval | rakudo b4caaa: OUTPUT«[ ] [» | ||
benabik | r: say <[ ]>.pick(1) xx 10 | ||
p6eval | rakudo b4caaa: OUTPUT«] [ [ [ ] [ [ ] ] [» | ||
benabik | \o/ | ||
timotimo | oh that's cute | ||
benabik | Oh, probably want a .join on there too | ||
masak | or just .roll(10).join | 15:09 | |
benabik | You might want to explain the generator first, separate from the checks. | ||
Oh, hey, that's easier. | |||
r: say <[ ]>.roll(10).join | |||
p6eval | rakudo b4caaa: OUTPUT«[[[[[][[[]» | ||
masak | but the problem description says to generate as many [s as ]s | 15:10 | |
not that it matters much -- it's just an optimization, since these are the only ones that'll ever have a chance to be balanced. | |||
benabik | Hm. Oh, the current one should do that. It shouldn't always be balanced though. | ||
15:11
tokuhiro_ joined
|
|||
benabik | r: say <[ ]> xx 5).pick(*).join for ^5 | 15:11 | |
p6eval | rakudo b4caaa: OUTPUT«===SORRY!===Confusedat /tmp/Pn3Tn5pXcw:1» | ||
masak | it won't always be balanced just because opening and closing brackets are the same amount. | ||
e.g. ]]]]][[[[[ | |||
benabik | r: say (<[ ]> xx 5).pick(*).join for ^5 | ||
p6eval | rakudo b4caaa: OUTPUT«[][][][][][][][][][][][][][][][][][][][][][][][][]» | ||
benabik | r: say (<[ ]> xx 5).flat.pick(*).join for ^5 | ||
p6eval | rakudo b4caaa: OUTPUT«[]]]][[[[]]]][[[][][]][[[][][]][[]]]][[[[][[[]][]]» | ||
masak | yeah, rakudobug. | 15:12 | |
a known one. | |||
benabik | n: say (<[ ]> xx 5).pick(*).join for ^5 | ||
p6eval | niecza v15-4-g1f35f89: OUTPUT«]][[][][[]]][][[[]][[[]][[]][]][]]][[][[][[]]][[][» | ||
benabik | niecza++ | ||
15:13
VZ_ joined
|
|||
moritz | r: say <[ ]>.pick xx 5 | 15:14 | |
p6eval | rakudo b4caaa: OUTPUT«] [ [ ] ]» | ||
masak | heh, seems I created that "Balanced brackets" page over a year ago. I can't believe I've been obsessed with balanced-bracket strings since February 2011. :) | ||
also, the article now has 54 languages -- that's pretty cool. | 15:15 | ||
sisar | am i so lucky? gist.github.com/2044727, all tries resulted in balanced-brackets ! | ||
masak++ | |||
.oO (you forgot your own task definition ? ) | 15:16 | ||
benabik | sisar: It's a rakudobug. It's selecting a random [] pair instead of a random bracket from the pair. See the different between rakudo and niecza above. | ||
sisar: You can add a .flat to make rakudo behave. | |||
masak | sisar: seems I forgot my own task definition, yes. it's not the important bit of the task :) | ||
sisar | banabik: oh. thanks. | ||
masak: :) | 15:17 | ||
15:18
VZ_ left
15:20
bluescreen10 joined
15:34
tokuhiro_ left
15:44
sudokode joined
15:45
Psyche^ joined
15:49
kaare_ joined,
Patterner left
15:50
Psyche^ is now known as Patterner
15:51
wtw left
16:01
snearch left,
sisar left
|
|||
TimToady | 'use default' strikes me as an extremely poor name for a pragma | 16:09 | |
pragmas should generally name the thing they're modifying | 16:10 | ||
benabik | use scope :our<sub multi> | 16:11 | |
TimToady | much improved, though still a bit strange | ||
your arg is kinda inside out | 16:12 | ||
benabik | I wanted it to read like "our sub" and "our multi" | ||
TimToady | scope -> multi -> our is the natural order | ||
benabik | Logically, I suppose it could go the other way 'round. *shrug* | ||
TimToady | or multi -> scope -> our | ||
[Coke] | TimToady: yes, that one. | 16:13 | |
use multi :scope<our> | |||
16:14
havenn joined
|
|||
TimToady | pragmas is one of those areas where people often settle on the first thing that pops into their heads without thinking whether there's a better option | 16:14 | |
dunno why, something psycho(il)logical | 16:15 | ||
masak | seems a pretty widespread problem in the design of anything software-y. | 16:16 | |
"anchoring" to the first design/idea/model that comes to mind. | |||
TimToady | yes, but in this case, people don't think of it as OO, I suspect | 16:17 | |
use object :attribute(value) | |||
that's how I've been trying to think of it lately, now that I put it into words | 16:18 | ||
where "object" might just be some langauge abstraction, but it needs to be the right abstraction | |||
not too general, not too specific | |||
'use default' broke the pointer on my specificity gauge | 16:20 | ||
benabik | No reason why it can't be both `use scope` and `use multi :scope`. The first is more useful to modify many scopes, the second more useful to modify many facts about multis. | ||
TimToady | well, 'scope' is also terriby overgeneral | ||
*bly | |||
geekosaur | there is a mindset which sees pragmas as similar to monkey patching and thereby sees no reason to make the logical or hygienic | 16:21 | |
TimToady | which is, of course, not a good approach to monkey patching either | 16:22 | |
masak | TimToady: interesting, 'use object :attribute(value)' looks like an RDF triplet | ||
geekosaur | it's not, but there *is* a certain "I'm already breaking the rules, why not?" thing going on in many people's minds | 16:23 | |
(general psychological thing, I know of various things to try to control it in, hm, other contexts) | |||
TimToady | "Here's a messy room, so I can make it messier." vs "Here's a messy room, maybe I can tidy up a bit." | ||
geekosaur | "nobody'll notice a little more mess" | 16:25 | |
TimToady | I will admit to being in the first category by inclination, but in the second by choice. | ||
geekosaur | like I said, it's a psychological thing. traps a lot of people in a lot of circumstances | 16:26 | |
it *shouldn't* be that way, but it's what actually happens in many cases | 16:27 | ||
TimToady | it even traps language designers from time to time, but sometimes they get better, or at least want to get better :) | ||
P6 New Year's Resolution: A place for everything, and everything in its place... | 16:28 | ||
geekosaur | (so what's C++'s excuse?) | ||
TimToady | insufficient laziness | ||
the willingness to learn to think like the computer, instead of teaching the computer to think like a person | 16:29 | ||
geekosaur ... officially Does Not Like C++ templates | |||
TimToady | but seriously, this was one of the overarching metagoals of the P6 redesign: Hang everything on the right peg, and if there isn't a peg, invent one. | 16:30 | |
twigils are a new peg | |||
protos are a new peg | 16:31 | ||
lexical pegs are much stronger | |||
syntactic categories are new pegs | |||
new pegs make new namespaces, and often those names should be thought of as objects in their own right | 16:32 | ||
maybe not twigils, but certainly some of the others | 16:33 | ||
masak | I hear this peg metaphor now and then, and I like it. | 16:35 | |
I realize I haven't given much thought to how it applies to Perl 5, though. | |||
what are some wrong pegs (or non-pegs) that Perl 5 hangs (or doesn't hang) things on? | |||
doy | the whole perl5 object system | 16:36 | |
timotimo | hm, there is a way to use a different grammar for a block, right? in what synopsis or under what keyword would i have to look for that? it's not in the grammars section of s05 at least | ||
geekosaur | prototypes? IO syntax? | ||
masak | I can think of one offhand: the "variable will not stay shared warning". Perl 6 doesn't have that one. | ||
doy | prototypes is another, yeah | ||
masak | timotimo: it's never been fully spec'd, I fear. probably something to do with slangs. | 16:37 | |
timotimo: S02 has some wording about slangs. | |||
std: augment slang Regex {} | |||
p6eval | std 1ad3292: OUTPUT«ok 00:01 108m» | ||
timotimo | yeah, it's pretty short | 16:38 | |
could i write a grammar for JSON and do something like my $result = { use MYJSON; [1, 2, 3, 4] }; or something of that sort? | |||
essentially the same as my $result = MYJSON.parse("[1, 2, 3, 4]") i'd think | 16:39 | ||
masak | it would require the change of $~MAIN slang to be exported from the MYJSON model out to the calling block. | 16:40 | |
timotimo | what i'm interested in is 1) get rid of the data as a string, 2.) lift the compiling to actual compile time without having to write a BEGIN block | ||
masak | I don't know of a mechanism for that, but that doesn't mean it's not, or won't ever be, possible. | ||
timotimo | i suppose it's just a bit of food for thought for now then? | 16:41 | |
masak | well, it's a wishlist feature that comes up now and then. | ||
I really hope it ends up being implemented. | 16:42 | ||
timotimo | ah, of course i wouldn't be the first to come up with that :) | ||
flussence | .oO( module MYJSON { multi sub infix:<:>(Str $key, Any $value) is export { $key => $value }; } ) |
16:45 | |
tadzik | a macro may be better :) | ||
masak | I just found norvig.com/lispy.html and I think it's great. probably others here will like it, too. | 16:46 | |
timotimo | flussence: of course a json grammar/parser is so close to perl itself, that it's not hard to whip up something like that - in my case, i'd have a self-made language-like thingie that i'd like to parse | 16:47 | |
flussence | I imagine it'd be as straightforward as getting "use v5;" to parse correctly, assuming the grammar part is already done | 16:49 | |
16:52
bluescreen10 left
16:57
sftp_ joined
16:58
sftp left
|
|||
masak decommutes | 16:58 | ||
17:05
bluescreen10 joined
17:07
birdwind1pbird left
17:09
bluescreen10 left,
mj41 left
|
|||
gfldex | another nice article about programming programming: tagide.com/blog/2012/03/research-in...languages/ | 17:19 | |
17:24
bluescreen10 joined
17:27
MayDaniel joined
17:32
mdupont joined
17:41
kaleem joined
17:42
fglock joined
17:45
havenn left
17:56
dakkar left
18:00
havenn joined
18:05
kaleem left
18:06
pernatiy left
18:09
buubot_backup left
18:18
Chillance joined
18:29
buubot_backup joined
18:48
cbk1090 joined
18:49
birdwindupbird joined
18:55
birdwindupbird left
18:57
cbk1090 left,
pernatiy joined
19:09
birdwindupbird joined
19:29
tokuhiro_ joined,
havenn left,
tokuhiro_ left
19:30
tokuhiro_ joined,
havenn joined,
cbk1090 joined
19:40
mj41 joined
|
|||
masak | oh, crap, did I do the blog-post-from-the-future thing again? :( | 19:50 | |
I'm terribly sorry. | |||
that's first on the list of things to fix, by the way. | |||
19:52
eternaleye left
|
|||
benabik | huh? | 19:52 | |
19:52
eternaleye joined,
eternaleye left,
eternaleye joined
|
|||
masak | benabik: apparently, I made the publishing date of strangelyconsistent.org/blog/t3-addition-chains 2012-*04*-14 :/ | 20:00 | |
which means it'll linger for one month at the top of Planet Perl 6... | |||
benabik | Hey, free self-promotion! | ||
It's not a bug, it's a feature. | 20:01 | ||
[Coke] | it's not a bug, it's a future. | ||
tadzik | :) | ||
benabik | Coke++ | ||
moritz | :-) | ||
TimToady | all you have to do is pretend it was an accident, and we won't think ill of you | ||
moritz | masak: just fix the date, planetsix will pick up the new date eventually, I think | ||
fwiw my blog platform doesn't publish posts from the future | 20:02 | ||
it's a nice method to do timed publications | |||
TimToady | if all your publishees live in the same timezone... | 20:03 | |
moritz | well, yes | ||
but it's all UNIX timestamps anyway | 20:04 | ||
masak | moritz: hm, yes. adding a check/die for posts from the future would be a very reasonable first step, that I can do now, even. | ||
jlaire: "optimaztion" typo fixed. thank you. jlaire++ | 20:06 | ||
jlaire | hehe | 20:07 | |
20:08
ksi joined
|
|||
masak | er, I mean "En ollut hereillä, kun kerroit minulle, mutta onneksi olen hereillä noe." :) | 20:12 | |
s/ noe// | 20:13 | ||
20:15
birdwindupbird left
20:16
birdwindupbird joined
20:31
fglock left
20:35
havenn left
|
|||
arnsholt | phenny: "En ollut hereillä, kun kerroit minulle, mutta onneksi olen hereillä noe."? | 20:37 | |
phenny | arnsholt: "I was not awake when you told me , but fortunately I'm awake noe ." (fi to en, translate.google.com) | ||
masak | the "noe" was a typo of "now", which apparently disappears in translation when spelled correctly. | 20:50 | |
also, the whole thing was a pastiche of jlaire's ww utterance from earlier today ;) | 20:51 | ||
jlaire | oh, my | ||
btw, "now" is "nyt" | 20:52 | ||
masak: perfect grammar :) | |||
masak does a high-five with Google Translate | |||
jlaire | and "no, onneksi" was a disturbingly natural response | ||
masak | language. it's so simple! | ||
21:00
havenn joined
21:02
kaare_ left,
skids left
|
|||
mikemol | I think I want to steal Addition Chains as an RC task. | 21:03 | |
arnsholt | masak: Indeed. All you need is a mirror of the internet and piles of computers =D | 21:04 | |
moritz | mikemol: then you'll showcase different algorithms, not how the same algorithm is implemented in different languages | ||
mikemol | moritz: Have you seen FizzBuzz? | ||
moritz | mikemol: I probably have, but it's too long ago to remember | 21:05 | |
mikemol | Anyway, that's not really a problem. Sometimes, the point is more the solution and less how you get there. This lets different paradigms show how they'd reach the same ends, but with different ways of thinking. | ||
jlaire | if someone implemented a complicated algorithm for addition chains, ruby/python folk would point and say how much shorter their brute-force is | 21:06 | |
in fizzbuzz there's no easy/slow vs. complex/fast solutions, they all work | |||
21:06
birdwindupbird left
|
|||
mikemol | jlaire: I've seen a number of people point to RC tasks and crow about either speed or size. When I see it, I reply and point out that that's not the point. | 21:07 | |
21:07
tokuhiro_ left
|
|||
mikemol | If RC users had a focus on example length, we'd have more problems with code golf than we already do. We have less now than we've had in the past, too. | 21:08 | |
jlaire | yeah, I guess it's not a problem really | ||
mikemol | Though I did see one superb example of a golfer's language. If given the name of an RC task, it performed the goal of the RC task. Otherwise, it behaved as (I think) C. | 21:09 | |
jlaire | heh | 21:10 | |
21:10
bluescreen10 left
|
|||
masak | I'd still like to see a Perl 6 translation of Knuth's www-cs-faculty.stanford.edu/~knuth/...ongchain.w | 21:12 | |
whoever translates it can make a great blog post, too ;) | |||
cbk1090 | what do you mean when you all talk about code golf? | ||
jlaire | is there an explanation of that somewhere? | ||
I don't like reading .w | |||
mikemol | cbk1090: In golf, the person with the lowest score (number of putts) at the end of the course wins. In code golf, it's number of lines of code. | 21:13 | |
jlaire | I just implemented Knuth's Dancing Links for a sudoku solver :) | ||
(not in Perl 6, though) | |||
masak | cbk1090: we mean "to shorten code as much as possible". | ||
cbk1090 | ok go it | ||
masak | jlaire: I have C/Perl 5/Perl 6 implementations of DLX. | ||
jlaire | mikemol: or even number of characters, usually | ||
cbk1090 | totally understand now! | ||
masak | jlaire: I have no big problem reading .w -- 'course, it's prettier when rendered as TeX output :) | 21:14 | |
mikemol | jlaire: Don't make me pull out UTF-7 and go number-of-bytes on you. :) | ||
jlaire | :P | ||
masak: I guess. maybe I'll give it a try | |||
mikemol | Hm. Actually, I'd have to back UTF-7 with some kind of packing. | ||
moritz | n | 21:15 | |
benabik | UTF-7? | ||
moritz | from the bad old days | 21:16 | |
mikemol | Just read about it today. Encoding for Unicode for 7-bit safe environments. | ||
en.wikipedia.org/wiki/UTF-7 | |||
moritz | or more accurately, 8-bit unsafe environments :-) | ||
benabik | And what format is knuth using there? Looks vaguely like TeX? | ||
mikemol | moritz: My boss and I are in a back and forth about the terminology. Has me all confused. :( | 21:17 | |
benabik | I'm applying for PhD programs and #perl6 keeps making me feel dumb. :-/ | ||
jlaire | benabik: CWEB | ||
moritz | benabik: never mind. I'm also doing my PhD right now, and often feel dumb around here | ||
jlaire | almost nobody uses it, except Knuth himself | ||
benabik | Oh, that thing. | 21:18 | |
21:18
skipper joined,
alester joined
|
|||
arnsholt | benabik: I'm doing a PhD as well, and in the same position =) | 21:18 | |
21:18
lichtkind joined
|
|||
benabik | Well, we can all be dumb together! | 21:18 | |
masak | I'd rather be the dumbest one on #perl6, than the smartest one on almost any other channel. | 21:19 | |
21:19
havenn left
|
|||
benabik | Thanks for info, peoples. I'm off. | 21:21 | |
21:21
benabik left
|
|||
cbk1090 | Can someone help me with a perl6 grammar? I'm trying to make one for data that looks like this: Agoura Hills* 8.750% Los Angeles | 21:22 | |
I'm having problems with the city name if it is two or more words | 21:23 | ||
masak | it's not clear to me what the structure of your data is. | 21:24 | |
two words, an asterisk, a percentage, and two more words? :) | |||
feel free to use gist.github.com/ at any point to illustrate your point in two dimensions. | |||
cbk1090 | the city name can be none or more words | 21:25 | |
masak | what does the asterisk do? | ||
cbk1090 | it is for incorprated citys | ||
not allways present for every city | |||
this is what I have for city name so far.. | 21:26 | ||
21:26
skipper left
|
|||
cbk1090 | token city{ \w+ [\( \w+ \)]* [\*]* } | 21:26 | |
masak | you're assuming that you'll get whitespace for free. | ||
that's why it isn't working for you. | |||
'token' doesn't have implicit whitespace. 'rule' does. | 21:27 | ||
r: say so "Agoura Hills* 8.750% Los Angeles" ~~ /^ (\w+ [\h+ \w+]*) '*'? \h+ (\d+\.\d+\%) \h+ (\w+ [\h+ \w+]*) $/ | 21:29 | ||
p6eval | rakudo b4caaa: OUTPUT«True» | ||
masak | r: "Agoura Hills* 8.750% Los Angeles" ~~ /^ (\w+ [\h+ \w+]*) '*'? \h+ (\d+\.\d+\%) \h+ (\w+ [\h+ \w+]*) $/; say $/[0 .. 2] | 21:30 | |
p6eval | rakudo b4caaa: OUTPUT«=> <Agoura Hills> => <8.750%> => <Los Angeles>» | ||
cbk1090 | here is my full regex: git://gist.github.com/2047102.git | ||
masak looks | |||
lichtkind | done my daily duties | 21:31 | |
masak | cbk1090: pro tip: develop grammars with tests. | ||
cbk1090: otherwise, it's far too easy to backslide on some features. | |||
cbk1090 | masak, when I'm a pro and understand the basics I look into that | 21:32 | |
I don't even know what grammar test are. | |||
masak | they're regular 'use Test' tests that target your grammar. | ||
cbk1090 | Sorry masak, that is still well beyond my knowlage of perl6 | 21:34 | |
if I can't find an useable example on the internets then I don't use it. | |||
really wish there was a "Learning Perl6" book out allready! | 21:35 | ||
masak | I feel inclined to help you learn how to write a grammar with tests. | ||
tadzik | how do you find the "Using Perl 6" book? | ||
21:35
havenn joined
|
|||
masak | cbk1090: if you give me 15 minutes, I'll put together a gist for you. | 21:35 | |
cbk1090 | masak, okay | 21:36 | |
tadzik, IMHO, I don't like it. | |||
needs more basic examples | |||
masak | do go on. | ||
I've heard that criticism before, I'm genuinely interested. | 21:37 | ||
not least because I believe it's correct. | |||
cbk1090 | I don't care for the JASON example | ||
21:37
MayDaniel left
|
|||
masak | heh :) | 21:37 | |
no, it's too big a leap from nothing. | |||
cbk1090 | I have the Programming Perl 3rd edition and Learning Perl | 21:38 | |
both GREAT books. | |||
the Perl6 and Parrot essentials is lacking and way dated | |||
moritz | that's why we're working on UP6 | 21:39 | |
cbk1090 | sorry s/JASON/JSON/ | ||
moritz | did you read the chapter on regexes before reading the one about grammars? | 21:40 | |
cbk1090 | yes | ||
moritz | ok | ||
cbk1090 | most of the grammars/regexes I get working are by me doing trial and error processes to see what works. | 21:41 | |
masak | that's what we all do. | ||
but tests help. | |||
example forthcoming. | |||
cbk1090 | masak, okay | 21:42 | |
I would say chapters 3,4,and 5 are good. still would like to see more examples | |||
like the using $userInput.Int to change a user input from prompt into an Int. I learned that the other day here in #perl6. MADE my life soooo much easier!! | 21:44 | ||
masak | cbk1090: here you go -- gist.github.com/2047217 | 21:50 | |
heh, and it took exactly 15 minutes to make :P | |||
cbk1090 | ok I'll take a look at it... | 21:51 | |
masak, so the test is this part: ok cityTaxData.parse('Agoura Hills* 8.750% Los Angeles'); | 21:54 | ||
and is test built into Rakudo Star? | |||
21:54
bruges left,
y3llow left
|
|||
masak | they're made available through Test.pm, which comes with Rakudo the compiler. | 21:55 | |
in fact, Rakudo itself uses Test.pm extensively to run the spectests. | 21:56 | ||
21:56
y3llow joined,
bruges joined
|
|||
cbk1090 | ok I'll try this out... | 21:56 | |
21:58
y3llow left,
y3llow joined
|
|||
cbk1090 | so I get 2 lines of output: "ok 1 -" and "ok 2 -" | 21:59 | |
masak | for the last one? yes. | ||
each ok() call either emits "ok" or "not ok", and then the test number and an optional test description. | 22:00 | ||
cbk1090 | yes on your last example. | ||
22:01
y3llow left
|
|||
masak | the important thing isn't the last example, but more the process of getting there. | 22:01 | |
the tests drive the coding. | |||
22:01
y3llow joined
|
|||
cbk1090 | masak, right I got that part | 22:02 | |
22:03
y3llow left,
y3llow joined
|
|||
cbk1090 | masak, how do you set the test description? | 22:04 | |
masak | just pass a second argument to ok() | ||
or, if you're using is(), a third argument. (since with is() you're testing whether arg1 eq arg2) | |||
cbk1090 | masak, This is the type of stuff that needs to be put into the UsingPerl6 book | 22:07 | |
masak | agree. | ||
I'll see what I can do. | 22:08 | ||
cbk1090 | Thanks masak I have a new toy to play with.... | 22:10 | |
masak++ | |||
masak kowtows | |||
22:11
NamelessTee left
22:20
mj41 left
22:21
localhost joined
22:23
xenu left
|
|||
lichtkind | is the a method alias of S metaop? | 22:29 | |
22:30
NamelessTee joined
|
|||
masak | good question. | 22:30 | |
tadzik | masak++ # a helpy hand | 22:31 | |
masak | it feels like the S metaop is somehow too weird to be captured by a method. | ||
22:31
skids joined,
broquaint joined
|
|||
lichtkind found none in s03 | 22:32 | ||
masak | well, the problem is, something like [+] or R+ simply wraps around the + without changing its behavior. | 22:35 | |
whereas S+ actually reaches into the op and changes its behavior. | |||
bad example. take S&& instead. | 22:36 | ||
but maybe I'm wrong. maybe there's a way to write such a method. | 22:37 | ||
someone, prove me wrong. :) | |||
22:41
ApHeX3211 joined
22:43
bacek_at_work joined
22:46
alester left
22:47
preflex left
22:49
preflex joined,
havenn left
|
|||
gfldex | std: package P { multi sub new(Int $i){}; multi sub new(Int $i, Int $j){}; }; my $foo = P::new(1,2); | 22:49 | |
p6eval | std 1ad3292: OUTPUT«===SORRY!===Undeclared name: 'P::new' used at line 1Potential difficulties: $i is declared but not used at /tmp/rz2CoSLaSb line 1:------> package P { multi sub new(Int ⏏$i){}; multi sub new(Int $i, Int $j){};  $j is declar… | ||
gfldex | nom: package P { multi sub new(Int $i){}; multi sub new(Int $i, Int $j){}; }; my $foo = P::new(1,2); | 22:50 | |
p6eval | rakudo b4caaa: OUTPUT«Could not find symbol 'P::&new' in block <anon> at /tmp/1ry8BsCEo6:1» | ||
gfldex | nom: package P { multi sub newton(Int $i){}; multi sub newton(Int $i, Int $j){}; }; my $foo = P::newton(1,2); | 22:51 | |
p6eval | rakudo b4caaa: OUTPUT«Could not find symbol 'P::&newton' in block <anon> at /tmp/bFnIfTGYvz:1» | ||
gfldex | am i doing something unreasonable? | ||
masak | gfldex: you're expecting symbols to show up in the package namespace, but you're not declaring them with 'our'. | ||
22:52
NamelessTee left
|
|||
masak | gfldex: also, it looks like you're playing OO with packages, which may or may not be unreasonable. | 22:52 | |
22:53
whiteknight joined
|
|||
gfldex | nom: package P { our multi sub newton(Int $i){}; our multi sub newton(Int $i, Int $j){}; }; my $foo = P::newton(1,2); | 22:53 | |
p6eval | rakudo b4caaa: OUTPUT«===SORRY!===Cannot use 'our' with individual multi candidates. Please declare an our-scoped proto insteadat /tmp/pm2zsSAcfo:1» | ||
gfldex | it is very well possible that i'm trying to be clever :) | 22:54 | |
lets see how that works out | |||
masak .oO( and that was the last anyone ever heard of gfldex... ) | 22:57 | ||
gfldex goes x.x | |||
masak | oh no come back I didn't mean it | 22:58 | |
gfldex | nom: sub postfix:<x.x> (Str $who) { die "$who has died. :(" }; # <-- die-operator | 22:59 | |
p6eval | rakudo b4caaa: ( no output ) | ||
masak | how macabre. | 23:00 | |
gfldex | given i just defined it from bejond my grave, i would say so | ||
23:05
ascrazy joined
|
|||
lichtkind | allright did some fine fixes for today | 23:08 | |
masak | lichtkind++ | 23:09 | |
23:13
ksi left
|
|||
lichtkind | masak: had some pretty ugly things like comparsion and others | 23:14 | |
try to day dayly a bit for perl 6 | |||
masak | yeah. | 23:19 | |
...comparison is ugly? | |||
23:22
Chillance left
|
|||
masak | 'night, #perl6 | 23:25 | |
felher | o | 23:30 | |
o/ | |||
23:42
rsimoes left
|