»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
japhb timotimo: Oddly, when you start doing "interesting" stuff like simulating particular clients, HTTP headers are effectively ordered. Mind you, maybe that just means an ordered hash .... 00:35
dalek : a5b3848 | 唐鳳++ | docs/feather/index.html:
Redirect par.perl.org to par.wikia.com
06:02
TimToady rosettacode.org/wiki/Fibonacci_word...tal#Perl_6 <-- braille graphics strikes again 06:08
actually, there's no reason to track x and y separately... 06:12
updating 06:13
okay, now just uses complex addition to move on the complex plane 06:15
I suppose I might have my left and right turns backwards, but it doesn't matter for this problem
sergot morning o/ 06:17
timotimo: sounds good, thank you, I'll think it over. :) 06:18
TimToady changed picture to do the 17x3 fractal instead, which seems a bit prettier 06:24
TimToady should probably put braille-graphics into a module one of these years 06:36
makes it easy to sneak graphics onto RC despite the image upload ban 06:38
moritz m: my $p = Proxy.new(FETCH => { 42 }, STORE => -> $, $value { say 2 * $value }); $p = 8; say $p 07:38
camelia rakudo-moar a8798f: OUTPUT«8␤»
moritz m: my $p := Proxy.new(FETCH => { 42 }, STORE => -> $, $value { say 2 * $value }); $p = 8; say $p
camelia rakudo-moar a8798f: OUTPUT«16␤42␤»
lizmat some more sightseeing& 07:41
jnthn morning o/ 08:05
moritz \o 08:16
FROGGS o/ 08:18
nwc10 good *, * 08:20
dalek rlito: ae7547e | (Flavio S. Glock)++ | src5/lib/Perlito5/Javascript2/Emitter.pm:
Perlito5 - js - code cleanup
nwc10 p5-to-p6: print "Hi\n" 08:20
camelia p5-to-p6 : OUTPUT«print('Hi' ~ chr(10))␤»
nwc10 p5-to-p6: ******
camelia p5-to-p6 : OUTPUT«Syntax Error near 0 at perlito5.pl line 14105.␤» 08:21
nwc10 oh noes. the right answer is 1
jnthn m: ****** # :) 08:22
camelia rakudo-moar a8798f: OUTPUT«===SORRY!=== Error while compiling /tmp/NmuZSqccgO␤HyperWhatever (**) not yet implemented. Sorry. ␤at /tmp/NmuZSqccgO:1␤------> **⏏**** # :)␤»
nwc10 m: 0 ** 0
camelia ( no output )
nwc10 m: say 0 ** 0
camelia rakudo-moar a8798f: OUTPUT«1␤»
nwc10 OK, so that part works 08:23
but Perl 6 doesn't have typeglobs
and doesn't have a special variable *
jnthn m: * * * * *
camelia ( no output )
jnthn ;)
nwc10 and doesn't treat typeglobs as numeric 0
so the other bits of sick don't work
jnthn m: say (* * * * *)(2, 3, 7)
camelia rakudo-moar a8798f: OUTPUT«42␤»
nwc10 m: say (* * * * *)(2, 3, 7).WHY 08:24
camelia rakudo-moar a8798f: OUTPUT«Life, the Universe and Everything␤»
nwc10 :-)
tadzik whhhaht 08:52
jnthn Thw Swiss Perl Workshop has room for small workshop-y things: blogs.perl.org/users/swiss_perl_wor...-room.html 10:31
jnthn If there's any interest, I could do a (probably fairly informal) half-day course on something. Perl 6 concurrency is one option. 10:32
Ulti in a sub signature can I specify a junction of types? 10:55
Ulti do I do it in the where ? where $.WHAT any ((Type1)|(Type2)) 10:56
jnthn r: sub foo($a where Int | Str) { say $a }; foo(1); foo("2"); foo(3.3) 10:58
camelia rakudo-jvm a8798f: OUTPUT«(timeout)»
..rakudo-{parrot,moar} a8798f: OUTPUT«1␤2␤Constraint type check failed for parameter '$a'␤ in sub foo at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
Ulti k k thanks 11:00
nwc10 I think that venturebeat.com/2014/06/03/a-progra...-language/ misses a trick: 11:02
Objective-C is great and really powerful. It has served Apple well for a really long time. It’s older than the web though. It is ...
where's the bit about "the web was first created using software written in Objective C"
nwc10 they also missed running the spell checker over that article 11:02
maybe I should consider that when judging its value 11:03
Ulti that is quite nice since I have different dispatch for loads of other stats functions higher order ones now can take either Baggy or Positional since the correct version of more basic functions know how to deal with the types :)
dalek kudo-star-daily: 41b620c | coke++ | log/ (13 files):
today (automated commit)
14:37
dalek kudo-star-daily: 13151ca | (Will Coleda)++ | README.md:
Create README.md
14:42
FROGGS m: my $*PID; $*PID := 1 15:16
camelia rakudo-moar a8798f: OUTPUT«===SORRY!=== Error while compiling /tmp/27ZxWVlzBd␤Cannot use bind operator with this left-hand side␤at /tmp/27ZxWVlzBd:1␤------> my $*PID; $*PID := 1⏏<EOL>␤ expecting any of:␤ postfix␤»
dalek kudo/nom: 609fb8f | (Tobias Leich)++ | src/Perl6/Actions.nqp:
allow to bind to dynamic variables
15:17
FROGGS perl6-m -I. -MCOBOL -e1 15:22
===SORRY!===
P6opaque: no such attribute '$!from'
FROGGS so, if we could solve this, perhaps by marshalling NQPCursor to Cursor and vice versa, we finally would have Perl 6 level slangs (and a panda installable v5) 15:23
is marshalling the right word here? 15:24
jnthn: it would be cool if you could tell me your ideas about that, maybe I can work something out? 15:25
timotimo FROGGS: maybe that's kind of like a "hllize" operation? 15:30
FROGGS yeah, I think so 15:31
timotimo i'm not actually sure if the hllize mechanism is limited to stuff like strings, integers, nums, arrays, hashes 15:34
or if you can just add a mapping that turns an NQPCursor to a Cursor when you hllize it 15:35
Kyote_ hello 15:36
JimmyZ hi
timotimo hello there
FROGGS timotimo: it is capable of hllizing int/num/str/array/hash and code 15:37
masak good afternoon, #perl6
FROGGS masak: hi
hi Kyote_
timotimo there *is* a "hll_sym_get" thing that could store NQPCursor and Cursor for the given hll i suppose 15:39
though i don't see a place where those syms are stored
oh, huh, the hll_syms is actually on the instance 15:40
ah, wrong again. the hll_syms is a hash of hashes
FROGGS I'd thought the hll syms are about the current high level languages 15:41
so a hll_sym would be 'perl6' vor example
timotimo it seems like there's a whole symbol table for hlls 15:42
jnthn FROGGS: Where exactly does the error come from? 15:51
FROGGS jnthn: when calling the foreign statementlist: gist.github.com/FROGGS/100079bd927...example-p6 15:52
FROGGS so it happens when making the call to $cursor."statementlist"() in method LANG 15:52
really when making the call, not when processing the return value 15:53
maybe it even happens within the call... I'm not sure there
jnthn I guess it'd have to be within the call, but that doesn't immediately make a lot of sense...
FROGGS I added a <!!{ say("in COBOLs statementlist") }> to the statementlist token, and I don't see the output 15:54
jnthn: btw, when I turn the token into a method, it calls the method, I get the bootint (1), and it returns to method LANG 15:56
and then it ends up as P6opaque: invalid native access to object attribute
ahh, that last error message is about trying to access an attribute from the return value of say() 15:57
jnthn I can see why we might fail to process the return value of LANG. 15:58
But not why we might fail to call the rule in the other langauge.
FROGGS yeah, I kinda get further by returning an NQPCursor from my statementlist method 15:59
but yeah, why does the call fail...
I guess the called token wants to access $!from already and fails 16:00
TimToady r: say (1, 1, *+* ... *)[^10]
camelia rakudo-{parrot,jvm,moar} a8798f: OUTPUT«1 1 2 3 5 8 13 21 34 55␤»
TimToady r: say (1, 1, * R+ * ... *)[^10] 16:02
FROGGS linenoise, all the way down :o)
camelia rakudo-moar a8798f: OUTPUT«===SORRY!===␤Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: *%_)␤»
..rakudo-parrot a8798f: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: *%_)␤ in any at gen/parrot/BOOTSTRAP.nqp:1222␤ in method Numeric at gen/parrot/CORE.setting:1034␤ in sub infix:<+> at gen/parrot/CORE.setting:4249␤ in sub infix:<+> at gen/p…»
..rakudo-jvm a8798f: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: *%_)␤ in any at gen/jvm/BOOTSTRAP.nqp:1215␤ in sub infix:<+> at gen/jvm/CORE.setting:4245␤ in block at gen/jvm/CORE.setting:17315␤ in block at /tmp/tmpfile:1␤␤»
carlin Hi
FROGGS hi carlin
carlin I made a simple bcrypt interface for perl6 using NativeCall
github.com/carbin/p6-Crypt-BCrypt
TimToady n: say (1, 1, * R+ * ... *)[^10]
camelia niecza v24-109-g48a8de3: OUTPUT«1 1 2 3 5 8 13 21 34 55␤»
colomon woah, why doesn't that work in Rakudo? 16:03
FROGGS jnthn: I guess it calls something in QRegex... starting with method !protoregex
colomon TimToady: is that why you didn't use * R~ * in the fib palindrome script?
TimToady n: say (1, 0, { $^b ~ $^a } ... *)[^10] 16:04
FROGGS calls something in QRegex that tries to access $!from*
camelia niecza v24-109-g48a8de3: OUTPUT«1 0 01 010 01001 01001010 0100101001001 010010100100101001010 0100101001001010010100100101001001 0100101001001010010100100101001001010010100100101001010␤»
timotimo carlin: do you know of the LibraryMake module?
btyler carlin: cool!
TimToady p6: say (1, 0, R~ ... *)[^10]
oops
camelia rakudo-{parrot,jvm,moar} a8798f: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Undeclared name:␤ R used at line 1␤␤»
..niecza v24-109-g48a8de3: OUTPUT«===SORRY!===␤␤Undeclared name:␤ 'R' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1502 (die @ 5) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @…»
colomon TimToady: come to think of it, is the order of arguments on *~ * defined?
TimToady p6: say (1, 0, * R~ * ... *)[^10]
camelia rakudo-moar a8798f: OUTPUT«1 0 Whatever<140632640989856>0 Whatever<140632640999808>Whatever<140632640989856>0 Whatever<140632641005888>Whatever<140632640999808>Whatever<140632640989856>0 Whatever<140632641011560>Whatever<140632641005888>Whatever<140632640999808>Whatever<140632640989…»
..rakudo-jvm a8798f: OUTPUT«1 0 Whatever<775261730>0 Whatever<1040609761>Whatever<775261730>0 Whatever<421431959>Whatever<1040609761>Whatever<775261730>0 Whatever<605867107>Whatever<421431959>Whatever<1040609761>Whatever<775261730>0 Whatever<1588496922>Whatever<605867107>Whatever<4214…»
..niecza v24-109-g48a8de3: OUTPUT«1 0 01 010 01001 01001010 0100101001001 010010100100101001010 0100101001001010010100100101001001 0100101001001010010100100101001001010010100100101001010␤»
carlin timotimo: no I don't
timotimo should that be &[R~] perhaps?
camelia ..rakudo-parrot a8798f: OUTPUT«1 0 Whatever<8984232829931442042>0 Whatever<8984232829939462246>Whatever<8984232829931442042>0 Whatever<8984232829930390376>Whatever<8984232829939462246>Whatever<8984232829931442042>0 Whatever<8984232829938245729>Whatever<8984232829930390376>Whatever<898…»
FROGGS carlin++ 16:05
timotimo carlin: it could make your makefile obsolete and also compatible with parrot and jvm backends ... perhaps
colomon carlin++
carlin timotimo: thanks, I'll look into it 16:06
TimToady p6: say (* R~ *)('bar','foo') 16:06
camelia niecza v24-109-g48a8de3: OUTPUT«foobar␤»
..rakudo-{parrot,jvm,moar} a8798f: OUTPUT«Too many positional parameters passed; got 2 but expected 1␤ in block at /tmp/tmpfile:1␤␤»
TimToady eh? 16:07
colomon p6: say (* ~ *)('bar','foo')
camelia rakudo-{parrot,jvm,moar} a8798f, niecza v24-109-g48a8de3: OUTPUT«barfoo␤» 16:08
TimToady R screws up the argcount somehow
colomon p6: say "bar" R~ "foo"
camelia rakudo-{parrot,jvm,moar} a8798f, niecza v24-109-g48a8de3: OUTPUT«foobar␤»
TimToady at least, in conjunction with *
or R isn't sufficiently transparent to WhateverCode transformation 16:10
p6: say (* R.. 1)(10)
camelia rakudo-{parrot,jvm,moar} a8798f, niecza v24-109-g48a8de3: OUTPUT«1..10␤» 16:11
TimToady interesting
FROGGS what... Cursor already does the NQPCursorRole
TimToady arguably R.. should suppress WhateverCode just as .. does
colomon may have to switch his $work "make_build" script to p6 just so it's easy to figure out what the command line arguments are supposed to be 16:12
TimToady but leaving that aside, * Rop * shouldn't be expecting 1 arg
colomon TimToady: are you thinking what I'm thinking? 16:13
p6: say (* R~ *)('bar')
camelia rakudo-jvm a8798f: OUTPUT«Whatever<786887898>bar␤»
..rakudo-parrot a8798f: OUTPUT«Whatever<-6726042392605811182>bar␤»
..niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: No value for parameter 'anon_1' in 'ANON'␤ at /tmp/tmpfile line 0 (ANON @ 1) ␤ at /tmp/tmpfile line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.sett…»
..rakudo-moar a8798f: OUTPUT«Whatever<139850726241000>bar␤»
TimToady it's quite a spectacular fail 16:14
TimToady it's now a function taking 1 arg but that returns two values, one of which is one of the whatevers 16:15
TimToady could see that happening on a stack machine, but on a register machine? Wha??? 16:16
grondilu R prevents thunking, doesn't it? 16:16
grondilu r: say 4 Rxx rand 16:16
camelia rakudo-moar a8798f: OUTPUT«0.245826499877056 0.245826499877056 0.245826499877056 0.245826499877056␤»
..rakudo-jvm a8798f: OUTPUT«0.14997246391421026 0.14997246391421026 0.14997246391421026 0.14997246391421026␤»
..rakudo-parrot a8798f: OUTPUT«0.390265019002499 0.390265019002499 0.390265019002499 0.390265019002499␤»
grondilu n: say 4 Rxx rand
camelia niecza v24-109-g48a8de3: OUTPUT«0.75332688714998164 0.75332688714998164 0.75332688714998164 0.75332688714998164␤»
TimToady it does, but arguably it could be made to reverse the thunk policy too 16:17
TimToady at least where it's not then used as a higher-order function, but then it gets problematical 16:18
TimToady the only way to fix that would be thunk everything and let the run-time sort it out, not a recipe for performance... 16:18
but I'm not sure thunking has much to do with the * transform 16:19
grondilu well, yeah. My bad. 16:20
TimToady p6: say &[R~]('bar','foo')
camelia niecza v24-109-g48a8de3: OUTPUT«foobar␤» 16:21
..rakudo-{parrot,jvm,moar} a8798f: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Variable '&infix:<R~>' is not declared␤at /tmp/tmpfile:1␤------> say &[R~]('bar','foo')⏏<EOL>␤ expecting any of:␤ postfix␤»
TimToady oh yeah, rakudo is still defective there
basically, doesn't believe in metaops in rvalue code names 16:22
TimToady p6: say &infix:<R~>(2,4) 16:22
camelia rakudo-jvm a8798f: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Undeclared routine:␤ &infix:<R~> used at line 1. Did you mean '&infix:<~>>', '&infix:<||>', '&infix:<∋>', '&infix:<->', '&infix:<..>'?␤␤» 16:23
..niecza v24-109-g48a8de3: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'infix:<R~>' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1502 (die @ 5) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6…»
..rakudo-parrot a8798f: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Undeclared routine:␤ &infix:<R~> used at line 1. Did you mean '&infix:<X>', '&infix:<Z>', '&infix:<=>>', '&infix:<%>', '&infix:<%%>'?␤␤»
..rakudo-moar a8798f: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Undeclared routine:␤ &infix:<R~> used at line 1. Did you mean '&infix:<~~>', '&infix:<~>', '&infix:<x>', '&infix:<eq>'?␤␤»
TimToady well, neither does neicza there...
TimToady n: say (* R.. 1) 16:29
camelia niecza v24-109-g48a8de3: OUTPUT«{ ... }␤»
TimToady not transparent in niecza either 16:30
maybe it's a "feature"
p6: say (1 [..] *) 16:31
camelia niecza v24-109-g48a8de3: OUTPUT«Potential difficulties:␤ Useless use of [] around infix op at /tmp/tmpfile line 1:␤------> say (1 ⏏[..] *)␤␤1..Inf␤»
..rakudo-{parrot,jvm,moar} a8798f: OUTPUT«1..Inf␤»
TimToady okay, that's transparent
p6: say (1 «..» *) 16:32
hello?
camelia rakudo-{parrot,jvm,moar} a8798f: OUTPUT«(timeout)»
..niecza v24-109-g48a8de3: OUTPUT«{ ... }␤»
tadzik is it me you're looking for? 16:32
TimToady no, lionel 16:33
timotimo who is?
TimToady so hypers are transparent to * introspection as well as precedence 16:35
but R isn't
p6: say 1 R+ 2 * 3 16:36
camelia rakudo-jvm a8798f: OUTPUT«(timeout)» 16:36
..rakudo-{parrot,moar} a8798f, niecza v24-109-g48a8de3: OUTPUT«7␤»
masak that's what I got too. 16:37
TimToady p6: say 1 + 2 R* 3
camelia rakudo-jvm a8798f: OUTPUT«(timeout)» 16:38
..rakudo-{parrot,moar} a8798f, niecza v24-109-g48a8de3: OUTPUT«7␤»
masak still good. :)
TimToady so R is at least transparent to precedence, if not *
masak basically, R on any commutative op should have no visible effect :) 16:39
TimToady and RR should produce the same on non-commutatives
p6: say 'foo' RR~ 'bar'
camelia rakudo-jvm a8798f: OUTPUT«(timeout)» 16:40
..rakudo-{parrot,moar} a8798f, niecza v24-109-g48a8de3: OUTPUT«foobar␤»
TimToady should stop tormenting the jvm, he guesses
TimToady looks around for an implementor :) 16:41
masak "Well now, here's the thing: automating sarcasm detection is *easy*." -- via www.antipope.org/charlie/blog-stati...on-on.html -- if that's an autopun, it's a bit of a new type. 16:47
rjbs- TimToady: off-topic: at long last, 20 year old deprecation carried out: perl5.git.perl.org/perl.git/commitd...44b71a169f 16:53
masak: That bit of news blew my mind. I guess I'm not cynical enough yet.
TimToady Well now, here's the thing: is that sarcasm detection algorithm required to return a correct result? 16:56
TimToady rjbs: \o/ with a bit of orz 16:57
masak that's a weird thing to ask about an algorithm.
rjbs [ ] Click here to indicate that your tweets are never sarcastic 16:58
TimToady okay, what now?
rjbs Twitter staff are now reviewing your Tweet history. 16:59
masak rjbs: maybe tweets can be equipped with a "sarcasm bit"...
rjbs (also Twitter defense contractors)
TimToady <unclick!> <unclick!>
rjbs This explains the spate of content-transfer-encoding:9-bit I've been seeing lately!
TimToady wait, what happens if I unclick it twice?
rjbs "We added an extra bit to tell whether any given character of the message was sarcastic."
Unclick is a synonym for click. 17:00
masak TimToady: what I unclick you three times is true.
TimToady I unclick you. I unclick you. I unclick you. 17:01
rjbs greys out. 17:02
TimToady goes into a brown study.
TimToady is greying, unless he's graying, but in either case, not out just yet 17:03
rjbs In unrelated news, updating my months-old perl6m. 17:08
masak \o/ 17:14
dalek ecs: fe5c01d | TimToady++ | S03-operators.pod:
Mandate autogeneration of indirect metaops
17:17
ecs: 73cdf29 | TimToady++ | S03-operators.pod:
and update the date
vendethiel TimToady: not sure what "operator is generated" means ? 17:17
vendethiel is thinking about c-style auto function decl ...
TimToady basically that means it has to parse the string as an operator, then curry the higher-order function implementing the metaop using the base op as a curried argument 17:19
vendethiel ah, much better :P 17:21
TimToady nr: my &prod = &prefix:< [*] >; say prod 1..10 17:23
camelia rakudo-jvm 609fb8: OUTPUT«(timeout)» 17:24
..niecza v24-109-g48a8de3: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'prefix:< [*] >' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1502 (die @ 5) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147…»
..rakudo-moar 609fb8: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Undeclared routine:␤ &prefix:<[*]> used at line 1. Did you mean '&prefix:<~>', '&prefix:<~^>', '&prefix:<++>', '&prefix:<-->', '&prefix:<?>'?␤␤»
..rakudo-parrot 609fb8: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Undeclared routine:␤ &prefix:<[*]> used at line 1. Did you mean '&prefix:<temp>', '&prefix:<let>', '&prefix:<+^>', '&prefix:<?>', '&prefix:<so>'?␤␤»
TimToady basically, that oughta do what people expect
jnthn I can't see how it easily can...
At least, not without some reparsing of what's inside the <...> 17:25
TimToady I just said that
jnthn Which is ugly.
masak jnthn: <TimToady> basically that means it has to parse the string as an operator, then curry the higher-order function implementing the metaop using the base op as a curried argument
jnthn Yeah, I didn't read the backlog yet :P
urgh
masak "torment the implementors" :) 17:26
jnthn shoves that one some way down his priority list :P
masak fwiw, I agree with TimToady
jnthn
.oO( "6.1" :P )
TimToady niecza gets there partway wait &[Rop]
*with
.oO(how did that turn into "wait"?)
jnthn Well, the &[...] form is less of a problem 'cus we know to parse an infix in there, no?
masak I also expect metaops to be user-definable, and I expect the op parsing to work for them, too :)
colomon user-definable metaops +1 :) 17:27
TimToady I'll note that infix:<> is also reparseable at compile time like &[] 17:28
jnthn I just said &[...] didn't look like a reparse to me...
jnthn No, it ain't. 17:29
|| '&'
[
| :dba('infix noun') '[' ~ ']' <infixish('[]')>
]
TimToady similar magic might attain for infix:<>
in any case, &[] doesn't help with prefixes or postfixes 17:30
"might attain", now there's a high-falutin' phrase 17:31
maybe I meant "might obtain" 17:32
TimToady should learn English someday 17:32
TimToady puts that off till he learns Perl 6 better 17:35
FROGGS P6opaque: no such attribute '$!from' 17:36
at /home/froggs/dev/rakudo/../v5/COBOL.pm:7 (<ephemeral file>:statementlist:49)
FROGGS okay, it really happens *in* statementlist 17:36
shopping & 17:37
masak wishes we had &?BLOCK implemented. that would save him a named sub in this code 17:42
timotimo i once thought "oh, that ought to be easy!" ... then i tried to implement it.
masak m: for 1..4 -> $n { sub ($k) { return if !$k; say $k; &?ROUTINE($k - 1) }($n) } 17:43
camelia rakudo-moar 609fb8: OUTPUT«1␤2␤1␤3␤2␤1␤4␤3␤2␤1␤»
masak ok, that works as a workaround. 17:44
timotimo mhm 17:45
masak nope, it failed the readability test ;) 17:46
timotimo well, *this* particular piece of code could be expressed easier; and also is it supposed to infiniloop for negative starting values? 17:47
hmm. with &?BLOCK, can we just recurse into any block at all? 17:48
jnthn guesses masak is aware of anon sub foo() { ... } ?
TimToady but then you can't call foo()
timotimo jnthn: inside the sub, it'll be available as "foo", but not outside?
masak right. 17:49
timotimo m: anon sub foo() { say &foo }; foo(); 17:49
camelia rakudo-moar 609fb8: OUTPUT«===SORRY!=== Error while compiling /tmp/g3xMoKHLbq␤Undeclared routines:␤ &foo used at line 1␤ foo used at line 1␤␤»
jnthn TimToady: You can inside of the sub.
timotimo er, duh :)
m: anon sub foo() { say foo };
camelia rakudo-moar 609fb8: OUTPUT«===SORRY!=== Error while compiling /tmp/IaUx5ASoZE␤Undeclared routine:␤ foo used at line 1␤␤»
timotimo apparently not
jnthn Hm
Or maybe the spec says that but NYI
TimToady hah, japhb++ put that in 17:51
no wonder I didn't remember doing it...
masak TimToady: you made the name available inside the sub, though :) 17:52
TimToady so I guess it needs to install the name into the inner lexical scope, much like parameter names
git blame blames japhb 17:53
masak see 23e517.
TimToady hmm, well, okay 17:54
masak japhb++'s commit is just and edit.
an*
TimToady blames git blame 17:55
the trouble with making sensical decisions is that you immediately forget them, because you only need to remember the exceptions :)
zengargoyle m: my %h = enum << :Mon(1) Tue Wed Thu Fri Sat Sun >>; 17:58
camelia ( no output )
itz is there a vim tags making script for perl6? 17:59
TimToady ntiko
zengargoyle m: my %h = enum << :Mon(1) Tue Wed Thu Fri Sat Sun >>; say %h.perl; 18:01
camelia rakudo-moar 609fb8: OUTPUT«("Tue" => 0, "Sun" => 5, "Wed" => 1, "Mon" => 1, "Sat" => 4, "Thu" => 2, "Fri" => 3).hash␤»
TimToady otoh that could be one of those sensical things I've forgotten :)
er... 18:02
TimToady m: my %h = enum :Mon(1), < Tue Wed Thu Fri Sat Sun >; say %h.perl 18:03
camelia rakudo-moar 609fb8: OUTPUT«===SORRY!=== Error while compiling /tmp/q5XZC0nS0F␤Undeclared routine:␤ enum used at line 1␤␤»
TimToady m: my %h = enum (:Mon(1), < Tue Wed Thu Fri Sat Sun >); say %h.perl
camelia rakudo-moar 609fb8: OUTPUT«("Mon" => 1, "Sun" => 5, "Fri" => 3, "Wed" => 1, "Tue" => 0, "Thu" => 2, "Sat" => 4).hash␤»
zengargoyle in moar at least, the anon version is handled specially and passed off to a QAST generator of some sort.
TimToady htat would appear to no be following S02:4834 18:04
synopsebot Link: perlcabal.org/syn/S02.html#line_4834
zengargoyle and that's the limit of my knowledge, but if we're collecting things the spec said should work....
TimToady *that *not
Multiple code paths for the same thing is a good way to get half your constructs working right. 18:05
Also has the benefit of making your image bigger. 18:06
so zengargoyle++ for the rakudobug 18:07
TimToady perhaps the masakbot knows whether it's been filed already? 18:07
zengargoyle i'm just starting to play around with p6 now, hard to tell sometimes if it's a bug, a not implemented yet, or a spec has changed 18:08
TimToady wonders if there's a test for that yet
TimToady S12-enums/anonymous.t does not appear to test for that 18:10
and there are no anonymous enum tests anywhere containing 'enum.*Tue'
TimToady they're all nonymous 18:11
TimToady or would that be nymous? 18:11
FROGGS onymous of course
masak .oO( chocolate mous ) 18:12
FROGGS www.thefreedictionary.com/onymous
I'm surprised that it exists 18:13
geekosaur I'm not 18:14
TimToady forgot that "onuma" means name, sigh 18:17
that must mean it's sensical... 18:18
segomos_ non inane 18:26
PerlJam suddenly wonders why we don't pronounce it as an-onymous 18:28
usually it comes out as aNONymous 18:29
geekosaur because it's been assimilated and anglicized? (and english pronunciation rules, to the extent they exist, are weird)
zengargoyle and so often shortened to anon that anon becomes a chunk 18:30
masak PerlJam: also explain to me why we no longer pronounce it "a napple". 18:33
and "a norange".
hm, maybe the former actually never happened. but "a nuncle" did, I think. 18:34
PerlJam
.oO( a no range? )
18:37
.oO( I have no tea )
18:38
geekosaur I would not be surprised about "norange" given its origin 18:45
masak ...Spain? 18:48
geekosaur from Arabic via Spanish 18:49
but effectively yes, `naranja`
masak dictionary.com says Dravidian(?)->Sanskrit->Persian->Arabic->Italian->French->English. 18:50
geekosaur although I could not say if whoever imported it into English started out with the "n" in the right place or not
huh, ok
even more places for it to get scrambled
itz is there a perl6ish way of calling private methods for testing? 19:26
jnthn Not really; the point of them is you can't call them from outside of the class so you can safely refactor them and know you only need to consider their containing class. 19:28
jnthn has come to view tests as just another client of the object, not something that deserves any extra privs on the object. 19:29
nwc10 ha! london.pm now top: act.useperl.at/apw2014/stats
itz I did wonder but a quick google suggests .NET and Java workarounds for this
nwc10 itz++ 19:30
jnthn itz: Well, you can always get at them with the MOP, but it's inconvenient for a reason... 19:31
itz I'll be good and atone for years of my perl5 OO sins 19:33
FROGGS jnthn: how can I debug that token calling problem that results in an error about '$!from'?
jnthn: I dunno where to start
jnthn FROGGS: Well, can look at the regex compiler and see where it emits lookups to $!from maybe... 19:34
That's the only ones I can imagine being to blame... 19:35
FROGGS k
thank you :o)
in QASTRegexCompilerMAST.as_mast and .scan 19:36
dwarring r: multi sub trait_mod:<is>(Routine $r, :$funny!) {say 42}; sub blah is funny {say "hi"}; blah() 19:49
camelia rakudo-{parrot,jvm,moar} 609fb8: OUTPUT«42␤hi␤» 19:50
dwarring r: multi sub trait_mod:<is>(Routine $r, :$cached!) {say 42}; sub blah is cached {say "hi"}; blah()
camelia rakudo-{parrot,jvm,moar} 609fb8: OUTPUT«hi␤»
dwarring r: sub blah is cached {say "hi"}; blah()
camelia rakudo-{parrot,jvm,moar} 609fb8: OUTPUT«hi␤»
itz can someone add raw.githubusercontent.com/stmuk/p6.../META.info to the ecosystem please? 19:51
dalek rl6-roast-data: 3db9a92 | coke++ | / (4 files):
today (automated commit)
19:52
osystem: c58902d | (Tobias Leich)++ | META.list:
add String-Koremutake, stmuk++ / itz
19:54
FROGGS itz++
[Coke] +S17-supply/on.t 5 - basic 3 supply with array 'on' works - fails on jvm & moar
still no clean rakudo spectests. :( 19:55
itz ty
colomon hmmm… simple statement to filter the non-ASCII characters out of a string? 19:58
FROGGS jnthn: for this message: P6opaque: no such attribute '$!from' 19:59
it means that it gets the curclass wrong, in this piece, right?
op('getattr_i', $pos, $cur, $curclass, sval('$!from'), ival(nqp::hintfor($*cursor_type, '$!from'))),
jnthn colomon: .subst(/<[\x0..\x7F]>+/, '', :g) or so?
moritz colomon: $str = $str.comb(/<[\c[0]...\c[127]]>+/).join # untested
colomon: or $str = $str.comb.grep(*.ord < 128).join 20:00
colomon jnthn++ moritz++
colomon does not trust his phone's filesystem to be able to handle non-ASCII characters, you so.... 20:00
moritz puny-encode it! UTF-7 encode it! 20:01
FROGGS m: say "abcöö" ~~ / <:!ASCII>+ / # perhaps most readable
camelia rakudo-moar 609fb8: OUTPUT«「öö」␤␤»
moritz FROGGS++
FROGGS p: say "abcöö" ~~ / <:!ASCII>+ / # perhaps most readable
jnthn ooh, I forgot about that :)
camelia rakudo-parrot 609fb8: OUTPUT«Unicode property 'ASCII' not found␤ in regex at /tmp/zRq79fYQ0z:1␤ in method ACCEPTS at gen/parrot/CORE.setting:13197␤ in method ACCEPTS at gen/parrot/CORE.setting:801␤ in block at /tmp/zRq79fYQ0z:1␤␤»
FROGGS j: say "abcöö" ~~ / <:!ASCII>+ / # perhaps most readable
camelia rakudo-jvm 609fb8: OUTPUT«(timeout)» 20:02
FROGGS use with caution :o)
moritz use j: with caution, right 20:02
FROGGS that too
colomon I'm using r-m by default, thank you. ;) 20:03
[Coke] r: "hello world…".comb().grep({.ord < 256}).join
camelia ( no output )
[Coke] # aw, moritz beat me.
colomon FROGGS++ # ended up using that version, more readable and I could subst with "_" so as to easily see something was missing.
Fabian_ Hi there. I got a little question. What is the difference between: my @numbers = (1, 2, 3); say @numbers.WHAT and say (1, 2, 3).WHAT;? 20:04
FROGGS Fabian_: in the first case you shove it into an Array, in the last case not 20:05
jnthn fwiw, in Perl 6 you can write the first as just "my @numbers = 1, 2, 3;" without the parens.. 20:06
FROGGS jnthn: can you take a look at what I wrote like 6mins ago?
jnthn FROGGS: Well, I read it, but figured it was part of yur ongoing exploration...
It could well mean the cur_class is wrong... 20:07
Fabian_ And is this valid too: my $numbers = 1, 2, 3; ? 20:07
jnthn Where does the cursor itself come from? It's the return value of !cursor_start?
vendethiel probably valid, maybe surprising
jnthn Fabian_: That isn't what you want, probably. Assigning to a scalar is different; since it can only hold a single value, it just takes the 1. 20:08
m: my $numbers = 1, 2, 3;
camelia ( no output )
FROGGS jnthn: like that:
$*cursor_type := $node.cursor_type();
my $wval := $*QASTCOMPILER.as_mast(QAST::WVal.new( :value($*cursor_type) ));
op('set', $curclass, $wval.result_reg),
jnthn Hm, I thought it may warn...
vendethiel m: my $numbers = 1, 2, 3; say $numbers; // here, see
camelia rakudo-moar 609fb8: OUTPUT«===SORRY!=== Error while compiling /tmp/9Dze0aKopc␤Null regex not allowed␤at /tmp/9Dze0aKopc:1␤------> my $numbers = 1, 2, 3; say $numbers; //⏏ here, see␤»
vendethiel m: my $numbers = 1, 2, 3; say $numbers; # here, see
camelia rakudo-moar 609fb8: OUTPUT«WARNINGS:␤Useless use of "," in expression "my $numbers = 1, 2, 3" in sink context (line 1)␤1␤»
vendethiel uh. 20:09
is it Lazy(TM)?
jnthn ah...
vendethiel: No, last line of the program isn't sunk so far as compile-time analysis cares..
FROGGS: No, I meant $cur
FROGGS ohh
Fabian_ What is the difference between an Array, a Parcel and a List?
I don't get it. 20:10
vendethiel welcome in the club...
FROGGS jnthn: seems to be the result of the call, aye: call($method, [ $Arg::obj ], :result($cur), $self )
jnthn Parcel is an immutable, non-resizable, bunch of things that doesn't imply any kind of flattening and so keeps structure of any Parcels within it
FROGGS '!cursor_start' 20:11
[Coke] it would be nice if docs.perl6.org -> doc.perl6.org
jnthn List flattens non-items and can be pushed/shifted etc but doesn't cause the elements to be mutable
Array is what you expect a "my @a" to do - a bunch of mutable containers. 20:12
Array is just a List that you can assign into, really.
Fabian_ Thanks jnthn. By the way. Just saw your Perl 6 - What can you do today talk. Really great! 20:13
jnthn Fabian_: Glad you enjoyed it :)
FROGGS: Hmmm...well, that's meant to return something correct... 20:14
Fabian_ What do you mean with non-items in Lists? 20:15
jnthn FROGGS: What happens if you disable the cursor_type optimization and have it always fall back to looking that up?
m: my @a = 1, (2, 3), 4; say @a.perl
camelia rakudo-moar 609fb8: OUTPUT«Array.new(1, 2, 3, 4)␤»
jnthn m: my @a = 1, [2, 3], 4; say @a.perl
camelia rakudo-moar 609fb8: OUTPUT«Array.new(1, [2, 3], 4)␤»
FROGGS let's see 20:16
jnthn Just mean that parens so far as a List/Array cares are just about grouping.
Whereas [...] is an array as an item (in Perl 5 speak, array ref)
m: my $x = (1, 2); my @a = 1, $x, 4; say @a.perl 20:17
camelia rakudo-moar 609fb8: OUTPUT«Array.new(1, $(1, 2), 4)␤»
jnthn Note that anything in a $ is kept as a single item.
And [...] is like $(Array.new(...)) 20:18
FROGGS jnthn: doesn't change anything sadly
jnthn hmm
Fabian_ Thank you very much. That makes things clearer. 20:20
Fabian_ m: my @a = 1, (2, 3), 4; say @a.perl 20:22
camelia rakudo-moar 609fb8: OUTPUT«Array.new(1, 2, 3, 4)␤»
Fabian_ m: my @a = 1, [2, 3], 4; say @a.perl 20:25
camelia rakudo-moar 609fb8: OUTPUT«Array.new(1, [2, 3], 4)␤»
dalek ast: 78a53ed | (David Warring [email@hidden.address] | integration/advent2011-day0 (3 files):
adding advent 2011 days 3, 4 and 5
20:47
dalek rlito: de93b43 | (Flavio S. Glock)++ | src5/lib/Perlito5/Javascript2/Emitter.pm:
Perlito5 - js - optimization - inline substr() when possible
21:01
FROGGS jnthn: I think I got further 21:33
jnthn FROGGS: what'd you find? 21:34
FROGGS I cloned method LANG into Perl6::Grammar.LANG2, and removed the :shared(self.'!shared'()) from the call to !cursor_init
jnthn Ohhh 21:35
FROGGS now the call does work as it seems
jnthn Hmmm
Yeah, that explains it
shared contains a cur class iirc
FROGGS and since this returns a Match, that has a $!to but no $!pos, it explodes about $!pos after the call
right... when I just add $!pos to Match it fails with: P6opaque: no such attribute '$!name' 21:36
jnthn Huh?
This is nothing to do with Match and all about NQPCursor vs Cursor, no?
FROGGS hmmm 21:37
jnthn my class ParseShared is export {
has $!CUR_CLASS;
FROGGS yeah, I see now that NQPMatch looks like Match
jnthn Well, but it's a cursor that it's trying to get $!from in, not a Match...
FROGGS yeah, reverting my change to Match...
jnthn I think the trick is checking whether we can re-use the ParseShared. 21:38
In LANG
By checking if the type of the new cursor type-matches the $!CUR_CLASS in ParseShared
If it does they're based on the same HLL cursor, and the re-use is OK. If not, need to do something smarter...
uh 21:39
or just not pass shared.
FROGGS okay, if you say so :o)
jnthn Taht'll deal with the $!from issue
The follow-up problem is that when we want to check if a Cursor was a success or not we currently obtain $!pos from it... 21:40
FROGGS hmmmm
jnthn Not immediately sure what to do with that. Tricky.
Short of changing the code-gen to obtain the appropriate cur_class each time... 21:41
FROGGS where is the problem? a Cursor has a $!pos
jnthn NQPCursor vs Cursor
Both compose the role, but attributes from a role are copied into the class 21:42
They are then, at lookup time, needing to be qualified with that class.
So "has a $!pos" isn't the issue, it's that the class name-spacing the attribute is being wrongly passed
FROGGS it fails now in !cursor_capture btw, complaining about $!name, which is the same issue as $!pos it seems 21:50
jnthn Yeah.
Hm, getting caught cheating... 21:51
Thing is, performance kinda matters there...
timotimo "kinda", haha
FROGGS I guessed so *g*
FROGGS would love to know what exactly the cheat is, but understands that it is perhaps too late for that today :o) 21:52
but very nice, it really runs the statementlist of COBOL.pm now... (I see my print statement) 21:53
jnthn Well, there's an assumption that the cursor you get back from a rule always derives from the same class as the current cursor 21:54
Doesn't have to be same type
Just should have the same base.
FROGGS ahh
jnthn NQPCursor is the base for all NQP ones, Cursor from Rakudo's CORE.setting for the rest.
And here we're mixing them. 21:55
FROGGS "Don't cross the beams!"
jnthn Pretty much. But it'd be good to be able to.
FROGGS and that assumptions is made in the RegexCompiler.as_mast I suppose? 21:56
jnthn Yeah 21:58
And in src/QRegex/Cursor.nqp I suspect. In the capture thingy you noticed.
FROGGS ohh! 21:59
masak 'night, #perl6 22:02
FROGGS gnight masak 22:03
jnthn 'night, masak 22:06
donaldh If I commit a new test file to roast, it won't be used, right? 23:07
donaldh or is it just rakudo that has a spectest.data ? 23:08
[Coke] every implementation has spectest.data 23:09
add away
donaldh it's new tests for IO::Socket::Async, but not finished and will need fudged for parrot. 23:10
dalek ast: 150f484 | (Donald Hunter)++ | S32-io/spurt.t:
Add missing test descriptions.
23:11
ast: 17d7071 | (Donald Hunter)++ | S32-io/IO-Socket-Async.t:
Initial async socket tests.
japhb m: my %h; %h<a> = "1 2 3".words; %h<b> = "4 5 6".words; my @k = <a b>; %h{@k}.perl.say 23:29
camelia rakudo-moar 609fb8: OUTPUT«(("1", "2", "3").list.item, ("4", "5", "6").list.item)␤»
japhb What's the most idiomatic way to get back a single flat list of < 1 2 3 4 5 6 > from that hash slice? 23:30
m: my %h; %h<a> = "1 2 3".words; %h<b> = "4 5 6".words; my @k = <a b>; %h{@k}>>.flat.flat.perl.say # ewww 23:31
camelia rakudo-moar 609fb8: OUTPUT«("1", "2", "3", "4", "5", "6").list␤»
TimToady m: my %h; %h<a> = "1 2 3".words; %h<b> = "4 5 6".words; my @k = <a b>; %h{@k}».flat.list.perl.say 23:35
camelia rakudo-moar 609fb8: OUTPUT«("1", "2", "3", "4", "5", "6").list␤»
TimToady m: my %h; %h<a> = "1 2 3".words; %h<b> = "4 5 6".words; my @k = <a b>; .say for %h{@k}».flat 23:36
camelia rakudo-moar 609fb8: OUTPUT«1␤2␤3␤4␤5␤6␤»
TimToady don't really need the .list if you're gonna use it in list context
m: my %h; %h<a> = "1 2 3".words; %h<b> = "4 5 6".words; my @k = <a b>; .say for %h{@k}»[] 23:38
camelia rakudo-moar 609fb8: OUTPUT«1␤2␤3␤4␤5␤6␤»
TimToady even shorter
japhb m: my %h; %h<a> = "1 2 3".words; %h<b> = "4 5 6".words; my @k = <a b>; my @a = %h{@k}»[]; @a.perl.say 23:40
camelia rakudo-moar 609fb8: OUTPUT«Array.new("1", "2", "3", "4", "5", "6")␤»
japhb OK, that works. Bit magical, but it works.
TimToady is not sure in what sense Zen slice is more idiomatic, but it feels that way, if idiomatic means not what you expect naïvely :) 23:40
Zen slice is what I usually use for that anymore 23:41
japhb It's a Zen thing.
japhb You have to achieve enlightenment first. 23:41
TimToady would like to get the point where you could write %h{@k;*} for that 23:43
and it would somehow know that you're switching to array indexing in the middle 23:44
though perhaps only if you declare my %h of Array or so 23:45
multidimensional arrays basically let you skip a » between subscripts 23:46
s/arrays/subscripts/ 23:47
or s/arrays/slices/
TimToady anyway, every time someone writes @foo[@bar]>>[@baz] I'd like them to think to themselves "if only I could write that @foo[@bar;@baz] as S09 specs..." :) 23:48
japhb Is that one of the "Waiting for Godot^Wpmichaud" issues? 23:49
TimToady not really, it's just not bubbled up to the top of anyone's Todo list 23:50
TimToady for native multi-dimensionals, probably depends on a deep understanding of reprs 23:50
and perhaps some understanding of how APL handles multidim arrays 23:51
such that a 3x3 matrix [[0,1,2],[3,4,5],[6,7,8] is really stored as 2, 3, 3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 23:54
but we aren't planning to restrict multi-dim slices to shaped arrays, where it's obvious how to emulate things in the presence of references 23:56
so, actually, I think your hash would be declared as %h{*}[*] 23:58
std: my %h{*}[*];
camelia std ec3d853: OUTPUT«ok 00:01 126m␤»
TimToady std: my %h{*}[*] of Int; 23:59
camelia std ec3d853: OUTPUT«ok 00:01 126m␤»
japhb TimToady: I'd be even happier to have your example turn into {...shape header...} --> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] so that we can do PDL-like change of dimensionality without moving data
TimToady just checking
sure, was just being notional on the header thing