»ö« 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.
u-ou- hi 00:34
AlexDaniel u-ou-: o/ 00:49
u-ou- :)
AlexDaniel did we have non-int enums? 00:56
non-num rather 00:57
AlexDaniel er, doesn't matter 00:57
weabot I have an array of functions that I want to write to a file and read back, what's the best way to do this? 01:17
I can read them to a string with simple regex, but then I need to convert the string to a function name to call, and that's where my issue is.
perlpilot_ what do you mean 'read them to a string with simple regex'? 01:19
What are you writing to the file exactly?
weabot a table, key => value where value is a Block 01:20
weabot I want to save the table and read it right back 01:20
weabot for this I'm writing it in a parseable way, and I need to read it back, and I assume that it'll be read as a string 01:20
so I need to get the function name from the value in the string
perlpilot_ so ... write Perl code and EVAL it when you read it? 01:21
weabot I didn't know about that, thanks 01:22
[Coke] finds a p6 project he hasn't committed to in... 3years. 01:51
[Coke] unbitrots it. had some .lol's and other legacy stuff 02:33
AlexDaniel[m] m: say 42 02:38
camelia 42
AlexDaniel[m] m: say ‘
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in curly single quotes; couldn't find final "’"
at <tmp>:1
------> 3say ‘7⏏5<EOL>
expecting any of:
argument list
curly single quotes
AlexDaniel[m] heh, now I know what [m] means 02:42
SmokeMachine m: ((* + *)).assuming(1) 03:12
camelia No such method 'assuming' for invocant of type 'WhateverCode'
in block <unit> at <tmp> line 1
SmokeMachine why WhateverCode doesn't have a assuming?
skids Can't think of a good reason. Technically, because Block isn't in its mro. 03:17
SmokeMachine the documentation says that .assuming should be on callable: docs.perl6.org/routine/assuming but it seems to be on Block... 03:18
Callable
skids Yeah. 03:19
S06 specs Callable.
SmokeMachine so, I'll try to fix that... ok? 03:20
PapaChub p6: say [ { a => 1, b => 2 } ].elems 03:21
camelia 2
PapaChub p6: say [ %( a => 1, b => 2 ) ].elems 03:22
camelia 2
PapaChub p6: say [ %( a => 1, b => 2 ).item ].elems
camelia 1
SmokeMachine p6: say [ { a => 1, b => 2 }, ].elems
camelia 1
skids m: say [ ${ a => 1, b => 2 } ].elems
camelia 1
PapaChub skids++ 03:23
skids hashes are iteratable and iterables blow up if they are the single argument, is why. 03:24
PapaChub SmokeMachine +.99 -- The comma seems like a hack :-}
skids With the comma, the single iterable argument is the list which the comma made. 03:25
PapaChub For all the times, e.g., JSON barfs on "extraneous" commas, it seems odd that it's significant here 03:26
todd Hi All! There are times when I need to know who called a sub. In Perl 5 I use to do: `my $WhoCalledMe = ( caller(0) )[1];`. How do I do this is perl 6? 03:28
MatrixDaniel maybe you need callframe ? 03:29
MatrixDaniel ( docs.perl6.org/type/CallFrame#sub_callframe ) 03:29
skids If you want the package, CALLER:: or CALLERS:: 03:30
CALLERS skips frames you usually don;t care about. 03:31
skids We are supposed to have caller() but it isn't implemented yet. 03:33
RT#123826 03:34
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=123826
todd Sub call frame look like it will help. Thank you! 03:35
PapaChub vs. Backtrace ?
skids Backtrace is more a debuging/error path thing. It's expensive. 03:36
geekosaur todd, didn;t we go through this on the mailing list yesterday? 03:44
geekosaur although iirc you hit a leaky internal abstraction that timotimo needs to fix 03:45
geekosaur (basically, if you get an error that mentions NQP and you are not explicitly using NQP, you have found a bug in rakudo) 03:47
geekosaur this was NQPRoutine that came up iirc 03:47
todd geekosaur: yes we did. The routine given in docs.perl6.org/type/CallFrame is foobar. Timo went into it. Look for the third post under subject: "what am I doing wrong here?" 03:50
geekosaur yes, that's what I was talking about
so you hit a rakudo bug that needs to be fixed
todd Lucky me! Huh!
geekosaur there may not be a good workaround in the meantime, since internals-leaking bugs are often hard to get around without digging into internals 03:51
and you probably don't want to have to mess with nqp just to find out your caller
todd I may just wait until `rt.perl.org/Public/Bug/Display.html?id=123826` gets fixed. I will play a bit with callframe to see what it will cough up. 03:52
geekosaur I should probably also ask if you figured out the other issue 03:53
todd I program in top down. When a lot of folks are calling a sub, I sometimes need to know who the culprit was that sent bad data 03:53
geekosaur perl 6 subs are lexical, perl 5's are (by default) shared and externally visible
you might want to consider inverting it for now: instead of trying to find that out yourself, immediately return a Failure and let the culprit handle it :) 03:54
(or not, and explode in their context instead of yours)
the NQPRoutine issue might not let you find out who called you, but the Failure will remember where it came from 03:55
todd "lexical" doesn't mean anythign to me. I look it up int he disctionary and I understand for about three minutes. Would you mind writing out what you mean without that word.
geekosaur I showed it to you in my last email
todd I adore the method in the sub because I only have to write the degubbing code one and not into every caller 03:56
geekosaur m: module A { sub foo { say "nope" }; our sub bar { say "yep" } }; A::bar(); # bar has a globally visible name
camelia yep
todd what was the subject line of the eMail?
geekosaur m: module A { sub foo { say "nope" }; our sub bar { say "yep" } }; A::foo(); # foo's name only exists within A
camelia Could not find symbol '&foo'
in block <unit> at <tmp> line 1
geekosaur in perl 5, both of those would be visible from outside (and before 5.18 you couldn't even put 'our' on it) 03:57
todd oh. I played a bit with it and saved it for when I have time and not a bunch of stuff tearing at me (I am a computer jack of all trades) 03:58
geekosaur so basically you can only use Module::subname if it was declared "our". in perl 5 you can "always" use it (perl 5.18+ has local subs, but they were/maybe still are? apparently broken) 03:59
so the only way to do that is to make them all "our" subs
I think at some point there is supposed to be a pragma that lets you specify defaults (like 'our') but it doesn't exist yet 04:01
todd What cionfused me was that the sub came from a module (pm6). I did not know where to put the "our". `our sub Which($ProgramName) is export {good stuff;}` or put it is the "use" (our use)? I was also told that specifying what subs you want to import from modules is still on the drawing board. That is why you saw me comment is out `use CheckDependancies; # qw[Which]` 04:03
geekosaur the former
this is specifying in the definition of the sub that it is to be part of the module's symbol table (so Module::name works) 04:04
todd Sorry for all the typos.
geekosaur it is distinct from 'is export' which means some other module can request that an alias to it be installed, so you can call it *without* the Module:: 04:05
and if you do neither then it's not accessible from outside the defining module at all
todd I like it! That way I don't have to 1) worry obout duplicate names and 2) don't have to scratch my head trying to figure out where that came from. I came from Modula2. I use modules A LOT. That is where I got the Top Down too. They take longer to write, but are insanely easier to maintain. 04:06
I am copying and pasting myself an eMail of what you just wrote me. Thank you! You are a good teacher. There is a tallent to that all of its own. 04:08
todd I put together a quick test of callframe. It got kind of weird. See vpaste.net/yawFm 04:16
PapaChub m: sub child { note "CHILD: $(callframe(1).code.name)" }; sub parent { child; note "PARENT: $(callframe(1).code.name)" }; parent 04:21
camelia CHILD: parent
PARENT: <unit>
PapaChub todd There are a ton of edge cases it doesn't handle, but in a pinch, maybe it's better than nothing􏿽x85? 04:22
todd I am still reading over what you wrote. I will have to play with it 04:23
Is `m:` part of the code or part of the chat line? 04:24
PapaChub No, that's to run the example. Basically `callframe(1).code.name` is a [VERY!] Quick-and-Dirty way to get your caller's name. Like I say, though, it's totally not production-quality! (What happens if you're called from a closure, or anonymous sub, e.g.) 04:26
todd oh no problem there. Todd is not smart enought to use closures or anonymous subs! It pays to be a dumbdumb at times! 04:27
made me look up `note`! Cool. I use the $*ERR a bunch and it will be easier to use that writing it all out for "say" 04:31
Is there a `print` version of `note` (no \n)? 04:33
SmokeMachine is that ok if on Callable's .assuming I transform the Callable (WhateverCode) into a Block (using EVAL) and use its .assuming? 04:39
skids: ^^ 04:40
skids You mean for a rakudo patch or as a workaround in general code? 04:41
SmokeMachine rakudo patch...
i don't think its pretty... but even the original Block's .assuming uses multiple EVALs... 04:42
to construct signatures...
skids I think what we should do is have callable stub (require, via interface) a method assuming, add an "NYI" method to ForeignCode, and write an assuming for WhateverCode. Because WhateverCode only has positionals and its .assuming can be much, much simpler. 04:43
(or find out who all the users of Foreigncode are and add "NYI" methods there.) 04:44
SmokeMachine that makes sense...
this was my first try: github.com/FCO/rakudo/commit/e9aa8...61cd92bfe8 04:45
ill move it to WhateverCode and try to make it better... 04:46
skids As far as getting rid of the EVALs in Block.assuming, really what needs to happen is meta-api's into World and the VM binder have to be made available. Otherwise you'd end up reimplementing a whole lot of QAST construction. 04:47
SmokeMachine again: makes sense... 04:53
skids Bedtime for me... best of luck! 04:54
SmokeMachine skids: thanks 04:56
AlexDaniel buggable: tags 05:30
buggable AlexDaniel, Total: 1686; BUG: 1080; UNTAGGED: 402; LTA: 180; NYI: 97; REGEX: 69; RFC: 61; TESTNEEDED: 56; CONC: 51; JVM: 49; REGRESSION: 36; UNI: 29; PERF: 28; SEGV: 26; @LARRY: 23; IO: 23; NATIVECALL: 22; POD: 21; TODO: 18; PRECOMP: 14; OO: 13; BUILD: 11; TESTCOMMITTED: 10; OPTIMIZER: 9; STAR: 7; PARSER: 6; BOOTSTRAP: 5; REPL: 5; GLR: 4; MATH: 4; OSX: 4; WINDOWS: 3; RT: 2; WEIRD: 2; BELL:
AlexDaniel .tell nine FWIW RT #132088 05:32
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=132088
yoleaux AlexDaniel: I'll pass your message to nine.
redhands very stupid question here, probably should look at REPL.pm, but how can I EVAL and intentionally introduce/leak into the surrounding scope? 08:44
moritz you can't 08:57
lexpads are immutable at run time
the only thing you can do is something my &newsub = EVAL '...';
the REPL cheats by putting subsequent lines in artificial inner scopes 08:58
redhands ah thanks 08:59
scovit Hello, the docs states that declaring your own ".new" makes correct initialization of objects from subclasses harder, how to deal with the issue? 09:00
specifically, how to make a subclass of the class Proxy, which provides her own ".new" ?
moritz why do you need a separate .new method? 09:01
scovit the question is how to make a subclass of Proxy, I can sacrify the new method in the subclass
scovit I need to add some attributes, a DESTROY and specific FETCH and STORE to proxy 09:02
last part less important then adding a DESTROY 09:03
moritz what are you trying to achieve?
scovit just a Proxy with a DESTROY would be fine
this ^
moritz no, that doesn't answer my question 09:04
moritz why do you want/need it? 09:04
scovit to free up memory once the proxy get garbaged
moritz which memory?
'cause in general, the GC frees memory for you 09:05
scovit memory I allocate in the method with calls Proxy.new, or in FETCH. using a LEAVE dont work because a Fetch get called x4 times what would be needed
for instance when say proxy; instead of my $a = Proxy. 09:06
moritz but if that memory is only referenced in the proxy, the GC will automatically collect it for you
scovit I honestly think those are all bugs but can leave with it if the language is flexible enough to give workarounds
moritz it doesnt
moritz then yes, it's a bug and needs to be reported and fixed
scovit the memory is allocated by nativecall 09:07
moritz hmm, that might be tricky; but putting the handling into a Proxy sounds like the wrong idea 09:07
scovit why Proxy has a .new method in the first place? 09:08
moritz fwiw the problem with subclassing Proxy is that Proxy is marked as a container (so that it's ignored in type checks etc.)
scovit I just need a "smarter" proxy, nothing more or nothing less 09:08
moritz seems like Proxy.new is a performance optimization 09:09
if you look at BOOTSTRAP.nqp in rakudo's source, there's a call to nqp::setcontspec 09:10
that's what a subclass of Proxy likely also needs
scovit thanks, I'll look
should be fine to reimplement proxy if it is not that big 09:11
redhands hmm, so is there is a simple way to pass a context to EVAL, or a simple way to do the same cheating that REPL does? Ideally would like to call the REPL, all I need is for stdout to be immediately flushed after every write. 09:18
Skarsnik Hello 09:59
HoboWithAShotgun when i can have a custom unicode operator ( multi sub postfix:<㎭>($v) returns Math::Angle ), why can't I have a likewise method ( method ㎭() )? 10:40
timo the restrictions on what are valid method names are stricter compared to operators 10:41
jnthn m: say '㎭' ~~ /\w/
camelia Nil
timo m: say uniprop "㎭"
camelia So
moritz
.oO( it's your signfificant other!)
timo that's rad 10:42
jnthn m: class C { method ::('㎭') { 42 } }; say C.'㎭'()
camelia 42
moritz operators aren't limited to identifiers
jnthn It's possible if you're willing to quote
HoboWithAShotgun amazing :) 10:44
abraxxa jnthn: regarding cro SSL->TLS, do you want to keep the cro-ssl history, so should I clone that repo, change all names and push that to cro-tls? 10:44
jnthn abraxxa: Yes, let's keep the history, please. 10:45
So just clone/tweak/push would do it fine
abraxxa ok 10:46
HoboWithAShotgun so now I can say 90°.㎭; and get 1.5707963267949
instead of Math::Angle.new( degrees => 90 ).radians 10:47
that's... 10:48
jnthn :) 10:48
Skarsnik huhu 10:50
HoboWithAShotgun i am trying to write something named Math::Triangle, with which i can say for example M::T.new( a => 4, b => 5, gamma => 70 ).alpha 10:51
but i am finding myself repeat logic a lot. 10:52
Xliff finally and truly groks the proxy object. 10:56
s/proxy/Proxy/
abraxxa is there already a prove equivalent in Perl 6 or do I still need to use zef to run a dists tests? 10:57
Xliff jnthn: So I think I solved the multithreading thing we got into yesterday. I did mention it yesterday before I slept. 10:58
cschwenz abraxxa: this is what i use: alias p6prove='prove --exec perl6 -r' 10:59
abraxxa cschwenz: thanks
cschwenz you're welcome! :-)
Xliff cschwenz++ - Can you pass arguments to perl6 like that? 11:00
abraxxa jnthn: Cro depends on Cro::SSL which depends on Cro?
cschwenz don't know, haven't had reason to try yet :-P
Xliff heh
jnthn abraxxa: Uh, I hope not. :) Cro::SSL depends on Cro::Core
nine In the tradition of #perl6 space geekiness: www.youtube.com/nasajpl/live
jnthn abraxxa: Which happens to provide the module Cro 11:01
(Dependencies are distribution names, not module names)
timo yo cschwenz, i got some more SDL fun to show you: twitter.com/loltimo/status/904038390131286025 and twitter.com/loltimo/status/904058942078246915
abraxxa i did 'zef install Cro' which printed ===> Searching for missing dependencies: IO::Socket::Async::SSL, Shell::Command, File::Find, Terminal::ANSIColor, OO::Monitors, YAMLish, Cro::WebSocket
===> Searching for missing dependencies: Cro::HTTP, Base64, Digest::SHA1::Native, Crypt::Random, File::Which
===> Searching for missing dependencies: IO::Path::ChildSecure, HTTP::HPACK, Cro::Core, Cro::SSL, if, LibraryMake
cschwenz timo: Ooh, that's awesome! :-D 11:02
abraxxa cschwenz: that doesn't search for module in ./lib 11:02
timo still haven't prettied up the scrolling game or made a video out of it :|
jnthn Xliff: Glad you figured something out for it; modules that cope with being used in a threaded context will save their users a lot of pain :)
stmuk abraxxa: lowercase the Cro to cro
stmuk wonders if anyone uses "local" in rakudobrew 11:03
jnthn I wonder if zef is case-insensitive on distribution names? The actual distribution name is "cro", not "Cro"
abraxxa hm, -Ilib doesn't work either
jnthn Since what it gets you is the "cro" executable 11:04
cschwenz abraxxa: hmm, i haven't ran into that because i always start me perl6 test files with use v6; use Test; use lib 'lib'; :-(
stmuk jnthn: I think zef is genreally sensitive
Xliff abraxxa: Yeah. That's why I asked my earlier question. 11:05
jnthn stmuk: Hm, interesting, I wonder why "zef install Cro" did anything other than an error, then...
cschwenz timo: the ones you linked on twitter remind me of a cross between snake and tron :-)
abraxxa jnthn: cro-tls pushed 11:06
Xliff abraxxa: Try "prove --exec 'perl6 -Ilib' -r
cschwenz Xliff++ :-)
jnthn abraxxa++ 11:07
abraxxa Xliff: yes, the colons where missing and so -Ilib was passed to prove instead of perl6
jnthn Lunch time, then meeting; bbl
abraxxa jnthn: should I update all references in cro to it too?
jnthn abraxxa: Yes 11:08
Also those things in the cro-http repo
abraxxa ok 11:09
Xliff Has cglobal matured to the point where you can use a version number instead of using a full lib name?
Ala cglobal('xml2', v2, 'symbolname', int32)
stmuk oh "zef install Cro" does find "cro"
I had problems with the capitalised version a few weeks back 11:10
abraxxa jnthn: what about ssl params, rename those to TLS too? 11:11
jnthn Yeah, distribution names and module names are two separate namespaces. There actually is no Cro::Core module, but there is a Cro::Core distribution.
abraxxa: Ummm..hmmm 11:12
abraxxa: Maybe alias them?
jnthn :tls-config(:$ssl-config) lets us accept both 11:12
abraxxa jnthn: although the module is that young?
jnthn Young doesn't mean zero users :) 11:14
We don't have to keep the alias forever, it'll just smooth things over a bit for current users, and while we update docs etc.
abraxxa ok 11:15
env vars?
jnthn Hm, which ones?
stmuk I think the dependency order for installing Cro rather cro was wrong when I tried and abraxxa seems to see something similar 11:16
jnthn can't immediately think of one with SSL in it
abraxxa jnthn: HTTPService.pm6 line 124 and 130
Xliff jnthn: The only problem with that is that libxml2 has its own globals. I don't know if what I describe will handle those, or even if I have to worry about them.
jnthn abraxxa: ah, yeah, I forgot about those 11:17
abraxxa: Just rename those, I think
abraxxa ok
jnthn I think they're barely being used, and it's a template so it only affects new code going forward 11:18
jnthn oops, I was meant to be going for lunch... 11:21
jnthn really goes :)
abraxxa jnthn: not sure if you want to bump the version of Cro::TLS as it's code identical to Cro::SSL 0.7
jnthn: Mahlzeit!
timo is Cro::TLS more than just refering to SSL by the proper name? :P
abraxxa timo: not at the moment
just early renaming to use the current proper name 11:22
timo that's fair
abraxxa timo: github.com/croservices/cro/issues/18
the aliasing didn't work and I got a Perl 5 error message I don't understand 11:23
abraxxa ah, typo, now it works 11:28
abraxxa jnthn: i have my changes for cro-http ready but can't push them 11:44
timo has a potential hotfix for the nativecall no longer supporting optional parameters 11:44
Zoffix moritz: do you want me to just fix small technical errors or keep them in a separate list with other, more general suggestions? 11:46
Like word boundary description fails to mention _ and other para says .IO creates a file handle 11:47
stmuk how sane is forking rakudobrew?
asking for a friend :)
Zoffix stmuk: so we have more than one project to not recommend? :p 11:48
stmuk more confusion is the perl way :) 11:49
Zoffix Maybe. But not Rakudo way. :)
abraxxa jnthn: sent a pr
scovit can somebody help me with nqp? I am trying to understand the code in BOOTSTRAP.npq where you define Proxy. 11:50
m: use nqp; my $a; $a := nqp::getstaticcode(sub b {});
camelia getstaticcode requires a static coderef
in block <unit> at <tmp> line 1
scovit what does this mean?
timo might be something that only makes sense in nqp? 11:52
oh, it's also used in Code.pm in the core setting
timo getstaticcode will give you the without-closures code object from a sub 11:53
moritz Zoffix: just fix it
scovit timo, so what about the error about the static coderef? 11:54
timo not sure 11:54
timo gist.github.com/timo/f00347c2d9cd6...413ce4fe16 recompile your moarvm with this patch 11:57
ah, of course
you're passing a Sub object, which simply has the code object that moarvm wants buried inside of it in some attribute 11:58
timo you need to nqp::getattr its '$!do' attribute 11:58
you can find many examples of this all over the code
sumdoc Is there something like NativeCall for C++ 12:02
For interfacing with C++
So that we can import all the functions in C++ library 12:03
moritz iirc nativecall can do a bit of C++ interfacing
where's FROGGS when we need him? :-)
though the name mangling that C++ compilers do is not standardized, so the support is somewhat shaky
sumdoc Is it possible to impement arma.sourceforge.net/docs.html C++ library in Perl 6? 12:04
moritz template-based library? probably not 12:05
Zoffix moritz: OK. Will fix. I also created "zoffix-feedback.md" file in root of the repo. I'm gonna just write down some general feedback up in there. No need to write responses; just delete the entries you read or whatever. They're separated by `---------------` with blank lines around them. 12:10
timo oh snap, grant submission deadline is *tomorrow*
Zoffix timo: cool. You gonna do a grant?
timo i'll try :) 12:11
Zoffix \o/ 12:11
timo the "project details and a proposed schedule" section is .. tricky
moritz Zoffix: sure thing, thanks 12:12
scovit timo: it is the second time in my life I truly feel like an idiot, and the first time was listening to a neo-liberal economist ;) 12:17
m: use nqp; my $a; my $b := sub { }; say $b.^attributes; nqp::getattr($b, Code, "$!do"); 12:18
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable $!do used where no 'self' is available
at <tmp>:1
------> 3attributes; nqp::getattr($b, Code, "$!do7⏏5");
MasterDuke m: use nqp; my $a; my $b := sub { }; say $b.^attributes; nqp::getattr($b, Code, '$!do'); 12:20
camelia (List @!dispatchees Mu $!dispatcher_cache Mu $!dispatcher int $!rw Mu $!inline_info int $!yada Mu $!package int $!onlystar List @!dispatch_order Mu $!dispatch_cache Mu $!phasers Mu $!why Code $!do Signature $!signature List @!compstuff)
lizmat scovit: single quotes
scovit makes sense.. it was performing substitution.. 12:21
timo we call that interpolation 12:29
abraxxa jnthn: pull-request for cro sent too 12:30
stmuk "zef install Cro" does work (although cro itself was broken pre 4832aea 12:36
stmuk zef |& seems to be buffering .. not sure it should 12:43
stmuk oh its the pipe 12:48
grondilu was wondering if he could make a mix out of a class implementing Real and wrote this: 12:59
m: say :foo(class :: does Real {}.new).Mix
camelia MoarVM panic: Memory allocation failed; could not allocate 128736 bytes
grondilu m: say :foo(class :: does Real { method Bridge { NaN } }.new).Mix 13:00
camelia Mix(foo(NaN))
grondilu well I guess I can
Zoffix grondilu: same thing exists with many of the methods. You're not giving it any way to coerce to stuff, so it keeps coersing to itself
And same thing exists with Numeric and, I guess, Stringy 13:01
grondilu ok
makes sense
Zoffix didn't see an easy way to fix this last time he looked at it
scovit this hangs probably in an infinite loop just entering $b (FETCH): gist.github.com/scovit/a72b8973e87...0032c5ff2d any help?
Zoffix m: say Numeric.new + 42 13:02
camelia MoarVM panic: Memory allocation failed; could not allocate 125968 bytes
Zoffix
.oO( stub required methods? An obvious answer, so there's probably a reason why it's not really workable in this case )
grondilu shouldn't Numeric have a default Bridge to NaN or something? 13:03
Zoffix Maybe
scovit I can imagine that the signature of $b keeps fetching and fetching and fetching... but I am missing a piece of knowledge
perlpilot It's been a while since this has happened, but lately I look at #perl6 and think "what are they talking about?!?" ;-) 13:04
Zoffix scovit: just so you know: nqp is not meant for end users. We're free to change it at will and without notice, so if you use it, you risk code breakages in the future
scovit Zoffix: thanks I acknoledge
Zoffix The whole .Bridge thing looks superfluous to me. 13:05
Zoffix It coerces to Num, so why not just use .Num instead of .Bridge vOv 13:05
grondilu isn't Bridge more general than that? 13:09
grondilu since it's being used by other roles 13:09
scovit Zoffix: imagine somebody which loves Perl has some time to spare, start to program in Perl6. At first he is excited: so many nice new features! He takes some time, he ports some libs using nativecall. Then he want to really do things in Perl 6 which you cannot do in other languages but which the docs claim to be doable 13:10
scovit he discovers that most of the library is written in another language, nqp. Then he is presented with a blue pill: take it and it will be all just a bad dream 13:11
Zoffix grondilu: I only ever seen it coerce to Num; what other types have it?
scovit: sure. Learn nqp :) Then you can help us with core hacking :) 13:12
I was just pointing it out in case you assumed that was user-facing stuff and was meant to follow same changes policy as the rest of Rakudo. 13:13
BooK the way I understand scovit's argument is that the whole "Perl6 is written in Perl6" is a half-truth
Zoffix It's not true at all, I'd say :) 13:14
teatime c'est la interpreters
scovit Zoffix I am mostly inclined to learn npq in order to accomplish my project
Zoffix (though I think I made such clames in the past)
scovit I might end up helping you in stuff in the core, but just at some point and by chance
grondilu Zoffix: Real 13:15
Zoffix Well, not "at all". "Parts of rakudo are written in Rakudo, so it's easier to understand core code than were it written in an entirely different language" is the true statement :)
scovit specifically, i was trying to make a custom proxy class
Zoffix grondilu: but all Reals are Numeric
well, all core Real types are also Numeric
And so they .Bridge to Num 13:16
grondilu ok you meant Numeric not Num
Zoffix No, I meant Num
grondilu hum
not all reals are Num, are they? 13:17
m: my $x = 1; say $x ~~ Real; say $x ~~ Num;
camelia True
False
Zoffix No, only Num are Num
m: (42, 42.0, 42e0, 42+0i, FatRat.new: 42, 1).map: *.?Bridge.^name.say
camelia Num
Num
Num
Nil
Num
grondilu that's because they use the default Bridge 13:18
Real.Bridge must return a Real, but it doesn't have to be a Num. 13:19
Zoffix It does. It bridges different types to one type (Num)
grondilu is skeptical 13:20
Zoffix And all core types return Num from .Bridge (though, now I see Complex doesn't have it), so my original point was: why the roundabout, just use a .Num
grondilu I'm currently writing a Polynomial class. I want it to implement Real. So I'm writing a Bridge method and I intend it to return a Real, not a Num. Am I doing it wrong? 13:20
Zoffix grondilu: my bet would be you'd encounter more infinite loops like you did above. Some operator will be trying to .Bridge your Real into something it can work with and will loop forever in dispatch 13:21
grondilu suddenly realizes that can be circular
yeah 13:22
otherwise I could just write class :: does Real { method Bridge { self } }
masak I've never quite understood Bridge either. I've never encountered the term "bridge" used in this way outside of Rakudo's core :) 13:23
perlpilot It's analogous to a network bridge, but with types instead of networks. (at least that's how I accept the term in my own head :) 13:25
masak yes, I _understand_ the term fine :) 13:27
grondilu I can implement Real but apparently I can overwrite its Str method :/
masak I was just never fully convinced that Rakudo's number tower needs a Bridge in the first place 13:28
grondilu m: class :: does Real { method Bridge { NaN }; method Str { "yo!" } }
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot have a multi candidate for 'Str' when an only method is also in the package '<anon|80985888>'
at <tmp>:1
grondilu that looks LTA
grondilu oh wait 13:28
m: class :: does Real { method Bridge { NaN }; multi method Str { "yo!" } } 13:29
camelia ( no output )
grondilu m: class :: does Real { method Bridge { NaN }; multi method Str { "yo!" } }.new.say
camelia yo!
grondilu of course, silly me
m: (foo => class :: does Real { method Bridge { NaN }; multi method Str { "yo!" } }.new).Mix 13:30
camelia ( no output )
grondilu m: (foo => class :: does Real { method Bridge { NaN }; multi method Str { "yo!" } }.new).Mix.say
camelia Mix(foo(yo!))
grondilu m: (foo => class :: does Real { method Bridge { NaN }; multi method Str { "yo!" } }.new).Mix.total.say
camelia NaN
pmurias timo: what's your grant project? 13:50
timo docs.google.com/document/d/102h_Nl...3yfI/edit# 13:51
the estimate is already a lot, but i'm afraid it'll actually take even longer than what i expect
Skarsnik haha the end picture 13:52
timo if on the other hand i get it done in the time estimated or lower, i can spend a bunch of time making the instrumented profiler threadsafe or implementing a sampling profiler or what have you
jdv79 Zoffix: how's the C studies goin? 13:53
Zoffix m: say 372/831 13:54
camelia 0.447653
jdv79 almost halfway?
Zoffix 48% through the C book; afterwards, will also read the GC book (it's about 800 pages) 13:55
jdv79 what is the gc book?
teatime also: what is the C book?
Zoffix jdv79: yeah, though I wasn't doing much of it in the previous few weeks. I think I'll get through the book by end of September
jdv79 cool 13:55
Zoffix "C Programming: A Modern Approach": knking.com/books/c2/
Wonderful book. Just a gem
jdv79: the GC book: www.amazon.com/Garbage-Collection-...Management 13:56
teatime "KNK is now the logical heir to K&R ... In short, get this book." high praise.
jdv79 why you want to be a garbage man? i hear they are paid ok here in nyc.. 13:57
Zoffix jdv79: hehe. I'm actually thinking of reading it in the lunch room at work... and telling all the computer unsavvy people that I'm training for a new career :P 14:00
scovit interestingly, this executed with nqp runs, while executed with perl6 hangs gist.github.com/scovit/d4dc4bd7302...500b543212 14:03
Geth doc: 87c125ebd8 | (Steve Mynott)++ | doc/Language/faq.pod6
correct name of 6.x-errata
14:21
Geth doc: 15e3851479 | (Steve Mynott)++ | doc/Language/faq.pod6
more info about roast errata based on Zoffix on IRC
14:41
grondilu m: multi infix:<+>(Real $, Pair $ where *.value === True) { NaN }; say 15:10
camelia 5===SORRY!5===
Argument to "say" seems to be malformed
at <tmp>:1
------> 3r $ where *.value === True) { NaN }; say7⏏5<EOL>
Other potential difficulties:
Unsupported use of bare "say"; in Perl 6 please use .say if you meant to cal…
grondilu m: multi infix:<+>(Real $, Pair $ where *.value === True) { NaN }; say +:foo
camelia Cannot resolve caller Numeric(Pair: ); none of these signatures match:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
grondilu m: multi infix:<+>(Real $, Pair $ where *.value === True) { NaN }; say 1 + :foo 15:11
camelia ===SORRY!===
Circularity detected in multi sub types for &infix:<+>
grondilu m: multi infix:<+>(Real $, Pair $) { NaN }; say 1 + :foo
camelia NaN
grondilu adding a constraint on the Pair triggers circularity detection.
looks like a false positive to me
aka a bug
Zoffix grondilu: yeah, there's a ticket: rt.perl.org/Ticket/Display.html?id...et-history 15:13
grondilu ok
thanks
jnthn Did anyone actually take all the candidates and manually draw out the DAG? :) 15:15
jnthn I can't imagine the cycle detection is a false positive. 15:17
It is interesting that it ends up with a cycle though
timo [Coke]: would it be bad to submit the proposal in a format other than pod? 15:33
timo looks like a link to an application is also fine 15:55
timo i've submitted the document now 16:03
Geth ecosystem: b6843a1eb5 | (Brian Duggan)++ | META.list
Add Digest::SHA256::Native to ecosystem

See github.com/bduggan/p6-digest-sha256-native
16:06
grondilu learnt more about C<Mix> lately and is quite happy about it as it's the thing he had been looking for to easily implement linear combinations. 16:12
stmuk how did I miss seeing this? 16:18
utiaji.org
Zoffix who 16:20
*whoa
Zoffix a bit too edit-happy :P Tried to select some text and it threw me in edit mode 16:22
bdmatatu Thanks for trying it :) I gave a talk about it at yapc-na 2016 16:23
Zoffix bdmatatu++ 16:24
AlexDaniel bdmatatu++ indeed 16:26
bdmatatu thanks!
AlexDaniel wait, all the changes I do there are public? 16:27
Zoffix Yes
AlexDaniel /o\
Zoffix Well, I guess
AlexDaniel: do you see Testy McTesty here? utiaji.org/wiki/main 16:28
AlexDaniel yes
Zoffix Then yes :)
AlexDaniel utiaji.org/cal heh
Zoffix neat
HoboWithAShotgun when I have a "subset foo of Cool where 0 < * < 9" and a "foo $foo = 8;", is there some magic i can apply so $foo++ rolls over and sets the value to 1? 16:29
gfldex HoboWithAShotgun: not with a subset alone 16:30
but you could overload postfix:<++> 16:31
or use a Proxy (slow)
AlexDaniel Zoffix: hey, yesterday I learned that Matrix and freenode are bridged, so looking at ZofBot it got me thinking that maybe it can solve a problem for you?
Zoffix I had a problem?
AlexDaniel Zoffix: that is, you can use Riot on your phone, pc and whatever else, all using the same nickname
Zoffix: and if you're offline, you still get these messages and mentions when you go back online 16:32
ilmari[m] waves from the matrix 16:32
Zoffix has no idea what Riot or Matrix are
MatrixDaniel ilmari:
oops
well, I still have a problem with chromium, so can't use it entirely as I want… but we'll get there once I file a couple of bug reports
ilmari[m] matrix.org is a federated messaging platform, riot.im is the flagship client (web, android, ios) 16:33
MatrixDaniel mainly, chromium does not support keyboard layouts properly, so it's half-broken for me.
Zoffix is happy with regular irc :P 16:33
ilmari[m] it works for me, but I'm only using en_GB layout
It's handy on the go too 16:34
ilmari[m] waves from Android
Zoffix just uses JuiceSSH on Android to connect to screen-ed weechat session :P 16:34
ilmari there's a matrix plugin/script/whatever for weechat 16:35
so you can keep using that
Zoffix But I don't have a problem :D
AlexDaniel Zoffix: well, sure, I just thought that I'd mention it just in case
Zoffix Thanks.
timo Zoffix: juicessh has a super annoying problem where it doesn't handle the "alternate screen" thing that terminal emulators have, so when i try to go into copy-paste mode, i'll end up getting just the server's welcome message and my "attach to screen" command, then nothingness m(
Zoffix ZofBot is more than just a messaging bot. He's... a friend \o/ 16:36
ilmari uses connectbot on his phone on the rare occasions he SSHes from it 16:36
AlexDaniel Zoffix: here's a neat screenshot though: files.progarm.org/2017-09-15-19363..._scrot.png 16:37
I still don't understand how it figured out that it is code, but whatever
Zoffix timo: I just start another juicessh instance if I need another terminal 16:37
timo that's not what i mean by "alternate screen" 16:38
Zoffix AlexDaniel: "that it is code"? What do you mean?
Oh, IT
AlexDaniel Zoffix: well, it did the syntax highlighting automatically
Zoffix Nevermind. can't read
Zoffix m: More.Int.say 16:39
camelia 1
timo alternate screen is apparently used to keep the shell untouched while some terminal ui application runs, so when it exits you get back exactly what you had before you started it 16:40
Zoffix K, good :) Thought it'd give the More :)
timo bdmatatu: the "install" section in your utiaji could use some ` ` around it to make it show up as multiple lines rather than just a single line. or do you have to indent? i'm not quite sure 16:42
skids reminds self to teach pterm to scroll up the backbuffer rather than use altscreen.
timo what's pterm? 16:43
skids linuxified putty xterm.
timo oh interesting
skids Only thing I can stand these days, what with all the libvte crummyness.
timo have you tried mlterm? it has sixel support :) 16:44
skids I may look it over but it gets really frustrating trying 10s of terms to find the one that has decent actual emulation and won't get screwed up by my various switches/vendor kit. 16:45
timo yeah
skids I actually got desparate enough to hack quick-select support into pterm just to call it a day. 16:46
teatime libvte is indeed cruminess. I was happy with urxvt for a long time. now I mostly just use xterm. 16:47
timo what's quick-select again?
skids The second cut and paste buffer in linux.
(well X)
timo ah
teatime I need to figure out how to make ctrl+shift+pgup/pgdn scroll in tmux (or screen)
timo i'm currently using mate-terminal, but it's got the worst crap for copy-paste
where when you copy something it'll apparently only remember what part of the terminal you selected 16:48
and when you paste it just takes whatever is at that spot at that very moment
skids Ow.
teatime lol, wow. wtf?
timo so good luck copy-pasting across like channels in weechat or something
stmuk I quite like the smaller vte stuff like roxterm or sakura
timo oh, on my desktop i actually use konsole
that doesn't have this problem 16:49
bdmatatu timo: Thanks, fixed 16:51
pmurias timo: re estimating grant hours, you might consider that stuff that work you don't anticipate will be neccessary 17:01
timo i'll probably have to do more work than i asked for 17:02
but the amount of money i'm asking for is already alot
timo i hope community people find my application worthwhile 17:08
timo plenty of perl5 people, too. who might not be so fond of perl6 in general? 17:13
Zoffix IME s:g/Perl\s*6/Rakudo/ helps the fondness in those cases 17:14
timo i put Rakudo Perl 6 in the title at least 17:15
HoboWithAShotgun can i have aliases in signatures? such as foo(alpha=>45) is the same as foo(α=>1) ? 17:25
jnthn :alias(:$name) 17:26
Zoffix m: sub foo (:alpha(:$α) = 45) { dd $α }; foo :42alpha; foo :70α; foo 17:29
camelia Int $α = 42
Int $α = 70
Int $α = 45
timo Zoffix: you mentioned you'd also find 3k acceptable, but i somehow ended up with 6k; does that still sound good? 17:32
Zoffix timo: I'd need to more thoroughly read the proposal. What's the link again? 17:33
timo docs.google.com/document/d/102h_Nl...iufphxvxhj
i'll surely take at least 200 hours, hopefully not terribly much more
HoboWithAShotgun allright. so using "multi sub prefix:<△>(List $list) returns Math::Triangle" I can now write say (△(α => 75°, c => 3, b => 3) ).beta; #prints 52.5°
I would like to get rid of the inner parens 17:34
or maybe even the outer ones
Zoffix HoboWithAShotgun: .beta.say with △ α => 75°, c => 3, b => 3 17:35
HoboWithAShotgun: .beta.say with △ α => 75°, :3c, :3b
:)
HoboWithAShotgun: oh, wait, it'd help if I read the actual code lol :P 17:36
HoboWithAShotgun :3b? what kind of black magic is that again
Zoffix HoboWithAShotgun: .beta.say with △ "α" => 75°, "c" => 3, "b" => 3
HoboWithAShotgun: basically, without quotes there, it's getting passed as a named arg.
HoboWithAShotgun: :3b is the same as b => 3 17:37
skids HoboWithAShotgun: It's for stuff like :3rd
Zoffix You can use any non-negative integer there
huggable: colonpairs
huggable Zoffix, All the shortcuts of colonpairs: twitter.com/zoffix/status/839807414211854337
Zoffix HoboWithAShotgun: ^ lots of good stuff there
skids Anyway probably you want a slurpy rather than List $list. Which one depends on how you want to handle flattening. 17:39
HoboWithAShotgun skids, i am just routing the arguments to the triangle operator to call the Math::Triangle constructor 17:41
Zoffix Oh yeah, you need a slurpy there too. And if you use a named arg slurpy, you won't need to deal with the quoting business 17:42
HoboWithAShotgun i'm doing this multi sub prefix:<△>(List $list) returns Math::Triangle is export( :operators ) { return Math::Triangle.new( |%$list ); } 17:43
works fine
what benefit would i get from using a slurpy? 17:44
Zoffix HoboWithAShotgun: and you get a list of three pairs? 17:48
m: sub prefix:<♥> (List $l) { dd $l }; ♥(a => 42, b => 70)
camelia List $l = $(:a(42), :b(70))
Zoffix Ah, I see. It's not a sub call :D 17:49
HoboWithAShotgun: the slurpy will let you get rid of the parens ther
Zoffix m: sub prefix:<♥> (*%l) { dd %l.list }; ♥ a => 42, b => 70 17:49
camelia WARNINGS for <tmp>:
Useless use of "b => 70" in sink context (lines 1, 1)
Too many positionals passed; expected 0 arguments but got 1
in sub prefix:<♥> at <tmp> line 1
in block <unit> at <tmp> line 1
Zoffix never mind. I don't have a clue what I'm talking about :)
HoboWithAShotgun loser 17:51
;-)
allright, i gonna let that sink
have a good day everybody. tx for the input
Zoffix m: multi postfix:<°> { $^a }; multi prefix:<△> (*@things) is looser(&[,]) { class Triangle { has $.things; method beta { $!things.perl.uc } }.new: :@things }; .beta.say with △ α => 75°, c => 3, b => 3 17:54
camelia $[:Α(75), :C(3), :B(3)]
Zoffix .tell HoboWithAShotgun managed to make it work without parens (and slurpy slurps the things): multi postfix:<°> { $^a }; multi prefix:<△> (*@things) is looser(&[,]) { class Triangle { has $.things; method beta { $!things.perl.uc } }.new: :@things }; .beta.say with △ α => 75°, c => 3, b => 3 17:55
yoleaux Zoffix: I'll pass your message to HoboWithAShotgun.
Zoffix timo: I'd suggest beefing up the benefits and explanation what will be happening. List benefits to Rakudo core devs, since this stuff will help us make more perf improvements. Add some "Terms" section that has 1-sentence explanation for all the fancy-pants terms like OSR, decont, spesh, jit. 18:12
Zoffix timo: basically, I've no idea what the work involved is gonna look like. If it costs 6G, it's fine. But right now to the reader who's not intimately familiar with the interals, it just reads like a wall of acronyms and buzz words, and all they walk away with is there'll be an optimizer program at the end of the 6G. If you'd describe the challenges and problems that need to be solved in more detail, I think 18:15
it'd help convince more people.
Zoffix my 2 cents :) 18:16
Also, you have left-over hours information in "A framework for embedding "domain knowledge" into the GUI, so that common patterns can be pointed out to the user [5h; sum: 9h]" 18:17
Zoffix & 18:20
Geth ecosystem: fdc74f49c9 | (Jonathan Stowe)++ | META.list
Add MQ::Posix

See github.com/jonathanstowe/MQ-Posix
19:40
skids -E_NEED_CAFFEINE_TO_GET_CAFFEINE 19:46
davidfetter hi 19:52
i know it sounds insane, but i'm looking to embed perl6 in a C program (well, a PL for PostgreSQL) 19:53
is that a thing?
moritz davidfetter: since Inline::Perl6 exists in Perl 5, I'm sure it's possible 19:54
davidfetter docs.perl6.org/language/nativecall <-- kinda the opposite way 'round
timo moritz: the thing is that Inline::Perl6 just replaces the perl5 process with a perl6 process that includes the rest of the program with Inline::Perl5 :) 19:58
davidfetter somebody page Rube Goldberg
perhaps PL/npq might be a better plan 19:59
timo you can always build an evalserver that takes code on a socket and puts its results back 20:07
moritz timo: so what? it works :-)
davidfetter generally used to working on PostgreSQL, where we are starting to care more and more about cache misses 20:09
(not that we ever *didn't* care, precisely...)
skids Well, you can pass Perl6 callbacks into NativeCall code, right? So... just flip the paradigm :-) 20:14
BooK s: Bool.WHICH 20:15
SourceBaby BooK, Something's wrong: ␤ERR: Cannot resolve caller sourcery(ObjAt); none of these signatures match:␤ ($thing, Str:D $method, Capture $c)␤ ($thing, Str:D $method)␤ (&code)␤ (&code, Capture $c)␤ in block <unit> at -e line 6␤␤
BooK (not sure how that s: thing works) 20:15
geekosaur I don't think it works with that anyway, methods like .WHICH are magic (actually "macros" wired into the compiler) 20:16
BooK m: .WHICH.say for Bool.^enum_value_list, Order.^enum_value_list; 20:17
camelia List|75139120
List|75139312
geekosaur s: Bool, 'WHICH'
SourceBaby geekosaur, Sauce is at github.com/rakudo/rakudo/blob/f925.../Mu.pm#L24
BooK m: .WHICH.say for |Bool.^enum_value_list, |Order.^enum_value_list;
camelia Bool|0
Bool|1
Order|0
Order|1
Order|2
geekosaur huh it does handle that
s: Bool, 'WHAT'
SourceBaby geekosaur, Something's wrong: ␤ERR: Type check failed in binding to parameter '&code'; expected Callable but got Nil (Nil)␤ in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤ in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤ in block <unit> at -e line 6␤␤
BooK mmm, isn't lizmat's patch for Enumeration applied yet?
m: say Order::Same.WHICH, Bool::True.WHICH 20:18
camelia Order|1Bool|1
geekosaur guess .WHICH is normal, it's just .WHAT and such
that's the right commit for the patch 20:19
skids .WHICH can be macro/syntactical and code should assume it might be. But it can also be a method.
timo moritz: i wanna see you build the Perl6/PL that replaces the postgres server process :P
BooK what's f925c6 in camelia's answer? I assumed the rakudo or more commit, but don't seem to be either 20:20
skids geekosaur: rgrep "brain pretzels" specs/ 20:21
ugexe rakudo commit
moritz BooK: it's a short commit ID in the rakudo repo
geekosaur it's a rakudo commit hash
well, a prefix of one. a full commit hash is quite long
everything shortens it to a prefix, you do not have to use a specific length 20:22
BooK ah I didn't do a pull :-S
geekosaur: I have some git knowledge, yes :-)
geekosaur skids, the point was more about whether CoreHackers::Sourcery would handle t 20:23
aka SourceBaby
BooK what have I done? It seems Enumeration is getting a lot of attention these days
geekosaur so I tested it and was surprised when it worked, then tried .WHAT and it expectedly couldn't find its butt 20:24
BooK oooh, Enumeration.WHICH now contains the index, if I understood correctly 20:25
wamba m: say (1,2) === (1,2) 20:27
camelia False
wamba m: dd (set(1),set(2)) X(&) set(2), 20:35
camelia (set(set(1),set(2)), set(set(2))).Seq
BooK trying to compile rakduo ac8e099bad7c11c724c290ec557e3426f180088d gives me: 20:42
Stage mast : No registered operation handler for 'threadlockcount' at gen/moar/stage2/QAST.nqp:1576 (/home/book/src/perl6/rakudo/install/share/nqp/lib/QAST.moarvm:compile_op)
skids BooK: maybe MoarVM and nqp need updates. 20:43
BooK oh, I thought that was automated
skids depends on what you are building it with. 20:44
Geth ecosystem: da5203cb58 | (Jonathan Worthington)++ (committed using GitHub Web editor) | META.list
Add Cro::TLS
20:47
skids .tell SmokeMachine github.com/skids/roast/tree/assuming_callable has tests for Whatever.assuming in S06-currying/positional.t 20:56
yoleaux skids: I'll pass your message to SmokeMachine.
BooK m: .WHICH.say for Less..More 20:57
camelia Int|-1
Int|0
Int|1
BooK m: .WHICH.say for Less...More
camelia Order|0
Order|1
Order|2
BooK Less...* sadly is an infinite list ending with infinitely many Order::More 20:58
Altreus So the famous perl6 fib sequence is «1, 1, * + * ... *», but how do I do that *+* thing with multiplication instead of addition? 21:16
Do I have to expand it to (@fib Z<*> @fib[1..*]) ?
er, Z*
tadzik m: my $a = 1, 1, *** ...*; say $a[^5] 21:17
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 3my $a = 1, 1, *** ...*7⏏5; say $a[^5]
expecting any of:
prefix
term
tadzik bah
well, that would work too:
m: my $a = 1, 1, { $^a * $^b } ...*; say $a[^5]
camelia (timeout)Potential difficulties:
Useless use of ... in sink context
at <tmp>:1
------> 3my $a = 1, 1, { $^a * $^b } ...7⏏5*; say $a[^5]
21:18
SmokeMachine skids: great! thanks!
yoleaux 20:56Z <skids> SmokeMachine: github.com/skids/roast/tree/assuming_callable has tests for Whatever.assuming in S06-currying/positional.t
tadzik hm
SmokeMachine Ill continue to try to fix that when I arrive at home... 21:19
tadzik m: my @l = 1, 3, { $^a * $^b } ... *; say @l[^5] # that's better
camelia (1 3 3 9 27)
timo m: my $a = 1, 1, * * * ... *; say $a[^5] 21:21
well, that'll just be a list of ones
camelia (timeout)Potential difficulties:
Useless use of ... in sink context
at <tmp>:1
------> 3my $a = 1, 1, * * * ...7⏏5 *; say $a[^5]
tadzik yup
SmokeMachine m: my $a = (2, 3, * * * ... *); say $a[^5]
camelia (2 3 6 18 108)
timo oh, yes, $a on the lhs 21:22
we would have wanted @ on the lhs or the parens SmokeMachine gave
SmokeMachine m: my $a = (2, 3, * × * ... *); say $a[^5] 21:24
camelia (2 3 6 18 108)
Altreus I thought I tried that! 21:45
Altreus what do I read to understand this? my @fact = [\*] 1..*; 21:56
Altreus specifically this \* in the operator 21:56
timo it's a triangle reduce rather than a regular reduce 21:57
(because the [\ looks a bit like a triangle)
Altreus oh interesting 22:03
timo some languages call it "produce"
Altreus I found the docs that explained it :) 22:13
it was pretty obvious once I simply removed it :P
timo it'd be nice if [\ would give you an entry immediately, but when you "use web search" you immediately get the right answer, too 22:16
but it's got a big red background as if "you did something wrong"
and it would probably be cool if reduce-[ ] and produce-[\ ] also showed up on the page for [ ] 22:22
i think i'll open a doc issue 22:23