»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
Geth Blin: b535dc0d72 | (Aleks-Daniel Jakimenko-Aleksejev)++ | bin/blin.p6
Oops, only save *new* output

New = Bad, so that's what we are interested in.
00:26
holyghost good morning 02:34
buggable New CPAN upload: Mathx-Chaos-0.1.1.tar.gz by HOLYGHOST cpan.metacpan.org/authors/id/H/HO/...1.1.tar.gz 03:08
holyghost ^-- working correlation dimension (with tests)
My newest package, the chaos theory I mentioned
holyghost You can for example use a correlation dimension as a Boltzman model to prodict jackpots :-) 03:10
holyghost s/prodict/predict 03:12
holyghost I've added marginal distributions sample calculation method in Mathx::Stat at github 03:52
Apparently these can be used for Monte Carlo methods
which where the statistics comes into the dynamical systems 03:53
holyghost basic samples on random variables are Monte Carlo samplers, then highly dimensional for dynamical systems 03:57
then use the marginal distributions for calculations
holyghost Problem is 'where am I going to put my Markov Chain in my modules 03:58
for MCMC (Markov chain Monte Carlo)
hythm_ Hi, Let's say I have package a version 1 and package a version 2, will call them a1 and a2. package a1 depends on package b1. and package a2 depends on any of b2 or b3, pluse it also depends on package c2. I will represent this dependency as this datastructure: for a1 it is (a1, b1). for a2 it is (a2, (b2, b3), c2) 04:25
combining these two together ((a1, b1), (a2, (b2, b3), c2)) I'm trying to select best candidate a1 or a2 (and its dependencies) based on a predefined condition. 04:26
that is first check a1 if it meets the condition, then check its deps, if b1 doesn't meet the condition then discard the whole (a,b), and move to next item (a2, (b2, b3), c2), if a2 meets the condition, check (b2, b3) and take only the first one that meet the condition,assuming it is b2, then move to c2.
hythm_ I'm trying to rephrase my question I posted earlier here gist.github.com/hythm7/c0d4a99e50d...81b02b7095 04:26
buggable New CPAN upload: Mathx-Stat-0.2.6.tar.gz by HOLYGHOST modules.perl6.org/dist/Mathx::Stat:...:HOLYGHOST 04:28
holyghost ^-- Marginal Distributions are in
you have to generate the distribution itself by calculating the marginal distribution randoms from another distribution 04:30
by method GeneratedNumber in DistributionPopulation.pm6 04:31
I didn't double disptach however
buggable New CPAN upload: Mathx-Stat-0.2.7.tar.gz by HOLYGHOST modules.perl6.org/dist/Mathx::Stat:...:HOLYGHOST 04:48
holyghost ^-- test bugfixes 04:52
Mathx::Stat is mature enough now to use
buggable New CPAN upload: Mathx-Chaos-0.1.2.tar.gz by HOLYGHOST modules.perl6.org/dist/Mathx::Chaos...:HOLYGHOST 05:28
New CPAN upload: Bayes-Learn-0.2.2.tar.gz by HOLYGHOST modules.perl6.org/dist/Bayes::Learn...:HOLYGHOST
holyghost ^-- my tests bufgixes 05:29
That'll be it for today, so AI::Agent, Mathx::Stat, Mathx::Chaos and Bayes::Learn are working. Tomorrow I'll start back on Mathx-Chaos and Game-Markov when I read up 05:30
buggable New CPAN upload: AI-Agent-0.2.7.tar.gz by HOLYGHOST modules.perl6.org/dist/AI::Agent:cpan:HOLYGHOST 05:48
holyghost ^-- same test bugfixes 05:51
holyghost hi jmerelo 06:03
jmerelo: I fixed the use Test; with is-deeply instead of ok 06:04
Then I put in marginal distributions in Mathx::Stat and there's Mathx::Chaos now (working, test incl.) where I need it for sampling e.g. Monte Carlo or Markov Chain 06:05
AFAIK now, the meaning is to calculate chaos theory with statistics 06:06
e.g. calculate attractors
this will end up in Mathx::Chaos 06:07
now there's just the old correlation dimension routine from Mathx::Stat into Mathx::Chaos 06:08
HTH
thx for helping me out, I have 4 mature packages now 06:10
They're all also in the CPAN ecosystem 06:12
last upload, 1/2 hour ago
holyghost un ceaux a vin pour moi oui (a bucket of wine for me yes) 06:17
I'm going to buy a beer in 10 minutes, then I'm going to give up smoking and drink less 06:19
It'll make my perl6 code better 06:20
My oldest daughter would not want any less, she's 17 now :-) 06:21
With the pm job, I'll have more money for both of them 06:22
anyway, I'm very happy with my niche :-) 06:23
Geth doc: 1aff04599c | (JJ Merelo)++ | doc/Language/regexes.pod6
Revises rephrasing of \n matching magic.

  @fluca1978's contribution is OK. Some reformatting, too. Closes #1709.
06:37
synopsebot_ Link: doc.perl6.org/language/regexes
Geth doc: 16d30e0aa1 | (JJ Merelo)++ | doc/Language/regexes.pod6
Reflows and reformats, closes #1790
06:39
holyghost good work, jmerelo 06:48
Geth doc: 69a8d377e9 | (JJ Merelo)++ | doc/Language/regexes.pod6
Unicode should go in caps
07:04
doc: b49df78296 | (JJ Merelo)++ | doc/Language/regexes.pod6
Rephrasing and reflow
synopsebot_ Link: doc.perl6.org/language/regexes
scimon 22 of 24 modules chosen for Saturdays talk. 10:31
Broke my rule and selected at least one with LTA documentation.
timotimo .o( i wonder if it's one of mine ) 10:40
lizmat scimon: or mine ? 10:41
scimon timotimo and lizmat nope. 10:52
(Though I think I have at least one from both of you) 10:53
lizmat *phew* :-)
scimon This one is actually really old but really neat.
(But I have preferred libraries with some solid docs, preferably in the Readme)
sena_kun scimon, is there a list somewhere or it's a secret right now? 10:54
scimon Well I'd like to have *some* suprises ;) 11:03
What I might do for the advent calender is document one of two modules as blog posts and then use that as basis for a documentation PR. 11:04
(one or two even) 11:06
I figure doing more than one advent calendar post would be good at this rate? 11:07
jnthn Yeah, it seems the list of advent posts is a bit sparse this year 11:12
I'm trying to think what I could write about :)
sena_kun jnthn, Comma in daily use? ^^' inb4: that's another topic for you, sena_kun. 11:16
Geth mu: 492803ff7e | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | misc/perl6advent-2018/schedule
add one entry
11:19
lucasb in a pair, if KeyType =:= ValueType, would you say the pair is "reflexive" or "symmetric" ? (I'm looking for the right word, but I guess both applies) 11:42
for example, I want to reverse the pair (k,v) => (v,k), but that should only be possible if the k/v types are compatible 11:43
tobs` lucasb: "symmetric" sounds strange to me if you leave the context out that it is about the *types* (it might as well mean that key and value are the same). 11:49
scimon (NB I'm not thinking about the advent calender too much until Monday) 11:53
lucasb yeah, I want to mean that the pair is "reverseable", "invertable", "flippable"
tobs` "reflexive" would be better in the sense that I'd have no strong conviction what it's supposed to mean and would go look it up the first time around. 11:54
oops, gotta go
lucasb ok, thanks
another terminology would be to use homogeneous/heterogeneous to mean to pairs that have the same k/v types or k/v with different types 11:55
m01ar hi everybody 12:52
sena_kun o/ 12:53
m01ar tried to find any faq on rakudo.org and moarvm.org, but found nothing. The question is my moarvm on Win7x64 hangs when i execute prompt in repl mode
in script mode everything is ok 12:54
timotimo interesting, it could be a problem with the readline/linenoise library in use
m01ar can I help with finding out the source of this bug/behavior? 12:55
andrzejku .seen araraloren 13:01
yoleaux I saw araraloren 4 Nov 2018 16:06Z in #perl6: <araraloren> Zoffix okay, thanks :)
andrzejku .seen loren
yoleaux I saw loren 8 Jul 2016 13:51Z in #perl6: <loren> e, ^_^ .. haha don't mind
timotimo i think you can 13:03
i'm a little sidetracked at the moment
kensanata m01ar: Perhaps trying it in a different terminal, like mintty from cygwin, or the gitbash terminal (not sure what they use?), just not cmd?
timotimo do you have a gdb or windows equivalent available? you could attach it to the process and get stack traces from all threads
then we would see if it hangs in some suspicious place 13:04
kensanata My first suspicion would be terminal detection. If the process thinks there is no terminal attached, it might do buffering instead of printing line by line? 13:05
kensanata This is based on my experience with interactive processes running within Emacs, though. :) 13:05
m01ar kensanata: I tried on cmd.exe and via ConEmu. I'll try on mintty now 13:06
timotimo right, there's an env var that forces rakudo to believe it's a non-interactive version, but i don't know if you can do it the other way around, too 13:07
could actually be, for testing the repl and such?
m01ar timotimo: I'm not quite familiar with debuggers, but I'll try to get the stack traces
timotimo in gdb you will probably just have to "thread apply all bt" 13:08
aha! 13:09
rakudo can take a --repl-mode=interactive flag
m01ar: please try if that makes a difference
m01ar timotimo: already tried this switch - no difference
timotimo OK 13:10
kensanata Oh. :(
m01ar having slow connection, sorry. Trying to download cmder/git-for-windows bundle :) 13:12
timotimo when you have something like "say 'hi'", return and then ctrl-d (or equivalent), does the code execute? 13:16
m01ar timotimo: you mean in which --repl-mode= ? 13:17
timotimo try it with and without, please
m01ar ok
> say 'hi' [Enter] \n hi \n > [Ctrl+D] Repl terminates 13:19
timotimo oh
OH!
when you execute prompt() in repl mode
if i had read that, it would have been much better %)
prompt is supposed to return after a single line has been entered, but on your machine it just eats text for seemingly ever? 13:20
m01ar cmd: perl6 /newline/ To exit type 'exit' or '^D'/newline/> prompt 'enter something '[ENTER] /newline/ enter something # Hanging here 13:22
cmd: perl6 --repl-mode=interactive # same story 13:23
timotimo what if you type like a big amount of stuff?
m01ar timotimo: sorry? 13:24
araraloren not araraloren; just clearing the bot 13:25
m01ar prompt 'prompt-text: ' [ENTER] then I see my prompt-text and it does not respond to keyboard input ever 13:27
lucasb are you trying to read input while in the REPL?
m01ar yes 13:29
lucasb I don't think the standard REPL is sufficiently advanced to do that 13:31
I mean, the REPL already controls STDIN
I tried this in other languages repls and in fact they can do that, but not the current P6 REPL 13:32
m01ar that's why I'm asking for help or comments. Should it really hang or abort with a message like "sorry, prompt is not supported in REPL on your OS/shell" 13:34
lucasb oops, sorry. I was testing a different REPL. disconsider everything I wrote about the P6 REPL :)
looks like everything works fine in unixland P6 REPL 13:36
in windows, I don't know, but I agree, yes, a little message warning the user would be nice
m01ar tried to start perl6.bat on mintty but it didn't even start 13:43
m01ar what is the purpose of perl6-debug-m.bat? it runs in ansi colors and does not accept prompt command at all ("Sorry, I don't understand; for help type h") 13:47
seem like it's not a perl6 repl at all, sorry 13:48
m01ar here is my stack trace when moarvm hung pastebin.com/U74WUfJa 13:54
m01ar timotimo: here is my stack trace by gdb pastebin.com/uGgaNQca and by processhacker pastebin.com/U74WUfJa 14:08
Poohman m: say {say "Enter:"; return {$*IN.get.Str eq "y"}} 14:12
camelia -> ;; $_? is raw { #`(Block|69277040) ... }
timotimo oh
could you re-run but set "MVM_JIT_DISABLE" in the environment first?
having the jit on can make stack traces a bit weird
m01ar ok
Poohman hello all, how can I return a value from a lexical scope outside it without writing a subroutine? 14:14
masak m: IMMEDIATE: { say "A"; last IMMEDIATE; say "B" }
camelia A
labeled last without loop construct
in block <unit> at <tmp> line 1
masak this doesn't work in Perl 6, but it works in JavaScript (as per spec)
moritz Poohman: only if it's the last statement in the scope
masak ISTR it also works in Perl 5...?
any other languages where it (breaking from a labeled immediate block) works? 14:15
moritz Poohman: it's supposed to work with the 'leave' statement, but that's not yet implemented
Poohman ok
moritz: if its the last statement, will it work now?? 14:16
moritz m: my $x = -> { 23; 42 }(); say $x
camelia WARNINGS for <tmp>:
42
Useless use of constant integer 23 in sink context (line 1)
moritz Poohman: ^^ see above (ignore the warning) 14:17
Poohman m: say ->{say "Enter:"; return {$*IN.get.Str eq "y"}} 14:18
camelia -> { #`(Block|68628000) ... }
Poohman m: say ->{say "Enter:"; {$*IN.get.Str eq "y"}}
camelia -> { #`(Block|59477504) ... }
Poohman m: say ->{{$*IN.get.Str eq "y"}}
camelia -> { #`(Block|84846488) ... }
Poohman m: say ->{$*IN.get.Str eq "y"} 14:19
camelia -> { #`(Block|68540312) ... }
Poohman m: say ($*IN.get.Str eq "y")
camelia False
Poohman m: say ({{$*IN.get.Str eq "y"}})
camelia -> ;; $_? is raw { #`(Block|57445048) ... }
m01ar timotimo: new stack trace pastebin.com/AHWdGMRZ 14:27
Poohman hello all, how does STDIN work for REPL? 15:23
moritz not very good
Poohman ok I thought was a Windows thing 15:24
lichtkind what exactly is now different with $*ARGFILES ? Thanks 15:37
moritz different? in comparison to what? 15:39
lichtkind moritz 6.c and 6.d i read the delta but i can only vaguely assume what was strictened 15:51
moritz lichtkind: github.com/rakudo/rakudo/commit/84...da80b7f3f3 seems to be the main change 15:56
lichtkind moritz++
jmerelo So 16:12
I'm starting to be mildly worried by the absence of writers for this year's calendar 16:13
jmerelo github.com/perl6/mu/blob/master/mi...8/schedule 16:13
You know it does not need to be a technical article. It can be a set of pointers to articles, talking about the community, resources to get introduced to Perl 6 16:14
Summertime its the 25 posts for december thing right? 16:21
jmerelo Summertime: right
First free day is Dec 3rd. Would you want to take that one? 16:23
scimon So I need to think of some things. Right now I'm thinking I'll be picking some cool but under documented modules and writing some How-To's
jmerelo scimon: that would be great :-) 16:24
Poohman m: say $*DISTRO
camelia opensuse (42.3)
scimon But I don't want to say I'll do more than the one I'm down for until after the weekend.
Poohman m: say {$*DISTRO} 16:24
camelia -> ;; $_? is raw { #`(Block|70340472) ... }
Summertime if I was to do something it'd be "porting sh scripts to perl6", but I dunno if I could make that more interesting than a link to a .diff :n I'll try writing something up over the next couple days and let you know if something worthwhile comes out 16:25
jmerelo scimon: In which time I need to invite you to a couple of beers 16:26
Summertime: you don't need to write it in advance. Just the will will do for the time being. That sounds interesting enough.
Summertime if I don't write it in advance, I can't write it at all! inverse motivation is a pain 16:27
jmerelo Summertime: suit yourself :-) Remember this is not like a conference call for papers. Something lighter, even basic, will do. 16:28
SmokeMachine scimon: where do I sign to make Red a candidate for that? 16:31
:P
scimon SmokeMachine: Red has awesome documentation (compared to somethings I've looked in the last couple of weeks). 16:32
tobs` I'm writing a module that I'd be happy to talk about even for two advent days, but it could be that the things I want to talk about aren't functioning yet by then :/
scimon Just make that plain "Here's what I've done. Here's what I'm planning to do" 16:33
Summertime an article listing relatively beginner-friendly issues within perl6 and the perl6 module ecosystem, would be nice 16:34
SmokeMachine scimon: :) Im afraid of what you've been reading... :P 16:36
jmerelo tobs`: you'll have something functioning. That's enough. 16:43
I mean, I'm not going to say we are kind of desperate. But check the date, check the schedule.
We really need all hands on deck. 16:44
That means you too, Poohman
Whatever it is you're doing, it's good enough for the Perl Advent Calendar if you're good enough with English. If you're not, the editing crew (meaning whoever I'm able to cordon for the task) will help you.
Geth mu: taboege++ created pull request #37:
perl6advent-2018: claim 15th
16:53
tobs` crosses fingers 16:54
Geth mu: fd2173d4e8 | (Tobias Boege)++ | misc/perl6advent-2018/schedule
perl6advent-2018: claim 15th
mu: b7755825a1 | Altai-man++ (committed using GitHub Web editor) | misc/perl6advent-2018/schedule
Merge pull request #37 from taboege/advent-2018

perl6advent-2018: claim 15th
sena_kun tobs`, I am writing a module with quite a severe deadlines too(for another deal though), worse I don't know the spec perfectly, but I think it's possible to make it in time. So you are not alone. :) 16:55
sena_kun I'll claim another spot if it'd be possible to separate my topic into two posts(content-wise it is doable, not sure about amount) and if some will be missing. 16:58
Summertime just so I'm sure, this is what feeds modules.perl6.org? github.com/perl6/ecosystem/blob/ma.../META.list 17:00
sena_kun checks sources... 17:01
Summertime hmm, grabbing all issues from all github/gitlab repos listed there shouldn't be too hard
jmerelo Summertime: that, and CPAN 17:02
When you use zef, it updates itself with a couple of files, one from there, the other from CPAN. Those contains all known modules.
just about 1500
sena_kun: sure. Do that by all means.
Thanks both! 17:03
sena_kun Summertime, I think, github one is one that you've posted here, cpan one is queried. anyway, you can find ready cache at github.com/ugexe/Perl6-ecosystems 17:04
Summertime thank you both kindly 17:05
tobs` I wonder if someone could help me optimize (for speed) a script I made (for beauty) and we get a joint article out of that, for one of the early unclaimed days. github.com/taboege/p6-costas/blob/.../costas.p6 17:12
As a matter of fact, this script has been running (with input N=32) for 254 processor hours and is currently using 238 GiB of RAM, which I don't think it should.
(Apologies for the state of that repository. I just pushed it from the dark corners of my hard disk, didn't expect to share it.) 17:13
timotimo m0ltar: sorry, most of these functions don't tell me much; i can't really tell what's going on there
tobs`: is there a way to reduce the amount of work easily so we can get it to finish in a minute or two and improve performance from that? 17:15
tobs` yes, N=32 is an open (toy) problem in research
SmokeMachine tobs`: `new Literal: :!negated, :i($ij[0]), :j($ij[1]);` is something I'd never thought... but makes sense... (I mean the `new Type: args`) 17:16
tobs` `./costas.p6 $N outfile` for any N ≤ 13 should be very ok
timotimo: ^
SmokeMachine: I'm not a C++ programmer, but I like how it reads :-) 17:17
timotimo: uhh, let's say N ≤ 7 :-) 17:21
timotimo i went with 5 for now 17:22
all the -> ($i, $j) seem to force usage of the slow-path binder for some reason, that's not so good
i'll have to go AFK for an unknown amount of time soon 17:23
tobs` me too
timotimo changing those to flat ..... -> $i, $j doesn't make things faster 17:24
tobs` (fwiw, N=24 took almost exactly 2000 minutes ≈ 33 hours to compute, so I didn't expect 13 to be that hard already but 5 should be ideal for profiling) 17:26
Poohman m: say "{$*DISTRO}" 18:24
camelia opensuse
Poohman m: say "{$*DISTRO}{$*DISTRO}" 18:26
camelia opensuseopensuse
Poohman m: say "{$*DISTRO;$*DISTRO}"
camelia opensuse
Poohman m: say "{$*DISTRO;$*PERL}" 18:27
camelia Perl 6
Poohman m: say "{$*DISTRO;$*PERL eq Perl 6}" 18:28
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say "{$*DISTRO;$*PERL eq Perl7⏏5 6}"
expecting any of:
infix
infix stopper
statement end
statement modifier…
Poohman m: say "{$*DISTRO;$*PERL eq "Perl 6"}"
camelia True
timotimo what are you trying to do here? :)
Poohman m: say {say "Enter:"; return {$*IN.get.Str eq "y"}} 18:29
camelia -> ;; $_? is raw { #`(Block|59418992) ... }
Poohman something like this
basically wanted to have a condition for a while looü
timotimo sorry, i don't understand
Poohman loop 18:30
but was using a repeat while
timotimo OK
Poohman so wanted to include 2 statements in the while condition
one to print stuff out - like a question
timotimo ah 18:31
well, you could just use prompt instead of $*IN.get
that prints a little piece of text and then gets a line from stdin
Poohman aaaahhhh
sena_kun maybe "until prompt('Enter (y/n): ') eq 'y');
Poohman nein
timotimo perhaps use .fc so y and Y both work
Poohman spent three hours on that
sena_kun `until prompt('Enter (y/n): ') eq 'y' { say "Do again!" }` 18:32
if I understand correctly.
timotimo yes, but in a while/until puts the block in front of the condition 18:33
Poohman cool - thought about everything - didnt y`all
I want the condition in the begiining - I could have written a second say - but wanted to avoid that and was playing around
thanks 18:34
[Coke] was confronted by a wolf spider at his home office earlier today. he kind of jumped when I screamed at him, which was, in retrospect, adorable. 18:41
timotimo would you rather fight one spider the size of a wolf, or a hundred wolves the size of spiders ... 18:44
[Coke] the former. 18:50
Thankfully this guy was not quite that large. 18:51
SmokeMachine www.youtube.com/watch?v=MnKJzCUy9Tw 18:55
lucasb SmokeMachine: chega mais em #perl6br se vc quiser trocar idea 19:07
lucasb I'm trying to make my pair object have this API to convert to a Hash: github.com/lucasbuchala/p6pairs/bl...h.t#L8-L15 19:33
But I'm having difficult coding the right multi methods: github.com/lucasbuchala/p6pairs/bl...pm#L41-L52 19:34
the .Hash API tested in 05-hash.t seems doable, no? 19:35
...and looks like a reasonable API? :)
tobs lucasb: :$named! only means that $named is mandatory, not that it must be true, i.e. p.Hash(named => False) would also match that candidate. 19:51
tobs m: class Duo { has $.key; has $.value; multi method Hash (:$named where *.so, :$object where *.so) { :{key => $!key, value => $!value} } }; my \p = Duo.new(key => 1, value => 2); is-deeply p.Hash(:named, :object), :{key=>1, value=>2}, 'hash :named, :object' 19:52
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
is-deeply used at line 1
tobs m: use Test; class Duo { has $.key; has $.value; multi method Hash (:$named where *.so, :$object where *.so) { :{key => $!key, value => $!value} } }; my \p = Duo.new(key => 1, value => 2); is-deeply p.Hash(:named, :object), :{key=>1, value=>2}, 'hash :named, :object' 19:52
camelia ok 1 - hash :named, :object
tobs `:$named where *.so` requires it to be True 19:52
lucasb tobs: thanks! I'll try to understand how to put everything together :) 20:01
I didn't know I would need 'where' guards for such a simple scenario 20:02
tobs I don't know of a shorter way, at least 20:02
p6noob I know i'm missing something obvious about P6 arrays, but what is a more concise way to do this: my @p; @p.append(@a); @p.append(@b); 20:03
everything i try ends up with a .Seq or [] instead of the individual elements inside of @p
timotimo m: my @a = <a b c>; my @b = <1 2 3>; my @p; @p.append(flat(@a, @b)); say @p.perl
camelia ["a", "b", "c", IntStr.new(1, "1"), IntStr.new(2, "2"), IntStr.new(3, "3")]
timotimo m: my @a = <a b c>; my @b = <1 2 3>; my @p; @p.append(@a); @p.append(@b); say @p.perl 20:04
camelia ["a", "b", "c", IntStr.new(1, "1"), IntStr.new(2, "2"), IntStr.new(3, "3")]
timotimo looks like that works
sena_kun m: my @a = <a b c>; my @b = <1 2 3>; my @p; @p.append(|(@a, @b)); say @p.perl
camelia [["a", "b", "c"], [IntStr.new(1, "1"), IntStr.new(2, "2"), IntStr.new(3, "3")]]
sena_kun don't mind me
p6noob heh, no no, thanks for the input sena_kun. 20:05
And thank you timotimo
timotimo NP
SmokeMachine m: my @a = <a b c>; my @b = <1 2 3>; my @p; @p.append(|@a, |@b); say @p.perl
camelia ["a", "b", "c", IntStr.new(1, "1"), IntStr.new(2, "2"), IntStr.new(3, "3")]
timotimo may also want to check what happens if the arrays have some nesting in them 20:06
p6noob i was really hoping to do this.. sub x(@p) { ...} x(@a, @b)
timotimo well, arrays always have scalars around their values anyway
p6noob timotimo, yes, .flat() bit me because there were some elements inside i didn't want unpacked.
SmokeMachine m: sub x(@p) {dd @p}; @a = ^5; @b = "a" .. "e"; x [|@a. |@b] 20:08
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@a' is not declared
at <tmp>:1
------> 3sub x(@p) {dd @p}; 7⏏5@a = ^5; @b = "a" .. "e"; x [|@a. |@b]
SmokeMachine m: sub x(@p) {dd @p}; my @a = ^5; my @b = "a" .. "e"; x [|@a. |@b]
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of . to concatenate strings; in Perl 6 please use ~
at <tmp>:1
------> 3 my @a = ^5; my @b = "a" .. "e"; x [|@a.7⏏5 |@b]
SmokeMachine m: sub x(@p) {dd @p}; my @a = ^5; my @b = "a" .. "e"; x [|@a, |@b] 20:09
camelia Array element = [0, 1, 2, 3, 4, "a", "b", "c", "d", "e"]
SmokeMachine p6noob: ^^
m: sub x(@p) {dd @p}; my @a = ^5; my @b = "a" .. "e"; x [flat @a, @b] 20:10
camelia Array element = [0, 1, 2, 3, 4, "a", "b", "c", "d", "e"]
p6noob SmokeMachine, oh these are all good, thank you
SmokeMachine m: sub x(*@p) {dd @p}; my @a = ^5; my @b = "a" .. "e"; x flat @a, @b
camelia Array element = [0, 1, 2, 3, 4, "a", "b", "c", "d", "e"]
SmokeMachine m: sub x(*@p) {dd @p}; my @a = ^5; my @b = "a" .. "e"; x |@a, |@b 20:11
camelia Array element = [0, 1, 2, 3, 4, "a", "b", "c", "d", "e"]
timotimo m: sub x(*@p) {dd @p}; my @a = ^5; my @b = "a" .. "e"; x @a, @b
camelia Array element = [0, 1, 2, 3, 4, "a", "b", "c", "d", "e"]
timotimo regular slurpy also flattens like that
SmokeMachine timotimo: right! thanks!
timotimo **@a gives you the other thing 20:12
p6noob timotimo, oh that's really what i was missing there... slurpy array works nicely and makes the call sites less verbose too.
Skarsnik Hello 20:44
It's quiet 20:48
SmokeMachine hi! 20:49
timotimo sorry about that! 20:55
lizmat . 21:02
masak I'm getting an error which is just ===SORRY!=== Unknown type Some::Type -- when does that usually happen? 21:04
Skarsnik typo? 21:07
masak I've ruled that out 21:09
I've even been able to move the code and run it in a different place *in the same file*, and it works
lizmat --ll-exception ? 21:10
timotimo turn the optimizer off?
lucasb reboot the computer?
masak ah, --ll-exception is the good idea I always forget about 21:11
SmokeMachine masak: mabe moved to a place where Some::Type wasn't defined yet? 21:12
masak ok. it seems my own code is throwing the exception. *headdesk* 21:14
thank you for your unparalleled patience
lucasb "Stability and backwards compatibility stand in conflict with the need to iterate on ideas and replace newly discovered better ideas with old worse ideas" 21:24
hehe, sounds like a fun project
I want to get acquainted with 007 sometime
masak lucasb: \o/ 21:29
we're all about iterating 21:30
tonight, I'm implementing Location, which is on that list of short-term goals
SmokeMachine is there any way to write 2 different files where each one defines a type that is used on the other file? 21:38
I mean: file 1 defines type1 that is used on file 2 and file 2 defines type2 that is used by file 1 21:39
lizmat SmokeMachine: I think jnthn recently explained somewhere, maybe SO, that that is not possible
SmokeMachine lizmat: thanks! 21:40
Ill look for it
lizmat basically, because you cannot circularly "use" modules
SmokeMachine lizmat: yes, but if it was possible to stub a type (class Bla { ... }) and define it in another file, it could work... 21:46
lizmat you wouldn't be able to precompile without the stub being defined, afaik
SmokeMachine that wouldnt be a bigger problem than have to write every single Red model into the same file... 21:47
i think
my problem is: the way Red relationships work, I need to use almost every model inside of almost every model... 21:49
lizmat SmokeMachine: the approach we take in the setting is that files are merged into a single file, and *then* compiled
that might work for RED as well, maybe?
tools/build/gen-cat.nqp is what it does for the setting
you can give it a file with filenames with -f 21:50
afk&
SmokeMachine I am almost trying trying to write a "Schema" model that will receive a list of models (like: use Schema <Model1 Model2 Model3>) and do something like concat every model file, add a stub of each model at de begining of the concated string, eval it and return each model... 21:51
thanks lizmat! 21:52
SmokeMachine lizmat: I am thinking of writing something like this to solve my problem: gist.github.com/FCO/8badb8ffc1ff86...7963f37fd2 22:38
lizmat: do you know if it would precompile? 22:39
it created a .precomp on my dir... but Im not sure if its right...
SmokeMachine .tell lizmat I am thinking on doing something like this, what do you think? gist.github.com/FCO/8badb8ffc1ff86...7963f37fd2 23:02
yoleaux SmokeMachine: I'll pass your message to lizmat.
SmokeMachine .tell lizmat but Im not sure how META6.json would handle that... should Bla, Ble and Bli (on that example) be resources? 23:04
yoleaux SmokeMachine: I'll pass your message to lizmat.
Skarsnik lizmat, not having circular dependancy is really annoying with working with huge library to bind with NC ^^ 23:20
jnthn A typical solution is to extract a role, have the roles in some file that everything includes, and then just talk about the roles rather than the concrete types. I think it's also possible to write a bunch of classes with just their attributes in one file, and then provide all the methods in others by `augment`. 23:27
Skarsnik will not work with NC
jnthn What will not work?
Skarsnik since you need the type fully defined x) 23:28
hm, you could always separate struct definition and function I guess 23:29
jnthn Like in C ;) 23:30
Skarsnik ?
anyways, it could be nice that this work one day ^^ 23:31
SmokeMachine jnthn: something like this would work? gist.github.com/FCO/8badb8ffc1ff86...7963f37fd2 23:32
jnthn SmokeMachine: ufff...maybe :) 23:34
jnthn SmokeMachine: It might even do something sensible with the precomp, but I don't know. I think nine++ did some work some time ago to deal with BEGIN-time EVAL 23:35
Just know that EXPORT runs once per `use` 23:36
So if two different modules do this then you'll be in bother
There's probably a better way to do this with a custom CompUnit::Repo that lets you name a directory and it concatenates all the things in it and precomps them as one or some such. 23:37
SmokeMachine jnthn: that’s a good idea... 23:38
jnthn I think that'd interact more properly with multiple `use` statements and precomp 23:39