»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
00:00
rindolf left
|
|||
El_Che | [Coke]: news.ycombinator.com/item?id=15625311 | 00:17 | |
[Coke]: ah you meant his source. Got it slightly too late :) | 00:18 | ||
00:22
ryn1x joined
00:30
AlexDaniel` joined,
tadzik joined,
CIAvash[m] joined,
unclechu joined,
mack[m] joined,
tyil[m] joined,
M-Illandan joined,
wamba[m] joined,
wictory[m] joined,
ilmari[m] joined,
Matthew[m] joined,
Garland_g[m] joined,
xui_nya[m] joined
00:31
margeas left
00:36
Cabanossi left
00:39
Cabanossi joined
00:40
mcmillhj left
|
|||
timotimo chimed in on a few of the stackoverflow questions linked to from the weekly | 00:42 | ||
00:48
mr-foobar left,
konsolebox left
00:49
mr-foobar joined
00:52
aborazmeh joined,
aborazmeh left,
aborazmeh joined
00:56
mempko left
00:57
ryn1x left
00:58
darkmorph left,
mcmillhj joined
01:06
cdg_ joined
01:09
cdg left
01:10
mson left
01:11
cdg_ left
01:16
nadim left
01:17
mr-foobar left,
epony left
01:18
epony joined
01:19
mempko joined
01:21
mr-foobar joined,
aindilis joined
01:22
ryn1x joined
01:23
telex joined
01:27
ryn1x left
01:28
ryn1x joined
01:29
troys is now known as troys_
01:31
comborico1611 joined
01:33
ryn1x left,
ryn1x joined
|
|||
comborico1611 | m: my %test = (one => uno, two => dos); | 01:34 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routines: dos used at line 1. Did you mean 'cos'? uno used at line 1. Did you mean 'UNDO'? |
||
comborico1611 | m: my %test = (one => 'uno', two => 'dos'); | 01:35 | |
camelia | ( no output ) | ||
comborico1611 | m: my %test = ('one' => uno, 'two' => dos); | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routines: dos used at line 1. Did you mean 'cos'? uno used at line 1. Did you mean 'UNDO'? |
||
comborico1611 | I see. | 01:36 | |
01:38
ryn1x left
|
|||
geekosaur | => autoquotes the left side on the assumption that it wants to be a string key, but not the right | 01:39 | |
comborico1611 | Hmm. | ||
geekosaur | if you want quoting of both, use a list initializer with <> or <<>> quoting | ||
m: my %test = <one uno two dos>; say %test<two> | 01:40 | ||
camelia | dos | ||
comborico1611 | What about with quoting? | ||
geekosaur | m: my %test = «one "uno una" two dos»; say %test<one> | 01:41 | |
camelia | uno una | ||
geekosaur | although I'm not sure what you're asking tbh | ||
comborico1611 | Weird. I just didn't know what quoting was. I don't think it is discussed in the book I'm reading. | 01:44 | |
I'll check it out on docs. | |||
geekosaur | the docs aren't as easy to understand as they ought to be, when it comes to quoting. you have to search for « » (or the long form << >>, it's hidden under qqww | 01:46 | |
comborico1611 | K. Thanks! | ||
01:49
knight__ left
|
|||
comborico1611 | This one is the craziest: | 01:50 | |
m: my $a = "1 2"; | |||
say qqww{"$a" $a}.perl | |||
camelia | ( no output ) | ||
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/fpPSFKlofK Variable '$a' is not declared at /tmp/fpPSFKlofK:1 ------> 03say qqww{"08⏏04$a" $a}.perl |
||
01:50
unicodable6 left,
unicodable6 joined,
ChanServ sets mode: +v unicodable6
01:51
Cabanossi left
01:53
Cabanossi joined
01:54
kalkin--- joined
01:55
ryn1x joined
01:58
kalkin-- left
|
|||
comborico1611 | m: my @a = 'a' .. 'c'; | 02:05 | |
camelia | ( no output ) | ||
02:14
HoboWithAShotgun left
02:16
BenGoldberg joined
|
|||
geekosaur | m: my $a = "1 2"; say qqww("$a" $a).perl | 02:17 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1) at <tmp>:1 ------> 3my $a = "1 2"; say qqww("$a"7⏏5 $a).perl expecting any of:… |
||
02:17
mcmillhj left
|
|||
geekosaur | m: my $a = "1 2"; say qqww{"$a" $a}.perl | 02:17 | |
camelia | ("1 2", "1", "2") | ||
geekosaur | right, can't do parens there | ||
02:17
mr-foobar left
|
|||
geekosaur | that works much the same way shell quoting does | 02:18 | |
02:18
aindilis left
02:19
mr-foobar joined,
mempko left
|
|||
comborico1611 | What are the braces denoting that the parens aren't? { } Is more subscripty | 02:20 | |
? | |||
geekosaur | if you use parens, it's read as a function call instead of a quote | ||
comborico1611 | I see. | 02:21 | |
geekosaur | m: sub qqww (Str $a) { say "hi, " ~ $a }; qqww("a"); say qqww{"a"} | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Calling qqww() will never work with declared signature (Str $a) at <tmp>:1 ------> 3$a) { say "hi, " ~ $a }; qqww("a"); say 7⏏5qqww{"a"} |
||
comborico1611 | What about with <> instead of braces? | ||
geekosaur | whoops | ||
that would also work | |||
comborico1611 | Brackets? | 02:22 | |
I would type, but I'm on my phone. | |||
geekosaur | the names used for things vary by region, sadly. I use () = parens, [] = brackets. {} = braces | ||
comborico1611 | I use the same. | ||
geekosaur | but lots of places do that differently | ||
02:24
mr-foobar left
|
|||
geekosaur | anyway parentheses are special because anything can be used as a function with them. other paired brackets, or repeated non-paired things (e.g. qqww|foo bar| or even qqww,foo bar,) can be used with it | 02:25 | |
02:25
mson joined
|
|||
comborico1611 | They need a smiley for "went over my head". | 02:27 | |
And I'm losing brain power as the night goes on. | |||
I'm going to rest. Goodnight, geekosaur. | 02:28 | ||
02:29
ryn1x left,
comborico1611 left
02:32
ryn1x joined
02:36
ryn1x left
02:43
yht joined
02:45
ilbot3 left
02:48
piojo joined
02:49
ryn1x joined
02:51
Cabanossi left
02:53
aindilis joined
02:54
Cabanossi joined
02:55
ilbot3 joined,
ChanServ sets mode: +v ilbot3
03:01
ryn1x left
03:05
wander left
03:07
darkmorph joined
03:08
colomon left
03:09
raiph joined
|
|||
raiph | .tell samcv fyi: stackoverflow.com/questions/471422...-in-perl-6 | 03:10 | |
yoleaux | raiph: I'll pass your message to samcv. | ||
03:14
ufobat_ joined
03:17
ufobat left
03:22
noganex_ joined
03:23
colomon joined,
aborazmeh left
03:25
noganex left
03:30
ryn1x joined
03:36
raiph left
03:43
aborazmeh joined,
aborazmeh left,
aborazmeh joined,
ryn1x_ joined
|
|||
ryn1x_ | I just set up a new Ubuntu box and can't install anything with zef... Not sure if it an issue with zef or my new ubuntu install... anyone familiar with this error?: Failed to create directory '/home/ryn1x/.perl6/precomp/531476C94944C40F030060AEB60539343668769B.1510010703.49446/C3' with mode '0o777': Failed to mkdir: 13 | 03:49 | |
geekosaur | 13 is ENOENT. what components of that path exist and what are their permissions? | 03:53 | |
(there's some open moarvm tickets for various failure modes from its mkdir-path) | 03:54 | ||
ryn1x_ | precomp has permissions: drwxrwxr-x | 04:01 | |
that long dir does not exist but others with a similar naming convention fo^Hdo^H^H^Hdo | 04:02 | ||
^H^H^H^H^H^H^H^H^Hdo* | 04:03 | ||
04:03
evalable6 left,
evalable6 joined
|
|||
geekosaur | guess I should have been more explicit | 04:04 | |
(a) permissions includes ownership as the first two rwx mean nothing without knowing the owner/group of the file/dir | |||
(b) permissions in particular of the last component of the path that exists. | |||
04:06
ryn1x_ left,
ryn1x_ joined
04:15
wander joined
|
|||
wander | How about the new `$/`? IIRC old style `method TOP($/)` should be modified for new `$/` | 04:16 | |
04:17
kerframil left,
dugword joined
04:24
ryn1x__ joined
04:25
mcmillhj joined
|
|||
ryn1x__ | geekosaur: the last dir that exists, precomp, has my current user as the owner | 04:26 | |
04:28
eliasr left
04:30
dugword left
04:31
dugword joined,
dugword left
04:32
dugword joined
04:33
mcmillhj left
04:36
Cabanossi left
04:38
Cabanossi joined
04:43
dugword left,
dugword joined
04:56
ryn1x_ left,
ryn1x left
04:57
ryn1x__ left,
darkmorph left
05:01
ryn1x joined,
ryn1x_ joined
05:03
ryn1x__ joined
05:04
ryn1x__ left
05:05
ryn1x__ joined,
ryn1x___ joined
05:06
ryn1x____ joined
05:07
ryn1x____ left,
wander left
|
|||
ryn1x__ | So I just removed the version of rakudo-star that I built from source and installed the packaged version of rakudo and zef works fine now on ubuntu 16.04. | 05:09 | |
05:16
ryn1x__ left
05:36
evalable6 left,
benchable6 left,
unicodable6 left,
statisfiable6 left,
bisectable6 left,
releasable6 left,
bloatable6 left,
nativecallable6 left,
quotable6 joined,
ChanServ sets mode: +v quotable6,
Cabanossi left,
evalable6 joined,
nativecallable6 joined,
ChanServ sets mode: +v evalable6,
ChanServ sets mode: +v nativecallable6,
coverable6 joined,
committable6 joined,
bloatable6 joined,
greppable6 joined,
bisectable6 joined,
releasable6 joined,
ChanServ sets mode: +v bisectable6,
ChanServ sets mode: +v releasable6,
unicodable6 joined,
benchable6 joined,
ChanServ sets mode: +v unicodable6,
squashable6 joined,
statisfiable6 joined
05:37
aborazmeh left
05:38
Cabanossi joined
05:55
ryn1x left,
ryn1x_ left
05:56
ryn1x___ left
06:07
cdg joined
06:12
cdg left
06:13
ryn1x joined
06:17
ryn1x left
06:20
wander joined
|
|||
wander | .ask moritz How about the new `$/`? IIRC old style `method TOP($/)` should be modified for new `$/` | 06:21 | |
yoleaux | wander: I'll pass your message to moritz. | ||
06:23
Gtoi joined
06:25
BenGoldberg left
|
|||
moritz | wander: see github.com/rakudo/rakudo/issues/1235 for a discussion | 06:26 | |
yoleaux | 06:21Z <wander> moritz: How about the new `$/`? IIRC old style `method TOP($/)` should be modified for new `$/` | ||
wander | gotcha | ||
06:29
khw left
06:30
finanalyst joined
|
|||
finanalyst | p6: my @list='name',; say 'name' ne @list | 06:31 | |
camelia | False | ||
finanalyst | shouldn't this be 'True' | ||
p6: my @list='name',; say 'name' ne any @list | |||
camelia | False | ||
finanalyst | forget question | 06:32 | |
06:35
mson left
06:41
Exodist left,
Exodist joined
06:42
Piotr_ joined
06:48
Gtoi left
06:51
ryn1x joined,
ryn1x_ joined,
Cabanossi left
|
|||
wander | .tell [Coke] I find after perl6/Pod-To-HTML#26, you cannot write pod6 inside `=begin Html...=end Html`, this cause messy code at homepage of the doc site | 06:53 | |
yoleaux | wander: I'll pass your message to [Coke]. | ||
06:53
dugword left,
Cabanossi joined
|
|||
wander | .ask [Coke] what do you mean saying "=begin Html doesn't emit raw HTML"? Does it mean that every thing inside Html block should be raw Html code? | 06:54 | |
yoleaux | wander: I'll pass your message to [Coke]. | ||
06:55
ryn1x_ left,
ryn1x left
|
|||
wander | .tell [Coke] if so, then what we should do is remove pod6 code inside Html block of homepage. otherwise, if you mean after parse the code inside, Html block should not add redundant <p> tag, then we can hardcode to remove it, because extra <p></p> is always at both ends of returning Str | 06:57 | |
yoleaux | wander: I'll pass your message to [Coke]. | ||
07:08
nadim joined
07:12
troys_ is now known as troys
07:15
troys left
07:16
lowbro joined,
lowbro left,
lowbro joined
07:21
ryn1x joined
07:22
SAA07KB joined,
ryn1x_ joined
|
|||
wander | well, not only both ends | 07:30 | |
however, the first thing is to make sure which 'raw HTML' we want | 07:32 | ||
07:35
domidumont joined
07:36
abraxxa joined
|
|||
ZzZombo | m: use Data::Dumper;my $m=Match.new;say Dump($m) | 07:36 | |
camelia | ===SORRY!=== Could not find Data::Dumper at line 1 in: /home/camelia/.perl6 /home/camelia/rakudo-m-inst-2/share/perl6/site /home/camelia/rakudo-m-inst-2/share/perl6/vendor /home/camelia/rakudo-m-inst-2/share/perl6 CompU… |
||
ZzZombo | ah come on | ||
ah | 07:37 | ||
m: use Data::Dump;my $m=Match.new;say Dump($m) | |||
camelia | ===SORRY!=== Could not find Data::Dump at line 1 in: /home/camelia/.perl6 /home/camelia/rakudo-m-inst-2/share/perl6/site /home/camelia/rakudo-m-inst-2/share/perl6/vendor /home/camelia/rakudo-m-inst-2/share/perl6 CompUni… |
||
geekosaur | you want dd and it's a built-in | 07:43 | |
or the perl method, likewise | 07:44 | ||
m: my $m = Match.new; dd $m | |||
camelia | Match $m = Match.new(list => (), made => Any, pos => 0, hash => Map.new(()), orig => "", from => 0) | ||
geekosaur | m: my $m = Match.new; say $m.perl | ||
camelia | Match.new(list => (), made => Any, pos => 0, hash => Map.new(()), orig => "", from => 0) | ||
ZzZombo | no, it's unreadable with real Match, and I wanted to see if exception I got with `Data::Dump` is reproducible here. | 07:45 | |
07:45
darutoko joined
|
|||
geekosaur | I don't see a Data.Dump | 07:46 | |
were you trying to use perl 5's Data::Dumper? I'm not sure that would do much with a perl 6 Match object | |||
ZzZombo | No... | ||
07:53
domidumont left
07:54
domidumont joined
07:56
ryn1x_ left,
ryn1x left
07:59
konsolebox joined
08:02
iviv left,
iviv joined
08:05
jonas1 joined,
parv joined
08:10
llfourn left
|
|||
geekosaur | hm. thought so. only reference to Data.Dump I can find is in my IRC logs from back before the GLR. not much chance it would work, if you managed to dig that up from somewhere | 08:12 | |
hasn't been supported in a long time, because it was a workaround for .perl not quite being up to spec back then | |||
08:14
wander left
08:16
census2 left
08:18
finanalyst left
|
|||
lizmat clickbaits p6weekly.wordpress.com/2017/11/06/...tablished/ | 08:22 | ||
moritz | lizmat++ | ||
I wonder if Match.gist should replace newlines with  to increase readability | 08:23 | ||
nine | This is hilarious. So it takes a StackOverflow survey that finds that Perl is the most hated programming language to get a HackerNews page where people practically speak absolutely positively about Perl. | 08:26 | |
yoleaux | 6 Nov 2017 23:22Z <azawawi> nine: Could you please take a look at the rakudo heap corruption bug when setting size to beyond 10k elements github.com/azawawi/perl6-msgpack/b...sgpack.pl6 . Thanks | ||
08:27
rindolf joined
|
|||
lizmat | nine: yeah, I found that quite ironic as well :-) | 08:27 | |
Geth | doc: c1a8cd230e | (Alex Chen)++ (committed using GitHub Web editor) | doc/HomePage.pod6 Convert Z<> into <!----> To clean messy code in homepage. Besides, code within Html block is assumed to be raw HTML. If want to mix up pod6 and HTML in one file, separate them into different blocks. |
08:32 | |
nine | Same is apparently true for reddit. | ||
08:48
aeruder joined
08:53
ryn1x joined,
ryn1x_ joined,
ryn1x__ joined,
dugword joined
08:55
dakkar joined
|
|||
holyghost | timotimo : here's what I started of my simple game kit, pastebin.com/BzEGZfGc | 08:57 | |
08:58
gfldex joined,
dugword left
|
|||
Geth | Pod-To-HTML/emit-raw-HTML: 8d497c2893 | (Alex Chen)++ (committed using GitHub Web editor) | lib/Pod/To/HTML.pm Html block contains raw HTML code *Everything* within a Html block is assuming raw HTML. Because of the implementation, pod6 syntax will be removed, only its raw text remind. That is, C<code> -> code. To write C<> within Html block, you can use C&lt;&> ... (17 more lines) |
08:59 | |
Pod-To-HTML: W4anD0eR96++ created pull request #28: Html block contains raw HTML code |
09:00 | ||
holyghost | Some bot should do a timezone based upcon connects and talking, I am not going to write it :-) | 09:05 | |
09:10
holyghost left
09:11
holyghost joined
09:21
robertle joined
|
|||
nine | .tell azawawi Can't. MsgPack fails its tests on installation: Cannot look up attributes in a MsgPack::Native::msgpack_object type object in method type at /home/nine/.zef/store/perl6-msgpack.git/6c0c3228ef6859a6879c482e846c5ea8942f77cf/lib/MsgPack/Native.pm6 (MsgPack::Native) line 189 | 09:22 | |
yoleaux | nine: I'll pass your message to azawawi. | 09:23 | |
09:26
ryn1x_ left,
ryn1x left
09:27
ryn1x__ left
09:28
eliasr joined
09:30
sena_kun joined
09:31
labster left
09:33
HoboWithAShotgun joined,
rgrau joined
09:34
wander joined
|
|||
wander | hey all, any advice on typing unicode such like « and » quickly? especially on mac | 09:38 | |
09:38
azawawi joined
|
|||
azawawi | hi | 09:38 | |
yoleaux | 09:23Z <nine> azawawi: Can't. MsgPack fails its tests on installation: Cannot look up attributes in a MsgPack::Native::msgpack_object type object in method type at /home/nine/.zef/store/perl6-msgpack.git/6c0c3228ef6859a6879c482e846c5ea8942f77cf/lib/MsgPack/Native.pm6 (MsgPack::Native) line 189 | ||
azawawi | nine: did you try to install it via zef? what's your dev environment? | 09:39 | |
lizmat | wander: docs.perl6.org/language/unicode_entry | 09:40 | |
09:41
parv left
|
|||
nine | azawawi: Rakudo version 2017.10-125-g360eb2289 built on MoarVM version 2017.10-56-g68f04144a, zef commit fb9a8bda156e | 09:42 | |
azawawi | nine: what's your libmsgpack version? it is printed in t/002-version.t | 09:43 | |
wander | lizmat: oh we have it, thanks ^_^ | ||
nine | azawawi: libmsgpackc2-2.1.2-1.2.x86_64 | 09:45 | |
azawawi | nine: if you can provide a full tests gist/pastebin... i know it fails on 1.4.2 but 2.1.2 that's new. I tested against it earlier. | 09:49 | |
09:51
eythian joined,
eythian left,
eythian joined
09:56
wander left
10:06
yht left
|
|||
nine | azawawi: gist.github.com/niner/deda3a8c239c...5a234449ca | 10:09 | |
10:09
gfldex left
10:10
Grimy joined
|
|||
Grimy | p6: say CHECK now - BEGIN now; sub circumfix:«` `» { @_ }; `42` xx 1 | 10:11 | |
camelia | 1.3288373 | ||
Grimy | Should this be considered a perf bug? | ||
jnthn | Well, custom operators need to calculate a new lexer. That said, I'm not immediately sure why a circumfix costs so much more than, say, a postfix | 10:15 | |
10:15
gfldex joined
10:16
domidumont left
|
|||
moritz | because they match in term position? | 10:17 | |
and there are more possible terms than postfixes, I'd assume | |||
jnthn | True, but (unless this got optimized some) I thought the whole lexer was re-calculated (lazily and on demand, though) | 10:18 | |
10:18
ryn1x joined,
ryn1x_ joined,
ryn1x__ joined,
domidumont joined
|
|||
moritz | I thought each DFS is re-calculate as needed, but then I'm not deep into that code | 10:19 | |
*DFA | |||
10:22
Cabanossi left,
yht joined
10:23
ryn1x__ left,
ryn1x_ left,
ryn1x left,
Cabanossi joined
10:24
Cabanossi left
10:25
Cabanossi joined
10:29
wander joined
|
|||
wander | Anyone familiar with Pod::To::HTML please tell me why this line need `unescape_html`? | 10:30 | |
github.com/perl6/Pod-To-HTML/blob/...ML.pm#L351 | |||
If we assume text with a Html block is raw HTML, then there is no reason to unescape. | 10:32 | ||
With unescape action, when we want to type <(raw), it should be &lt;, looks stupid | 10:33 | ||
10:40
ZzZombo left
10:42
domidumont left
10:44
ZzZombo joined
10:46
domidumont joined
10:49
ZzZombo1 joined
10:50
ryn1x joined,
ryn1x_ joined,
ryn1x__ joined
10:52
ZzZombo left,
ZzZombo joined
10:53
ZzZombo1 left
10:54
ZzZombo1 joined
10:57
ZzZombo left
11:12
eugene_barsky joined
|
|||
eugene_barsky | hi | 11:12 | |
How to merge two ranges? | |||
I want smth like .say for 1..10 20..30 | |||
jnthn | m: .say for flat 1..10, 20..30 # like this? | 11:13 | |
camelia | 1 2 3 4 5 6 7 8 9 10 20 21 22 23 24 25 26 27 28 29 30 |
||
jnthn | m: .say for (1..10).min .. (20..30).max # or like this? | ||
camelia | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
||
eugene_barsky | thanks! I've done it with flat but thought it should be done easier... | 11:14 | |
Then I'll stick to this method. | 11:15 | ||
11:21
Cabanossi left,
ChoHag left
11:23
Cabanossi joined
|
|||
Ulti | eugene_barsky: how about this: sub merge(Range $a, Range $b) returns Range { return min($a, $b).min .. max($a, $b).max } | 11:24 | |
merge might not be the best name there | |||
11:24
yht left
|
|||
Ulti | obviously if the two ranges are disjoint it doesn't account for that | 11:24 | |
11:25
ryn1x left,
azawawi left,
ryn1x__ left,
ryn1x_ left
11:26
cog_ joined
|
|||
wander | m: (1..10).&flat: (20..30) # if you like "infix"(fake) | 11:27 | |
camelia | ( no output ) | ||
wander | m: say (1..10).&flat: (20..30) # if you like "infix"(fake) | ||
camelia | (1 2 3 4 5 6 7 8 9 10 20 21 22 23 24 25 26 27 28 29 30) | ||
11:27
ChoHag joined
|
|||
wander | otherwise I think flat (1..10), (20..30) is concise enough | 11:28 | |
11:29
cognominal left
11:30
HoboWithAShotgun left
11:31
zakharyas joined
11:32
philomath_ joined
|
|||
wander | m: multi sub infix:<+> (Range $a, Range $b) { flat $a.flat, $b.flat }; .say for $a + $b; # or user-defined | 11:36 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$a' is not declared at <tmp>:1 ------> 3$b) { flat $a.flat, $b.flat }; .say for 7⏏5$a + $b; # or user-defined |
||
Ulti | is the idea to just represent the two ranges? I thought the idea was to have an encompassing single range | ||
surely just a list of ranges is fine | 11:37 | ||
in the case they are disjoint, the thing then becomes you want an iterator for that thing | |||
RangeList that's iterable job done? | |||
wander | m: multi sub infix:<+> (Range $a, Range $b) { flat $a.flat, $b.flat }; .say for (1..10) + (20..30); | ||
camelia | 1 2 3 4 5 6 7 8 9 10 20 21 22 23 24 25 26 27 28 29 30 |
||
wander | m: multi sub infix:<,> (Range $a, Range $b) { flat $a.flat, $b.flat }; .say for (1..10) , (20..30); | 11:38 | |
camelia | 1 2 3 4 5 6 7 8 9 10 20 21 22 23 24 25 26 27 28 29 30 |
||
Ulti | wander ok now I give you 1..10, 1..Inf | ||
might be a legit reason like some minus numbers then all natural numbers | |||
11:40
Aaronepower left
11:42
llfourn joined
11:45
HoboWithAShotgun joined
|
|||
Geth | Pod-To-HTML/emit-raw-HTML: c73c0a3530 | (Alex Chen)++ (committed using GitHub Web editor) | lib/Pod/To/HTML.pm Update HTML.pm |
11:49 | |
wander | m: 2 (elem) 1..10 | 11:51 | |
camelia | WARNINGS for <tmp>: Useless use of "(elem)" in expression "2 (elem) 1.." in sink context (line 1) |
||
wander | m: say 2 (elem) (1..10) | ||
camelia | True | ||
11:52
Cabanossi left
11:53
Cabanossi joined
|
|||
ilmari | m: say 2 ∊ (1..10) | 11:55 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Confused at <tmp>:1 ------> 3say 27⏏5 ∊ (1..10) expecting any of: infix infix stopper postfix statement end statement modifier … |
||
ilmari | unicodable6: ∊ | ||
unicodable6 | ilmari, U+220A SMALL ELEMENT OF [Sm] (∊) | ||
ilmari | m: say 2 ∈ (1..10) | ||
camelia | True | ||
ilmari | unicodable6: element of | ||
unicodable6 | ilmari, U+2208 ELEMENT OF [Sm] (∈) | ||
ilmari, U+2209 NOT AN ELEMENT OF [Sm] (∉) | |||
ilmari, 13 characters in total (∈∉∊⋲⋳⋴⋵⋶⋷⋸⋹⟒⫙): gist.github.com/8d19988fa214affdd7...cbe7d28bc9 | |||
12:06
margeas joined
12:07
wamba joined,
sproctor joined
|
|||
HoboWithAShotgun | m: my @a = 1, 2, 3; say 3|4 ∈ @a; | 12:11 | |
camelia | any(True, False) | ||
HoboWithAShotgun | m: my @a = 1, 2, 3; say "true" if 3|4 ∈ @a; | ||
camelia | true | ||
HoboWithAShotgun | m: my @a = 1, 2, 3; say "true" if 0|4 ∈ @a; | 12:12 | |
camelia | ( no output ) | ||
HoboWithAShotgun | m: my @a = 1, 2, 3; say "true" if 1|2 ∈ @a; | ||
camelia | true | ||
HoboWithAShotgun | very nice | ||
12:12
philomath_ left
12:13
ChoHag left,
philomath_ joined
12:16
steeznson joined
|
|||
wander | m: grammar { token TOP { <atok> { if $<atok> ~~ /^b/ { make 42; } }} token atok { \w+ } }.parse("abcd").made; | 12:18 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Strange text after block (missing semicolon or comma?) at <tmp>:1 ------> 3ok> { if $<atok> ~~ /^b/ { make 42; } }}7⏏5 token atok { \w+ } }.parse("abcd").made expecting any of: … |
||
wander | m: grammar G { token TOP { <atok> { if self.match($/) { make 42; } }}; token atok { \w+ }; method match($m) { ($m<atok>) ~~ (/^a/) } }.parse("abcd").made.say; | ||
camelia | 42 | ||
steeznson | hello all! I am looking for a project idea using regular expressions that I can use to explore grammars in perl 6. I've been thinking about a crossword clue solver but I'd love to hear some suggestions. | ||
wander | parser of a subset of C(or any other language) | 12:19 | |
12:19
ChoHag joined
|
|||
jast | convert one syntax to another | 12:19 | |
wander | that is it | 12:20 | |
jast | e.g. JSON to XML, something like that | ||
steeznson | ah these are good thanks | ||
are the official docs still the best reference point for grammars? | 12:21 | ||
jast | another one, write something that scrapes and parses websites and extracts information from them. of course there are already libraries to do that, but it's a nice and not all too simple thing to play with | ||
wander | by the way, our docs of grammar is a little lack, if having question, welcome to here | ||
no :( | |||
steeznson | ah well thanks for the ideas and advice, i'll be back if I get stuck. | ||
wander | many, many traps/features are not documented yet | 12:22 | |
jast | well, I've written stuff involving grammars based on the docs, so I'd say it's possible at least :) | ||
12:22
rgrau left
|
|||
wander | maybe the best for now :P | 12:23 | |
12:24
ryn1x joined,
ryn1x_ joined,
ryn1x__ joined
|
|||
wander | m: grammar { token TOP { <atok> { if self.match($/) { make 42; } }}; token atok { \w+ }; method match($/) { ($<atok>) ~~ (/^a/) } }.parse("abcd").made.say; | 12:25 | |
camelia | Cannot assign to a readonly variable ($/) or a value in method match at <tmp> line 1 in regex TOP at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
wander | huh, this's the new $/ | 12:26 | |
m: grammar { token TOP { <atok> { if $/<atok> ~~ /^a/ { make 42; } }}; token atok { \w+ } }.parse("abcd").made.say; | 12:27 | ||
camelia | Nil | ||
wander | This may be the second worst trap when I was building a miniC parser. | 12:29 | |
nine | steeznson: you could write a parser for some configuration file format. Could then be used as basis for a configuration tool. I've done this e.g. for Apache and nginx config files and used it for a converter from Apache to nginx. | 12:30 | |
12:32
holyghost2 joined
|
|||
steeznson | that's a nice idea, could actually save me a lot of time with nginx in the future | 12:33 | |
wander | rules, which auto-enable :sigspace, maybe causes confusing result too | 12:34 | |
only using rules in trivial case would help | 12:35 | ||
other cases use `token` to make sure it does what you want | |||
p6's grammar(github.com/rakudo/rakudo/blob/mast...ammar.nqp) uses much more tokens than rules | 12:38 | ||
12:39
ChoHag left
12:40
ChoHag joined
12:47
dugword joined
12:50
philomath_ left
12:52
dugword left
12:58
abraxxa left,
pmurias joined,
ryn1x left,
ryn1x__ left,
ryn1x_ left
12:59
abraxxa joined,
MasterDuke left
13:00
aborazmeh joined,
aborazmeh left,
aborazmeh joined,
Grimy left
13:02
darkmorph joined
13:03
eugene_barsky left,
census2 joined
|
|||
census2 | I'm trying to figure out the download option at another website, and I'm wondering if someone can please help me | 13:03 | |
www.clinicaltrials.gov/ct2/results...amp;fund=3 | |||
pmurias | is there a way to remove a webhook from the github UI? | 13:05 | |
13:05
steeznson left
13:06
lizmat joined
|
|||
pmurias | ahh, I just don't have the permission to get to the settings tab on the perl6/nqp repo | 13:06 | |
13:07
konsolebox left
|
|||
[Coke] | pmurias: what do you need removed? | 13:09 | |
yoleaux | 06:53Z <wander> [Coke]: I find after perl6/Pod-To-HTML#26, you cannot write pod6 inside `=begin Html...=end Html`, this cause messy code at homepage of the doc site | ||
06:54Z <wander> [Coke]: what do you mean saying "=begin Html doesn't emit raw HTML"? Does it mean that every thing inside Html block should be raw Html code? | |||
06:57Z <wander> [Coke]: if so, then what we should do is remove pod6 code inside Html block of homepage. otherwise, if you mean after parse the code inside, Html block should not add redundant <p> tag, then we can hardcode to remove it, because extra <p></p> is always at both ends of returning Str | |||
13:09
census joined
|
|||
census | hi <[Coke]> | 13:09 | |
[Coke] | o/ | 13:10 | |
El_Che | Hi [Coke] | 13:12 | |
13:12
ChoHag left
|
|||
census2 | did you catch my posting before? i'm trying to work with a different website. i'm not sure if it has an API, but it has a .csv. However, I'm struggling to figure out the link to the .csv | 13:12 | |
13:13
konsolebox joined
|
|||
pmurias | [Coke]: the appveyor web hook for the nqp repo | 13:13 | |
[Coke]: it's just marking commits as failing | |||
[Coke] | pmurias: there are two appveyor links. | 13:14 | |
... and they appear to be identical? (double checking...) | 13:15 | ||
so yes, there are 2 things setup to push to PRs&pushes to appveyor. | 13:16 | ||
13:19
atta left
|
|||
[Coke] | census2: Sorry, I've not got a lot of time to help you with the project. | 13:26 | |
pmurias | [Coke]: I guess those appveyor web hooks are causing false fails | 13:33 | |
13:33
Piotr_ left
|
|||
[Coke] | but in general, I find dev tools on chrome invaluable for something like this; showing me what resources are going into making the page, and perhaps you can write something to scrape what they're doing. But I would suggest that if you're doing this for a job, that you talk to the website providing the data - they might have an API or some other way for you to get the data you're looking for. | 13:35 | |
13:38
ChoHag joined
13:39
abraxxa left
13:40
konobi joined,
mson joined,
konobi is now known as Guest88378,
Guest88378 is now known as konobi_
13:41
aborazmeh left,
mcmillhj joined
13:43
wander left
13:44
ryn1x joined,
ryn1x_ joined,
ryn1x__ joined,
ChoHag left
|
|||
[Coke] | pmurias: ok, I deleted them. | 13:45 | |
13:47
cog_ left
13:48
ryn1x__ left,
ryn1x_ left,
ryn1x left,
rgrau joined
13:49
wander joined
13:51
cdg joined
|
|||
ZzZombo1 | Hey, how can I use default value if no type was passed, but otherwise use that type instead? `x //= default` doesn't work for obvious reasons. | 13:51 | |
13:51
Cabanossi left
13:53
Cabanossi joined
|
|||
lizmat | ZzZombo1: not sure what you mean, but what's wrong with: | 13:53 | |
m: sub a($a = Str) { dd $a }; a; a Int | |||
camelia | Str $a = Str Int $a = Int |
||
ZzZombo1 | this is an inline code block though, no argument list | 13:54 | |
lizmat | m: my $a = -> $b = Str { dd $a }; $a(); $a(Int) | 13:56 | |
camelia | Block $a = -> $b = Str { #`(Block|65632864) ... } Block $a = -> $b = Str { #`(Block|65632864) ... } |
||
lizmat | m: my $a = -> $b = Str { dd $b }; $a(); $a(Int) | ||
camelia | Str $b = Str Int $b = Int |
||
13:56
abraxxa joined
|
|||
lizmat | a sub is mostly just a block with a name and place to return from | 13:56 | |
13:58
holyghost2 left,
isidoro joined
13:59
isidoro left
14:01
ChoHag joined
|
|||
census | hi wander | 14:02 | |
wander | hi | ||
census | i'm struggling with just 1 line of code. the line with my @terms from the .txt file produces an error. however, when i manually do it, there's no error: paste.ubuntu.com/25911080/ | 14:06 | |
error is: pastebin.com/pBHxg3BW | 14:07 | ||
14:09
HoboWithAShotgun left
|
|||
wander | () | 14:09 | |
perlpilot | census: well ... what's different about when you do it "manually" versus when the program does it? | 14:11 | |
14:12
ZzZombo1 is now known as ZzZombo
|
|||
census | perlpilot that 1 line of code | 14:12 | |
wander | maybe try adding some () | ||
14:12
ZzZombo is now known as Guest56405
14:13
Guest56405 left,
Guest56405 joined,
konsolebox left
|
|||
Guest56405 | lizmat: well, but what if I also have another place where I have such a parameter coming from a hash? | 14:13 | |
wander | installing dependency.. | 14:14 | |
14:14
Guest56405 is now known as ZzZombo
|
|||
perlpilot | census: whenever I get into a position where something seemingly innocuous is causing breakage in my code, I go back to first principles and question everything I think I know to get to the bottom of it. So ... start questioning what's in @terms and what is the actual URL that gets passed to get | 14:14 | |
14:15
ryn1x joined
14:16
ryn1x_ joined
14:17
ryn1x__ joined,
comborico1611 joined
|
|||
wander | agree | 14:18 | |
I've tested the code, no syntax miss | |||
so it's quite probably that the URL is wrong | 14:19 | ||
14:20
tholyghos joined,
tholyghos is now known as holyghost2
14:21
konsolebox joined
|
|||
wander | delete that line and dd/say what exactly the URL is. | 14:21 | |
census | wander i figured out the issue | 14:24 | |
when there's zero hits and thus no spreadsheet it produces a 404 error | |||
i'm not sure if there's a way to circumvent 404 type errors and just assign them to be a 0 ? | 14:25 | ||
wander | m: my $s; (try $s = die) orelse ($s =42); say $s | 14:27 | |
camelia | 42 | ||
perlpilot | census: there's 0 hits for ALS? That's strange :) | ||
census | no not ALS | ||
perlpilot 0 hits for a different one | |||
207 hits for ALS | |||
i have an idea | 14:28 | ||
maybe i can do something like this: www.clinicaltrials.gov/ct2/results...amp;fund=3 | |||
so i search for 2 diseases no matter what. and just subtract out the results of ALS each time | |||
perlpilot | census: or ... check the result of the get and only spurt if you don't get a 404 (or, better, only spurt if you get a 2xx) | 14:30 | |
census | perlpilot how would i do that? | ||
perlpilot | according to the docs, get returns Failure if the request fails or doesn't return a 2xx HTTP code. So ... check for Failure. | 14:32 | |
(or non-Failure really :-) | |||
14:32
lizmat left
|
|||
census | perlpilot where do you see this? like there's a value stored in the get ? | 14:33 | |
comborico1611 | Who is the caller of function2 in this statement? my %hash = function1 function2 'string' ; | ||
perlpilot | census: I just read the README for WWW | ||
moritz | comborico1611: your own code | 14:34 | |
comborico1611 | The statement is the caller? | ||
moritz | yes | ||
14:34
raschipi joined
|
|||
comborico1611 | Okay. Thank you. | 14:34 | |
moritz | this is like my \temp1234 = function2 'string; function1 temp1234 | ||
comborico1611 | Oh. | 14:35 | |
census | perlpilot where are you reading this exactly at github.com/zoffixznet/perl6-WWW ? | 14:36 | |
perlpilot | census: scroll down to where it says "EXPORTED ROUTINES". There's an example for get and the paragraph immediately following says "Returns Failure if request fails or does not return a successful HTTP code." | 14:43 | |
census | perlpilot where is that stored? | 14:44 | |
perlpilot | census: color me confused now. What do you mean "stored"? | ||
14:44
kaare_ joined
|
|||
perlpilot | census: you either get back a Str or a Failure. It's up to you to check and decide what to do | 14:45 | |
census | perlpilot i don't really understand how this code would go down. is there a variable to which the 'failure' string is stored? | ||
cause then i'll write an if statement that's something like if (x=='failure') results = 0; else { } | |||
perlpilot | ah ... It's not a string. It's a Failure *type*. So, you might say something like my $result = get "..."; if $result.isa(Failure) { ... } else { ... } | 14:47 | |
comborico1611 | What is a group of s | 14:48 | |
Opp. | |||
14:48
ryn1x left
14:49
ryn1x__ left,
ryn1x_ left
|
|||
comborico1611 | What is a group of characters containing a value called? Example, $[ "a", "b", "c" ]. (This expression is occurring within a hash.) | 14:50 | |
A group of characters contained in a variable. | |||
moritz | an array? | ||
comborico1611 | Hmm. Let me look at the code some more and see if an array was declared.. | 14:51 | |
perlpilot | .tell Zoffix you might want to include a couple of sad-path examples in WWW | ||
yoleaux | perlpilot: I'll pass your message to Zoffix. | ||
comborico1611 | I don't see an array. Do hashes automatically create arrays? | ||
moritz | there's autovivification | 14:52 | |
comborico1611 | The situation is where there are multiple values for a single key. | ||
moritz | m: my %h; %h<a>.push: 'x'; say %h.perl | ||
camelia | {:a($["x"])} | ||
comborico1611 | lol. That sounds like a Catholic term. | ||
moritz | m: my %h; %h<a><b> = 'x'; say %h.perl; # autovivifies a second-level hash | 14:54 | |
camelia | {:a(${:b("x")})} | ||
census | perlpilot thanks! that is totally working for the 0 cases of 404 errors; however, now i'm no longer getting correct answers for the ones that were previously correct | 14:56 | |
comborico1611 | This doesn't look like what is going on. Yours looks like different kind of manipulation. I'll type the code in a minute. | ||
14:57
comborico joined
|
|||
comborico | This is the most code I've typed in here. So, hopefully I get it right. It is kind of strung-out over a few pages in the book. | 14:58 | |
holyghost2 | Is there someone who wants to comment on my module, I've sent it to [email@hidden.address] it's at gomez.yellowcouch.org/holly6src-1.3.tar.gz ? | ||
15:00
zakharyas left
15:01
neilb joined
|
|||
comborico | m: sub histogram(Str $string) { my %histo; for $string.comb -> $letter { %histo[$letter]++; }; return %histo; }; sub invert-hash( %in-hash) { my %out-hash; for %in-hash.kv -> $key, $val { push %out-hash{$val}, $key; }; return %out-hash; }; my %rev-hist = invert-hash histogram 'parrot' ; say %rev-hist; dd %rev-hist; | 15:01 | |
camelia | Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5p' (indicated by ⏏) in sub histogram at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
census | perlpilot how do i do the spurt correctly? paste.ubuntu.com/25911355/ | 15:02 | |
15:02
holyghost2 left
|
|||
raschipi | comborico: use a pastebin next time | 15:03 | |
15:03
tholyghos joined,
tholyghos is now known as holyghost2
15:06
lizmat joined
|
|||
comborico | m: sub histogram( Str $string ) { my %histo; for $string.comb -> $letter { %histo{$letter]++; }; return %histo; }; sub invert-hash( %in-hash ) { my %out-hash; for %in-hash.kv -> $key, $val { push %out-hash{$val}, $key; }; return %out-hash; }; my %rev-hist = invert-hash histogram 'parrot' ; say %rev-hist; dd %rev-hist; | 15:07 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in subscript; couldn't find final '}' (corresponding starter was at line 1) at <tmp>:1 ------> 3$string.comb -> $letter { %histo{$letter7⏏5]++; }; return %histo; }; s… |
||
comborico | m: sub histogram( Str $string ) { my %histo; for $string.comb -> $letter { %histo{$letter}++; }; return %histo; }; sub invert-hash( %in-hash ) { my %out-hash; for %in-hash.kv -> $key, $val { push %out-hash{$val}, $key; }; return %out-hash; }; my %rev-hist = invert-hash histogram 'parrot' ; say %rev-hist; dd %rev-hist; | 15:08 | |
camelia | {1 => [p a o t], 2 => [r]} Hash %rev-hist = {"1" => $["p", "a", "o", "t"], "2" => $["r"]} |
||
15:09
ryn1x joined
|
|||
comborico | So there at "1" => $[ ] what is the value variable ($) called that holds multiple characters? | 15:09 | |
census | thanks perlpilot!! it works :) | ||
comborico | Heh, yeah! | 15:10 | |
moritz | comborico: the [] is an array | ||
15:10
holyghost2 left
|
|||
moritz | and the $ just puts it into scalar context | 15:10 | |
comborico | So the hash DOES automatically create arrays, right? | ||
moritz | the push does | ||
that's the autovification | 15:11 | ||
ilmari | m: my $foo = 42; push $foo, 37; say $foo; | ||
comborico1611 | Oh. Very good. Thank you. | ||
camelia | Cannot resolve caller push(Int: Int); none of these signatures match: (Any:U \SELF: |values is raw) in block <unit> at <tmp> line 1 |
||
ilmari | m: my $foo; push $foo, 37; say $foo; psuh $foo, 42; say $foo; | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: psuh used at line 1. Did you mean 'push'? |
||
ilmari | m: my $foo; push $foo, 37; say $foo; push $foo, 42; say $foo; | ||
camelia | [37] [37 42] |
||
comborico1611 | I see. | 15:12 | |
15:14
ryn1x left
|
|||
comborico1611 | raschipi, yeah. I should have just type it in a text editor. Pastebin, right? | 15:15 | |
raschipi | any pastebin or gist will do | 15:16 | |
comborico1611 | We're speaking of text editors, though, right? | ||
I would get rakudo moar on my system, but i have an older machine upstairs here that i prefer to use older OS. | 15:18 | ||
I didn't want to chance using parrot because of unknown incongruities. | |||
Is incongruencies or autovivification the word out the day? | 15:21 | ||
jdv79 | is it correct that die'ing in a thread won't print the error? | 15:25 | |
switching to warn and i see it... | |||
jnthn | Define "in a thread" | ||
m: Thread.start({ die "oops" }).join | 15:26 | ||
camelia | No exception handler located for catch at SETTING::src/core/Exception.pm:57 (/home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.setting.moarvm:throw) from SETTING::src/core/control.pm:178 (/home/camelia/rakudo-m-inst-2/share/perl6/runtim… |
||
jdv79 | in a start block | ||
jnthn | Oh | ||
tyil | comborico1611: even with an older OS you can try rakudobrew | ||
jdv79 | i threw a CATCH { default { die $_ } } to debug something and that never printed | ||
jnthn | Sure, well start returns a Promise | 15:27 | |
comborico1611 | Thank you. I'll look into that! | ||
jnthn | Which will be broken | ||
But if you never await it anywhere then (a) the work may not run to completion before the program ends, and (b) nothing will receive the exception | |||
ilmari | m: start { die "aiee" }.result | ||
camelia | Tried to get the result of a broken Promise in block <unit> at <tmp> line 1 Original exception: aiee in block at <tmp> line 1 |
||
jdv79 | oh ok | 15:28 | |
ilmari | m: await start { die "aiee" } | ||
camelia | An operation first awaited: in block <unit> at <tmp> line 1 Died with the exception: aiee in block at <tmp> line 1 |
||
jnthn | For 6.d, I've been pondering having a start block that is in sink context automatically do a .then(...) that will pull the program down though | ||
(If there's an exception) | |||
15:36
lizmat left
15:41
callyalater joined
15:42
wamba left
15:44
bwisti joined
15:47
Exodist left
15:48
ryn1x_ joined,
ryn1x joined,
ryn1x__ joined,
Exodist joined
15:49
cdg left,
troys joined
15:50
cdg joined
15:51
Cabanossi left
|
|||
callyalater | m: my $index = 0; say 'abcdefghij'.subst: /./, 'A', :nth($index+1); $index = 3; say 'abcdefghij'.subst: /./, 'A', :nth($index+1); | 15:51 | |
camelia | Abcdefghij abcAefghij |
||
15:53
Cabanossi joined
15:54
cdg left
15:56
mempko joined
15:58
khw joined
16:10
lowbro left
16:22
Cabanossi left,
ryn1x__ left,
ryn1x_ left,
ryn1x left
16:23
Cabanossi joined
16:33
raschipi left,
philomath_ joined,
jonas1 left
16:36
darkmorph left
16:40
philomath_ is now known as philomath
16:42
wamba joined
16:47
lizmat joined
16:51
Kharec joined,
Kharec left
16:52
troys is now known as troys_
16:53
philomath left
16:54
ryn1x joined,
ryn1x_ joined,
abraxxa left,
ryn1x__ joined,
sftp joined
16:58
ryn1x__ left,
ryn1x_ left,
ryn1x left
16:59
darkmorph joined
17:00
domidumont left
17:02
neilb left,
sftp left
|
|||
comborico1611 | tyil, can you send me a link of where to download a . deb for rakudobrew for Ubuntu 14? A search did not produce. | 17:02 | |
tyil | I dont think there's debs of it, you just clone the repo and run the script(s) | 17:03 | |
comborico1611 | Are roles done previously in any other programming language? | ||
tyil | github.com/tadzik/rakudobrew | ||
comborico1611 | Ty! | ||
(my other question is completely unrelated to what we're talking about.) | 17:04 | ||
ilmari | comborico1611: yes, they originated in Self (called Traits) in 1982 | ||
en.wikipedia.org/wiki/Trait_(compu..._languages | |||
dl.acm.org/citation.cfm?doid=966873.806468 # the original Traits paper | 17:05 | ||
17:05
census2 left
|
|||
comborico1611 | Thank you. | 17:05 | |
17:06
cdg_ joined,
sftp joined
17:07
cdg_ left,
cdg_ joined,
mcmillhj left
17:09
rgrau left
17:11
mcmillhj joined,
sftp left
17:12
sftp joined
17:13
setty1 joined,
sftp left,
sftp joined
17:15
imcsk8 left
17:16
mcmillhj left
17:19
zakharyas joined
17:20
sproctor left,
imcsk8 joined
17:21
cdg joined
|
|||
Ulti | I just had a great idea for how to not do an ORM in Perl 6, just have SQL native in the language which abstracts the SQL :S then if the grammar doesnt match you assume someone is putting in some SQL literal at that point | 17:21 | |
job done | 17:22 | ||
everyone is happy | |||
and I dont have to suffer your obscure as hell method chaining verbage thats different between every orm and every programming language | |||
17:24
cdg_ left
17:27
troys_ is now known as troys
17:31
comborico left
|
|||
AlexDaniel | Ulti: by the way, have you seen github.com/tony-o/perl6-slang-sql ? | 17:33 | |
17:33
darkmorph left
17:36
Cabanossi left
17:38
Cabanossi joined,
mcmillhj joined
17:39
sftp left,
sftp joined
17:42
ryn1x joined,
ryn1x_ joined,
ryn1x__ joined
17:43
mcmillhj left,
dakkar left
17:46
mcmillhj joined
17:47
zakharyas left
17:50
domidumont joined
17:51
domidumont left
17:53
Exodist left
17:54
Exodist joined
|
|||
[Coke] | I have never worked on a project where something other than raw SQL was preferable. I'm amazed when people find it helpful. | 17:55 | |
it==ORM | |||
18:01
darkmorph joined
18:02
Exodist left
18:03
neilb joined
18:04
Exodist joined
18:07
Cabanossi left
18:08
Cabanossi joined
18:10
Exodist left
18:11
Exodist joined
18:16
ryn1x__ left,
ryn1x_ left,
ryn1x left,
comborico1611 left
|
|||
timotimo | perhaps it's there to allow the ORM itself to more easily make sense of the results that are coming back? | 18:17 | |
18:18
Exodist left
|
|||
timotimo | if you have a raw sql string it'd have to parse the sql itself to find out what it's doing, if you build the query with methods or whatever the orm will know first-hand and can generate the sql at the same time | 18:18 | |
i haven't used orms much, though. i think the only orms i've tried were django's own one and sqlalchemy - though django has sqlalchemy now, i believe? | 18:19 | ||
timotimo bbl | |||
18:20
neilb left,
Exodist joined
|
|||
hahainternet | [Coke]: they are often useful, i can give you many examples if you care for them | 18:26 | |
mspo | eh in php world I encounter tons of ad-hoc sql based on partial strings | 18:28 | |
and it's quite some spaghetti | |||
ilmari finds DBIx::Class helpful when dealing with ~600 tables and ~1k foreign key relationships across ~20 schemas | |||
several of those being compound foreign keys | |||
hahainternet | yes dbic is quite nice | ||
ilmari | and some of the schema not being terribly well designed | ||
hahainternet | django's ORM is acceptable also | ||
i wrote a translation layer from that to golang | |||
in order to get performance | |||
having the metadata about your schema is valuable | 18:29 | ||
18:35
mcmillhj left,
mr-foobar joined
|
|||
[Coke] | hahainternet: I get that some people find it useful; probably don't bother giving me an example (no time to dig into that now) | 18:42 | |
(but if you have one ready, sure.) | 18:43 | ||
hahainternet | [Coke]: i don't have one to hand, but it really isn't 'some people' | ||
it is just a way of encoding the metadata about your structure | |||
if you want to operate on anything indirectly in SQL, you will need something storing this metadata | |||
18:45
mcmillhj joined
18:47
darutoko left
18:50
Cabanossi left,
mson left,
neilb joined,
mcmillhj left
18:52
Cabanossi joined
18:56
eliasr left
18:59
HoboWithAShotgun joined
19:03
cdg left
19:04
mcmillhj joined
19:05
cdg joined
19:09
mcmillhj left,
mcmillhj joined
19:10
cdg left
19:11
troys is now known as troys_
19:14
ryn1x joined,
ryn1x_ joined,
ryn1x__ joined
19:20
cdg joined
19:29
darkmorph left
19:31
cdg_ joined
|
|||
buggable | New CPAN upload: Bailador-0.0.14.tar.gz by UFOBAT cpan.metacpan.org/authors/id/U/UF/....14.tar.gz | 19:33 | |
ufobat_ | \o/ | 19:34 | |
19:35
cdg left,
cdg_ left
19:38
Cabanossi left
19:39
Cabanossi joined
19:48
ryn1x__ left,
ryn1x_ left,
ryn1x left,
espadrine joined
19:51
ChoHag_ joined,
robertle left
|
|||
wander | ufobat_: could you please should me a picture of website built by Bailador? | 19:54 | |
s/should/show | |||
19:54
ChoHag left
|
|||
ufobat_ | i dont know which one uses it | 19:56 | |
bailador.net does, but it's currently down. It is not maintained by me. sorry | |||
19:57
ryn1x joined,
ryn1x_ joined,
ryn1x__ joined
|
|||
wander | sad :( | 19:58 | |
20:01
ryn1x__ left,
ryn1x_ left,
ryn1x left
20:04
domidumont joined
20:12
zakharyas joined
20:13
mempko left
20:16
domidumont left
20:28
troys_ is now known as troys
|
|||
wander | squashable6: next | 20:29 | |
squashable6 | wander, Next SQUASHathon in 23 days and ≈13 hours (2017-12-02 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day | ||
20:36
darkmorph joined,
neilb left
20:37
neilb joined
20:40
mson joined
20:48
Aaronepower joined
20:49
colomon left
|
|||
pmurias | github.com/tc39/proposal-bigint # bigints are coming to JavaScript :) | 20:53 | |
20:53
unicodable6 left,
unicodable6 joined
20:57
ryn1x_ joined,
ryn1x joined,
ryn1x__ joined
20:59
cdg joined,
lostinfog joined
21:04
cdg_ joined
21:07
zakharyas left,
zakharyas joined
21:08
cdg left
21:09
Aaronepower left
21:13
luke joined
|
|||
luke | Hello | 21:14 | |
21:14
luke is now known as Guest71897
|
|||
Guest71897 | I'm a Ubuntu user and I'm interested in learning Perl6 | 21:14 | |
However, I can get Rakudo to install | 21:15 | ||
Could anyone help me with this? | |||
cannot* | |||
El_Che | Hi Guest71897, you can have a look at resources at: perl6.org/resources/ | ||
there are some books recomendations there | |||
some of the authors are here :) | 21:16 | ||
Guest71897 | Thanks | ||
El_Che | Guest71897: if you're running Ubuntu 17.10, the rakudo version if fine | ||
if something older, have a look here: github.com/nxadm/rakudo-pkg | 21:17 | ||
if -> is | |||
Guest71897 | I'm using 16.04, and I downloaded the 2017.07 release from that repo. | ||
However, I'm not really sure on what to do next | |||
El_Che | sudo dpkg -i *.deb | 21:18 | |
that will install rakudo in /opt/rakudo-pkg/bin | 21:19 | ||
the instructions to change the path are in that page (I am the author of that page) | |||
got to go, now. bbl | 21:20 | ||
stick around people come and go all the time here | |||
Guest71897 | Thanks for the help! | 21:21 | |
21:22
MasterDuke joined
|
|||
lizmat | decommute& | 21:23 | |
21:23
lizmat left
21:24
mcmillhj left,
mcmillhj joined
21:25
comborico1611 joined
|
|||
Guest71897 | El_Che: thanks for the help, I got it working now :-) | 21:29 | |
21:34
ryn1x left,
Guest71897 left,
mr-foobar left,
mr-fooba_ joined,
ryn1x__ left,
ryn1x_ left
21:37
pmurias left
21:38
ryn1x joined
21:40
Cabanossi left
21:42
Cabanossi joined,
ryn1x left
21:51
darkmorph left
21:52
zakharyas left
21:59
ChoHag_ left
|
|||
HoboWithAShotgun hears scary sounds as he streches his spine | 21:59 | ||
22:00
ChoHag joined
22:03
ryn1x joined,
ryn1x_ joined
22:07
ryn1x left
22:08
ryn1x_ left
22:11
mcmillhj left
22:25
darkmorph joined
|
|||
HoboWithAShotgun | m: class X {}; class Foo is X {}; class Bar is X; sub foo returns Array[X] { return @(Foo.new, Bar.new); }; foo | 22:26 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Too late for unit-scoped class definition; Please use the block form. at <tmp>:1 ------> 3X {}; class Foo is X {}; class Bar is X;7⏏5 sub foo returns Array[X] { return @(Foo |
||
HoboWithAShotgun | m: class X {}; class Foo is X {}; class Bar is X {}; sub foo returns Array[X] { return @(Foo.new, Bar.new); }; foo | 22:27 | |
camelia | Type check failed for return value; expected Array[X] but got List ($(Foo.new, Bar.new)) in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
HoboWithAShotgun | m: class X {}; class Foo is X {}; class Bar is X {}; sub foo returns Array[X] { return @(Foo.new, Bar.new).Array; }; foo | ||
camelia | Type check failed for return value; expected Array[X] but got Array ($[Foo.new, Bar.new]) in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
HoboWithAShotgun | m: class X {}; class Foo is X {}; class Bar is X {}; sub foo returns Array where *.isa("X") { return @(Foo.new, Bar.new).Array; }; foo | 22:28 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing block at <tmp>:1 ------> 3class Bar is X {}; sub foo returns Array7⏏5 where *.isa("X") { return @(Foo.new, Ba expecting any of: new name to be defined |
||
HoboWithAShotgun | m: class X {}; class Foo is X {}; class Bar is X {}; sub foo returns Array where *.all({.isa("X")}) { return @(Foo.new, Bar.new).Array; }; foo | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing block at <tmp>:1 ------> 3class Bar is X {}; sub foo returns Array7⏏5 where *.all({.isa("X")}) { return @(Foo expecting any of: new name to be defined |
||
22:30
xinming_ left
22:32
mr-fooba_ left
|
|||
HoboWithAShotgun | so how do i tell perl i want an array of things that are all subclasses of X? | 22:33 | |
22:36
itaipu_ left
|
|||
sena_kun | m: role A {}; class B does A {}; class C does A {}; my A @rray = B.new, C.new, B.new; | 22:39 | |
camelia | ( no output ) | ||
sena_kun | m: role A {}; class B does A {}; class C does A {}; my A @rray = B.new, C.new, B.new; @rray.say; | ||
camelia | [B.new C.new B.new] | ||
sena_kun | HoboWithAShotgun, like that? ^ | ||
m: role A {}; class B does A {}; class C does A {}; my A @rray = B.new, C.new, B.new; @rray.say; @rray.push: 3; | 22:40 | ||
camelia | [B.new C.new B.new] Type check failed in assignment to @rray; expected A but got Int (3) in block <unit> at <tmp> line 1 |
||
HoboWithAShotgun | no, as i tried to do above as a signature | 22:41 | |
sena_kun | dunno about subclasses though. | ||
22:41
ryn1x joined
|
|||
sena_kun | ah, a signature one. | 22:41 | |
HoboWithAShotgun | this is my best that works: subset UnitArray of Array where *.grep({ !.isa("Units::Unit") }).elems == 0; | ||
22:41
ryn1x_ joined,
ryn1x__ joined
|
|||
sena_kun | what about, give me a second... | 22:42 | |
m: sub foo(--> Array[Int]) { Array.new(1,2,3) }; foo(); sub bar(--> Array[Int]) { Array.new(1,2,3,'no') }; bar(); | |||
camelia | Type check failed for return value; expected Array[Int] but got Array ($[1, 2, 3]) in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
sena_kun | m: sub foo(--> Array[Int]) { Array.new(1,2,3) }; foo(); | ||
camelia | Type check failed for return value; expected Array[Int] but got Array ($[1, 2, 3]) in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
sena_kun | eeeeh. | 22:43 | |
HoboWithAShotgun | that*s better: subset UnitArray of Array where not *.grep({ !.isa("Units::Unit") }); | ||
sena_kun | ah, ok, I've failed. :/ | ||
HoboWithAShotgun | not an array of int. that's easy. an array of things that are subclasses of X | ||
here X being Units::Unit | 22:44 | ||
sena_kun | I am assuming I should be able to replace Int with Units::Unit, to be honest. | ||
HoboWithAShotgun | that works as the array contains Units::Unit Objects | 22:45 | |
sena_kun | ugh. | ||
HoboWithAShotgun | but it fails when it contains say, Units::Voltage objects | ||
22:45
mempko joined
|
|||
sena_kun | well, sorry I couldn't help much then. | 22:45 | |
HoboWithAShotgun | where Units::Voltage isa Units::Unit | 22:46 | |
nah, it's ok. the above is fine. | |||
echo chamber effect ;-) | |||
22:46
darkmorph left
|
|||
HoboWithAShotgun | i used to have a tortoise for the desk to tell stuff to but it broke | 22:46 | |
and it feels weird to talk to a bottle or something :) | 22:47 | ||
22:48
ryn1x_ left,
ryn1x__ left
|
|||
sena_kun | it's already 00:48 here, so need to sleep. at least a little bit. | 22:48 | |
22:49
ryn1x left
|
|||
samcv | . | 22:50 | |
yoleaux | 03:10Z <raiph> samcv: fyi: stackoverflow.com/questions/471422...-in-perl-6 | ||
22:51
troys is now known as troys_
|
|||
samcv | hmm | 22:52 | |
22:55
setty1 left
22:56
colomon joined
|
|||
rjbs | Is Patrick M. ever around here anymore? | 22:58 | |
yoleaux | 8 Apr 2017 01:12Z <[Coke]> rjbs: github.com/coke/p6-uni | ||
23:05
ryn1x joined,
ryn1x_ joined,
ryn1x__ joined
|
|||
AlexDaniel | .seen pmichaud | 23:06 | |
yoleaux | I saw pmichaud 18 Jul 2017 14:45Z in #perl6: <pmichaud> (Wishing I could get to Amsterdam this year for #yapceu) | ||
AlexDaniel | rjbs: ↑ ? | ||
23:08
cpage_ joined
23:09
ryn1x left,
ryn1x__ left,
ryn1x_ left
|
|||
geekosaur | that sounds like "not really" | 23:10 | |
comborico1611 | Three more chapters to go in this book! | 23:11 | |
AlexDaniel | well, you can still send a pigeon with .tell and hope for the best :) | ||
(although email is probably a better choice in this case) | |||
timotimo | if you care about performance, don't isa with a string, HoboWithAShotgun | 23:12 | |
you can actually directly .grep(Units::Unit) | |||
because grep uses smartmatch to do its thing | |||
HoboWithAShotgun | that's useful. ty | 23:13 | |
timotimo | two or three years ago i was looking at why some program wasn't performing well, it was because of an isa + string being crazy slow | ||
m: say (1 xx 1000).grep(Rat); say now - INIT now | 23:14 | ||
camelia | () 0.00517439 |
||
timotimo | m: say (1 xx 1000).grep(*.isa(Rat)); say now - INIT now | ||
camelia | () 0.0074191 |
||
timotimo | m: say (1 xx 1000).grep(*.isa("Rat")); say now - INIT now | ||
camelia | () 0.0306595 |
||
timotimo | still a very noticable difference | ||
especially with a non-match it has to go through the whole mro, of course | |||
it's likely a bit better if the type matches directly, let's see | 23:15 | ||
m: say +(1 xx 1000).grep(*.isa("Int")); say now - INIT now | |||
camelia | 1000 0.0285461 |
||
timotimo | m: say +(1 xx 1000).grep(*.isa(Int)); say now - INIT now | ||
camelia | 1000 0.0067902 |
||
timotimo | m: say +(1 xx 1000).grep(Int); say now - INIT now | ||
camelia | 1000 0.00549737 |
||
timotimo | that's more than i expected | 23:16 | |
23:17
lostinfog left
|
|||
HoboWithAShotgun | i now have subset UA of List where { $_.grep(Units::Unit).elems == $_.elems }; | 23:19 | |
timotimo | probably faster than looking for none(Units::Unit) and seeing if that's positive | 23:20 | |
perhaps something with .first and the negation would be better? not sure if the grep there uses a count-only thing | |||
if you have negation and check for booleanness, it only has to pull a single value, which means if there's a wrong value somewhere near the beginning it'll immediately reject | 23:21 | ||
23:21
margeas left
|
|||
HoboWithAShotgun adds a comment: todo: performance | 23:22 | ||
rjbs | AlexDaniel: Thanks. | 23:27 | |
23:30
Redrield joined
|
|||
Redrield | Is there something that I could add to neovim to get Neomake lints for Perl 6? | 23:32 | |
23:38
troys_ is now known as troys,
dct joined
23:39
mson left
23:42
nadim left
23:44
mcmillhj joined
23:47
ryn1x joined,
sena_kun left,
ryn1x_ joined,
ryn1x__ joined,
AndChat|688961 joined,
comborico1611 left
23:50
lizmat joined
23:51
ryn1x__ left,
ryn1x_ left,
ryn1x left
23:54
callyalater left
23:58
dct left,
ryn1x joined,
ryn1x_ joined,
ryn1x__ joined
|