»ö« 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 Zoffix on 25 May 2018.
Railalis in method TWEAK I am calling another method $!reset(); 00:00
and it essentially resets the array with default values for the game.
I'm making backgammon
TimToady maybe a new game should get a new object... 00:01
Railalis Sure, but then I still have to run this logic in TWEAK 00:02
TimToady or declare your array with 'is default("a")' or some such
Railalis Eh.. That's not really my style. 00:03
MasterDuke m: my @a[4] is default("b")
camelia 5===SORRY!5=== Error while compiling <tmp>
is default on shaped Array not yet implemented. Sorry.
at <tmp>:1
------> 3my @a[4] is default("b")7⏏5<EOL>
expecting any of:
constraint
TimToady aww
Railalis ok I got things working for now.. 00:05
Railalis now I have to figure out how to print this board. 00:05
Zoffix mr_ron: did you delete your module or something? For some reason my local build didn't get it 00:43
Oh wait, just realized you wouldn't be able to delete it this fast, 'cause PAUSE has a 3-day delay... nm
:S got it now... Seems rsync doesn't rsync all the files or something :S 00:48
timotimo run it in an infinite loop, call it "eventual consistency" 00:57
Geth modules.perl6.org: b3e67564c1 | (Zoffix Znet)++ | lib/ModulesPerl6/DbBuilder/Dist/Source/CPAN.pm
[REBUILD] Use original repo_url for dist url for CPAN dists

It was accidentally lost when we split dist and repo urls[^1], which resulted in site links being "N/A"
  [1] github.com/perl6/modules.perl6.org...54edc56d60
01:14
Zoffix .tell mr_ron I fixed all the modules.perl6.org issues with your dist that I saw. Repo URL is already fixed and CPAN tarball URL will get fixed on next update (~2hr) 01:15
yoleaux Zoffix: I'll pass your message to mr_ron.
ingy e: sub foo($a) {}; foo() 01:41
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/LuTUnBbcr4
Calling foo() will never work with declared signature ($a)
at /tmp/LuTUnBbcr4:1
------> 03sub foo($a) {}; 08⏏04foo()
ingy e: sub foo($a=Nil) {}; foo()
evalable6
b2gills m: sub foo($a=Nil) {}; say foo()
ingy lizmat, b2gills: ^^ is what I was going for
camelia Nil
ingy $a=Nil makes arg optional 01:42
b2gills m: sub foo($a is copy =Nil) {$a = Nil; $a}; say foo()
camelia (Any)
b2gills That is what I thought would happen as the default is Any 01:43
m: sub foo( $a? ) {}; say foo() # optional 01:44
camelia Nil
b2gills m: sub foo( $a? ) {$a}; say foo() # optional
camelia (Any)
ingy ok 01:45
ingy looks forward to the day when all his perl6 (and every other language) code is generated :) 01:46
then I'll let b2gills code review the generator and all my perl6 will be best practice
I spent the last year writing compilers to generate Lua. Lua is the best code to generate that I've seen. 01:48
very regular and no ambiguities
pretty hard to mess up...
but Lingy will be even easier I think 01:49
since the encoding is just json
geekosaur smells famous last words in there somewhere 01:50
ingy testml.org/playground/?type=example...w=compiler shows the Lingy generated for TestML (TestML compiles to Lingy) 01:51
geekosaur: it's interactive with scores of examples. try it out
ingy Lingy = Lisp + JSON. What could possibly go wrong?! 01:52
ingy I have have a small module called RotN (pronounced RotN) that I wrote in all the TestML langs for my talks last week and next week 01:53
after $yapc I'm going to single source it as CafeScript that generates Lingy, and then I'll upload it to CPAN 6PAN PyPI and NPM 01:54
with tests in TestML of course 01:55
ingy CafeScript is a fork of CoffeeScript that generates Lingy instead of JS 01:55
Lingy targets every language that can do JSON. That should give me a good amount of languages to target. 01:56
at first the modules will dep on a lingy eval loop module 01:57
but as things catch on I'll do Lingy to native code generators
and if I can gen C code from Lingy then...
ingy how do I compare 2 boolean values? 02:09
rjbs My naive quesiton is, "Isn't it with == ?" 02:11
ingy e: False -- False
evalable6 WARNINGS for /tmp/hxpRPLdX7E:
Useless use of "-" in expression "False -- " in sink context (line 1)
ingy e: False == False
evalable6 WARNINGS for /tmp/Euh_Mgqrrw:
Useless use of "==" in expression "False == False" in sink context (line 1)
ingy == is numeric compare 02:12
I wish == were more polymorphic
ingy Ironically I'm need to know to implement my polymorphic == in TestML in p6 02:12
I guess I'll craft some crafty boolean logical expression 02:14
I think: $a ?? $a && $b !! not($a || $b) 02:17
seems crafty
open to suggestions
Xliff \o 02:19
I hope tonight finds everyone well.
ingy define well :) 02:21
Xliff Will this work for a statically defined struct in C: "my class A is repr('CStruct') { ... }; my $a := cglobal('gtk+', 'GtkWidgetClass', A)" 02:22
ingy: Definition: "Well enough, i hope?"
benjikun `Aborting due to build falure: digest::sha1::native:ver<0.03> (use —force-build to overide)` 02:23
For some reason, when my bud tries to install digest::sha1::native 02:24
Xliff Please note that the "..." above matches the native call definitions necessary to be compatible with 'GtkWidgetClass' and not a stub.
benjikun he's on 2018.05-86 for rakudo
zef 0.4.4 02:25
ingy welp, all my boolean test passing now. My logic for a true TestML value in p6 is currently: $value.defined and $value.^name ne 'Bool' || $value 02:35
basically None and Null and False are false 02:36
ingy close to Ruby semantics 02:36
I think those semantics are best, when you have to explain truth to people from every language... 02:38
Xliff ingy: Just out of curiosity, why not $value !~~ Bool? 02:41
m: (1 ~~ Bool).say 02:42
camelia False
Xliff m: (True ~~ Bool).say
camelia True
rjbs ingy: My next quesiton would've been "why not xor"?
e: True xor True
evalable6 WARNINGS for /tmp/rD60KtTJie:
Useless use of constant integer True in sink context (line 1)
rjbs e: (True xor True) ?? "FALSE" :: "TRUE" 02:43
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/csSieGNtDk
Please …
rjbs, Full output: gist.github.com/48889e89c6638a73ff...27090be791
Xliff e: (True xor True).say
evalable6 Nil
rjbs Okay, I'm gonna not try to eval anything more.
Xliff m: (True xor True).say
camelia Nil
Xliff m: (True xor False).say
camelia True
rjbs m: (True !xor True).say
camelia True
Xliff Hmmm... 02:43
rabbit_ Hello
rjbs So, that's my Official Probably Bullshit Ricardo Answer. ;-)
Xliff \o rabbit_ 02:44
rabbit_ Wow, a lot of people here ;)
Could someone help me with an issue regarding installing cro with zef? I have yet to find an answer. 02:45
rabbit_ ===> Building [FAIL]: Digest::SHA1::Native:ver<0.03> 02:48
Aborting due to build failure: Digest::SHA1::Native:ver<0.03> (use --force-build to override)
anyone have any similar problems? 02:49
MasterDuke rabbit_: i think i've seen mention of something similar before (don't remember details though) 02:51
what os and perl6 version do you have?
rabbit_ This is Rakudo version 2018.03 built on MoarVM version 2018.03 02:52
implementing Perl 6.c.
ubuntu 18.04
4.15.0-23-generic
MasterDuke you might need some -dev package installed 02:53
rabbit_ hmm, any clues which package that would be? I am going to try to install some older openssl dev packages 02:56
MasterDuke rabbit_: also, you might try the --verbose option to zef and see if that says anything helpful 02:57
rabbit_ benji is that you? 02:58
MasterDuke me? if so, nope 02:59
rabbit_ Sorry. I thought it was someone else who I asked earlier. 03:00
Alright so I tried install libssl1.0-dev tcl-tls openssl1.0
and after installing those packages cro install zef got a lot further
and then I got:
===> Testing [FAIL]: Cro::HTTP:ver<0.7.5>
Aborting due to test failure: Cro::HTTP:ver<0.7.5> (use --force-test to override)
trying install libhttp-async-perl 03:02
fingers crossed this time
lookatme rabbit_, maybe add --/test 03:05
MasterDuke rabbit_: i think most of the cro devs are offline at this time, but you could also try in #cro
lookatme they recommend you using `zef install --/test cro` install cro 03:06
lookatme maybe some test not ready currently 03:06
rabbit_ pastebin.com/gnzv3WaE 03:17
rabbit_ Thanks for the help/suggestions MasterDuke. It's getting pretty late here. I'm going to hit the sack. 03:23
wbn is there an easy way to see if a module was loaded (e.g. Test) in the current context? 04:42
digitalw00t Evening!! 04:56
ingy re the Boolean comparison conundrum I posted earlier... 05:24
not xor is the best thing I've found 05:25
e: for [True, False] -> $a { for [True, False] -> $b { say not($a ^^ $b) } }
evalable6 True
False
False
True
ingy my previous entry was 05:26
e: for [True, False] -> $a { for [True, False] -> $b { say $a ?? ($a && $b) !! not($a || $b) } } 05:27
evalable6 True
False
False
True
ingy still keen to see a more idiomatic solution
to restate, looking for boolean equality. ie $a == $b for Bool 05:28
rjbs: ^^ since you were vaguely interested 05:29
tobs e: for [X] [True, False] xx 2 -> ($a, $b) { say $a == $b } 05:33
evalable6 True
False
False
True
tobs ingy: I didn't follow early, but == seems to work?
s/early/ealier/ 05:34
tobs and it really should +True and +False are 1 and 0. 05:35
s/should/should because/
what's with my typing today? 05:36
ingy e: say True == True
evalable6 True
ingy e: say False == False
evalable6 True
ingy e: say False == True 05:37
evalable6 False
ingy tobs: I tried this earlier and failed
meh
what a waste of time
tobs: thanks! 05:38
tobs: you're 1-liner is pretty dope too... wish I understood it 05:40
ingy mostly don't get [X] 05:41
tobs ingy: it takes the cartesian product of the lists passed to it (which is [True,False],[True,False])
ingy ah, nice 05:42
tobs never use nested loops in P6 :)
ingy I suspect when all my perl6 code is generated from transpilers, there will be nested loops :) 05:43
and I can sleep at night, if that's the case
but until then, sure, ok
ingy googles for JSON in FORTH 05:44
ingy the 2nd hit involved Parrot! hahahaha github.com/parrot/forth/blob/maste...forth.json 05:46
I thought the Parrot was dead... 05:47
tobs ingy: I'm new to P6 myself. just really like the many ways to prepare simple data structures like that 05:48
ingy tobs: I just finished adding perl6 to my new test language that works in all (5 so far languages) 05:51
tobs: the code is here: github.com/testml-lang/testml/tree/master/lib
feedback on the p6 welcome
tobs: to see it in action (with the js port in the browser) I made this: testml.org/playground/ 05:52
tobs I remember catching bits about it in here. This is related to acme-ism, right? 05:53
ingy the language compiles to JSON/Lisp (click Compiler) and then runs the tests as TAP (perl test output) or Mocha
right. the language has been around in various forms in Perl since 2004 or so 05:54
but now I've figured out how to get it to every language that can do JSON
which seems like all the important ones 05:55
tobs: anyway the perl6 is hot off the press: github.com/testml-lang/testml/tree...rl6/TestML
I thought Python was a pita, but p6 twice as much 05:56
but now its all done so I can enjoy the beer I'm drinking right now
tobs nice, I'll look at it. We tried working on testing for Gambas (a BASIC language) but progress is slow. Maybe I can steal some bits here (and later unsteal them?) 05:57
ingy if you care to glance over the p6, thoughts would be most appreciated
tobs Gambas at least has a JSON module
ingy great, let's port it!
tobs but right now I have to get off to $uni o/ 05:58
ingy 859 total lines p6 05:59
catch you later
tobs: msg me the best url for Gambas 06:00
masak ingy: nice! 07:09
ingy: the code looks very neat, but to me what stands out is the complete lack of type annotations. any reason for that? (besides maybe being close to other implementations) 07:10
ingy: also curious why p6 was twice the PITA of Python (though I have my guesses)
sarna hey, is there a tool that'd create a project template for me? like `cargo new` in Rust 07:18
sacomo sarna, take a look at github.com/gfldex/perl6-meta6-bin 07:30
sarna sacomo: nice, thanks! 07:32
lizmat sarna: personally, I use modules.perl6.org/dist/App::Mi6:cpan:SKAJI a lot 07:39
also, there's the Perl 6 IDE of the future: commaide.com
sarna lizmat: sweet! 07:50
120 euro though, oof
also, what's up with this naming? eg App::Mi6
masak .oO( we could tell you, but then we'd have to kill you ) 07:55
:P 07:56
ingy hi masak 07:57
masak \o
my favorite ingy singleton :>
sarna shivers 07:59
moritz an ingyton :)
ingy I came up with a new tagline for p6: "Perl 6 makes simple things simple, hard things possible, and everything in between a royal pain in the ass." :D 08:00
ingy masak: do you mean type annotations for class properties? 08:00
TimToady if you want polymorphic comparison, why aren't you using eqv or ===? 08:01
ingy TimToady: who was that for? 08:02
TimToady you, sirrah!
ingy the bool thing?
TimToady yep, eqv and === are intented to be polymorphic 08:03
*d
== isn't
masak ingy: :P
ingy: I meant
m: my Int $i = 42
camelia ( no output )
ingy I guess the answer is: because you didn't speak up earlier :)
masak no need to blame TimToady for your code :P 08:04
ingy well I asked earlier
masak oh!
TimToady I think the things that are "a royal pain in the ass" are really just things you don't know yet about Perl 6 :P
ingy is all
I hit some hard corners
but sure 08:05
masak stab in the dark: lists were involved somehow
TimToady I'm a bit surprised nobody suggested eqv or ===, is all
ingy I don't think anyone was on chan at the time 08:05
ingy except rjbs 08:05
TimToady that's not to say there aren't some hard corners here or there, of course
you need to learn to sleep when the eurofolk are sleeping, is all :) 08:06
masak .oO( hard cor[e|ner] programming )
ingy might take a while 08:06
anyway I'm 100% passing with the p6 port
so I can heal now
TimToady obviously you need more tests ;) 08:07
masak time to write more tests! :P
d'oh, TimToady is faster :P
ingy that's easy, it's a language for writing tests
TimToady we still have only 76,373 tests, alaas
masak .oO( so far, the tests cover the first 100% )
ingy my point was the p6 == p5 == coffee == python == node
I had about a weeks worth of stuff to catch up on 08:08
Python took me an 18 hour day
p6 twice that
TimToady yes, but next time it'll only take you half as long 08:10
ingy is looking forward to the Gambas port with tobs++ 08:11
meet new people from far off languages!
TimToady starts driving toward SLC tomorrow...well, today...so better sleep while the eurofolk are awake 08:12
ingy probably the p6 array magics were the most troublesome 08:13
ingy is about halfway into a 3 week Utah stay
daoswald++ for the spare room
ingy openwest conf was last week here 08:14
ingy masak: take a look at the playground to see what testml compiles into: testml.org/playground/?type=example...w=compiler 08:15
I call it Lingy, it's my favorite part 08:16
ok g'night my perl fiends o/
Luneburg Is there a simple way to turn a string into an array? 08:16
ingy tries to make new fiends...
El_Che Luneburg: split? 08:17
ingy www.makingfiends.com/
[$str]
Luneburg El_Che: Looks a lot better than what I was trying to do (make a loop that loops through $string.comb, then concatenate to new strings, which are added as elements in an array) 08:19
El_Che Luneburg: there are several methods that work on strings depending on what you need 08:20
Luneburg El_Che: .split seems to work fine, but it returns a .Seq instead of an array? 08:24
ingy: *hugs* 08:25
masak <ingy> probably the p6 array magics were the most troublesome 08:31
called it :)
m: my @things = "1, 2, 3, 4".split(", "); say @things.^name 08:32
camelia Array
lizmat m: my @a = "foobar".comb # turning a string into an array
camelia ( no output )
masak Luneburg: if you do it like that, it's an array
lookatme m: say "123".comb 08:35
camelia (1 2 3) 08:35
Luneburg m: my @things = "1, 2, 3, 4".split(", "); say @things.^name; say @things.elems;
camelia Array
4
Luneburg masak: Ah, that works :D
lookatme m: dd "123".comb
camelia ("1", "2", "3").Seq
jmerelo o/ 08:50
masak \o
Geth doc/master: 7 commits pushed by (JJ Merelo)++
jmerelo Just managed to connect from the train... 08:51
And arriving to station, so AFK now. See you!
sarna what's in .pm6 files? or is it just like .pl6 09:22
lizmat sarna: what's the difference between .pl and .pm in Perl 5 ? 09:27
sarna lizmat: I don't know perl5 :( 09:29
lizmat ah, ok
well, the extensions an indication that they contain Perl 6 source code
sarna I googled it though
lizmat .pl6 is generally used to indicate runnable scripts
.pm6 is generally used to indicate installable modues 09:30
*modules
sarna I've ran that Mi6 tool and ended up with a .pm6 file
idk if I'm supposed to create a .pl6 one or put my stuff into that .pm6
lizmat yup, it does that :-)
masak tends to use the empty string at the end of his runnable scripts :)
lizmat masak: that works fine if you're not on Windows :-)
masak oh yeah, I've heard about that OS 09:31
lizmat sarna: mi6 assumes you want to create an installable module
so generally, that happens in the lib/Foo.pm6 file, if you did "mi6 new Foo"
sarna I did App::Foo because I learned a thing :^) 09:32
lizmat then you got an lib/App/Foo.pm6 :-)
sarna thanks for taking your time lizmat 09:34
lizmat sarna: yw 09:35
sarna_ hmm, how to invoke a subroutine in my test file? I've tried func(), App::foo::func() and foo::func(). neither of them work 10:13
robertle do you "use" your module? 10:14
yoleaux 13 Jun 2018 00:14Z <MasterDuke> robertle: is your program (the one with all the regexes) available somewhere online?
sarna_ I have `use App::foo;` at the top of my file
robertle and do you export from App::foo? e.g. "sub func() is export"? 10:15
but there are many ways to export: docs.perl6.org/language/modules
sarna_ do I have to export them to test them? heck :( 10:16
robertle MasterDuke: unfortunately it's a work thing, but I could craft a similar case if it helps...
sarna_: there most certainly is a way to import something that has not been explicitely exported, e.g. for tests, but I have to admit that I don't know what it is. I guess a good start would be to see what ' 10:19
import' actually does...
jnthn Generally, the choice is either to export them or declare them `our` scope so they can be looked up fully qualified 10:20
(subs default to `my` scope) 10:21
sarna_ thanks robertle, I figured it out :) 10:25
why can't I write `returns Str, is export`? 10:26
robertle actually jnthn's point is far more interesting: that there is lexical scope in perl6 as well as namespace scope. that is a very powerful combination
jnthn sarna_: Because it's incorrect syntax. :) Get rid of the , 10:27
sarna_ jnthn: oh! thank you :) 10:27
robertle is there some consensus on what the "preferred" return type declaration is? there just seem to be too many... 10:28
sarna_ I only know about --> and returns
robertle I have used --> so far, but it looks kinda weird 10:29
sarna_ I prefer returns :) looks better
jnthn I think those are the two ways in common use
sarna_ hm, what if I wanted to test a private sub? just declare it our?
jnthn Well, then it's not private, but yes :) 10:30
sarna_ I can't test private functions then? :D
jnthn Nope. Because if your test is calling it then it's not private.
sarna_ oh well
jnthn The point of privacy (lexical scoping, private methods) in Perl 6 is that you can refactor them without having to look anywhere else in the program source code 10:31
robertle it's kinda funny that of all languages, perl6 is the strictest abotu privateness ;)
sarna_ "I declare everything to be public, who am I not to trust my own code?" - my coworker
jnthn robertle: I'm really glad of it though. Both as a Perl 6 programmer (I feel safer refactoring) and as an IDE developer (a bunch of useful bits of analysis are easier) :) 10:33
robertle sure, and it makes more sense seen from the "lexical" point of view than from "private": in a language like java, a private class will still have a global name and can be addressed. you are just not allowed to do certain things. 10:34
sarna_ jnthn: which IDE you're developing? commaide?
jnthn sarna_: Yes
sarna_ if you don't mind me asking
sweet!
robertle a lexical scoped thing simply isn't addressable from outside that lexical scope. taht is very nice 10:35
jnthn Well, it's not just me, but I'm to blame for parts of it :)
sarna_ does perl prefer to die early or return an empty collection or something? 10:42
tyil what's the best way to sent an EOF to the standard input of a Proc? 10:53
ilmari tyil: $proc.in.close()? 10:54
tyil some things are so simple that I just forget to think about them 10:55
thanks ilmari
Geth ¦ user-experience: rafaelschipiura assigned to robertlemmen Issue Distros don't offer Star. github.com/perl6/user-experience/issues/23 11:24
Geth ¦ user-experience: rafaelschipiura assigned to niner Issue Distros don't offer Star. github.com/perl6/user-experience/issues/23 11:24
jkramer How can I compile a regex from a string? Something like Regex.new('foo.*') doesn't seem to exist 11:59
El_Che rx 12:01
jkramer Nevermind, found this docs.perl6.org/syntax/%20Regex%20Interpolation 12:02
El_Che docs.perl6.org/language/regexes#in...onventions 12:03
Geth doc: 795b3d96db | (Will "Coke" Coleda)++ | xt/word-variants.t
whitespace [no tabs]
12:13
masak m: my $rx-string = "fo+"; say so "fooooo" ~~ / <$rx-string> / 13:23
camelia True
masak standard injection disclaimer applies 13:24
moritz injects a standard into Perl 6 13:42
raschipi RFC 2549? 13:46
timotimo that's a good one 13:48
moritz I thought about ISO 8601 13:52
hahainternet i think proper email address validation would be something worthy of a blog post, and worthy of inclusion, because i now have a list of 3 companies that will completely screw up your order / take your money and not send you stuff if you have a '+' in your address :'( 13:59
robertle I have seen *@domain.com which is technically legal, but wonder how many systems barf on it... 14:01
hahainternet indeed, plus with the variety of new TLDs, the correct behaviour is to attempt a delivery and watch MX logs for the actual attempt
other than checking for @ and at least one \w.\w is about all you can do i think now 14:02
but that's why it'd make an interesting blog post :)
missed \ in that there regex too
moritz hahainternet is a valid email address 14:18
though if you want to accept it as input depends on context 14:19
buggable New CPAN upload: FINALIZER-0.0.4.tar.gz by ELIZABETH modules.perl6.org/dist/FINALIZER:cpan:ELIZABETH 14:35
[Coke] IMO it's like checking file permissions. just try to do the thing (send the email) and then complain if it didn't work (get a response) 15:19
hoelzro sarna, El_Che: sorry about the Linenoise bug - I haven't been able to reproduce it myself, so fixing it is tricky 15:23
pmurias hi 15:31
b2gills ingy: I think `method sum(+@list) {sum(|@list)}` is more efficiently written as `method sum(+list){ list.sum }` 15:32
pmurias ingy: what's the state of funlang? we haven't heard of it in a while? 15:33
ingy pmurias: fanlang? I don't work for openresty anymore. 15:36
but they didn't really work on it at all last year after May. it was pretty much stable for their needs. 15:37
b2gills: thx!
b2gills: how can you have a var w/o a sigil? 15:38
e: sub sum(+list){ list.sum }; say sum(1,2,3) 15:39
evalable6 6
ingy has a lot to learn here
lizmat m: my \a = my $; a = 42; say a; a = 666; say a # bit degenerate case, but there you go 15:40
camelia 42
666
lizmat what in fact you're doing there is create an alias to an anonymous container
ingy is a degenerate 15:41
pmurias ingy: thanks :), it was potentially superinteresting the last time I heard of it
lizmat I've seen you cycling, before and after, I know :-)
ingy :* 15:42
lizmat: is there a place I can read more about what you are showing? 15:43
lizmat docs.perl6.org/language/containers...binding%29
ingy masak: ping
lizmat: xo 15:44
buggable New CPAN upload: Perl6-US-ASCII-0.6.5.tar.gz by RONALDWS cpan.metacpan.org/authors/id/R/RO/...6.5.tar.gz 15:45
perlpilot is still surprised ingy's sub sum(+list) worked.
yoleaux 11 Apr 2018 13:44Z <[Coke]> perlpilot: - any thoughts on a File::Temp option that doesn't bother opening a file handle?
lizmat perlpilot: that's the single argument signature, that works like \, but with different semantics? 15:46
raschipi I think they expected +@, just like *@
perlpilot right.
re-reading about it now
raschipi m: sub sum(*list){ list.sum }; say sum(1,2,3) 15:47
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3sub sum(*7⏏5list){ list.sum }; say sum(1,2,3)
raschipi m: sub sum(+list){ list.sum }; say sum(1,2,3)
camelia 6
raschipi m: sub sum(*@list){ list.sum }; say sum(1,2,3)
camelia 0
raschipi m: sub sum(*@list){ @list.sum }; say sum(1,2,3)
camelia 6
ingy perlpilot: that was b2gills' I just ran it because I was surprised too! 15:48
b2gills ingy: sigilless variables are SSA (Static Single Assignment). I like to think of them as sort of like a runtime constant. 15:49
ingy really doesn't have time to unblown his mind with all this :) 15:50
b2gills Usually they are defined with \ but as I often do I tried to bend the parser to see where it breaks. Very rarely does it actually break.
ingy :) 15:51
geekosaur not sure I call that break. think of \ as a hack for when it needs a sigil, but there + has the same effect as a sigil
but * is more ambiguous
b2gills I mean the following works
m: my $a = 42; if $a -> $b { say $b }
camelia 42
ingy masak: I'd like to talk more about type annotations now that I'm awake 15:52
b2gills ingy: What are you trying to do with `method bool` as I think that would be a good starting point for learning about type annotations. 15:54
ingy pmurias: the thing I'm working on now, TestML, is taking all the work I did for OpenResty to make fanlang and perl5 versions of the language, and open source them to all open langauges.
b2gills The main use of type annotations is for multi methods/subs
ingy pmurias: I redesigned the language completely at openresty and its pretty awesome 15:55
and I've made it even better in this rewrite
lizmat rewrite++ # hehe 15:56
ingy they use the old TestML (CPAN Test::Base) almost exclusively to test over 100 repos
pmurias: including fanlang. 100% tested with the Test::Base 15:57
b2gills multi method bool ( Bool:D $value ) { $value }; multi method bool ( Any:U --> False ){}; multi method bool ( Any:D --> True ){}
ingy b2gills: ah perfect 15:58
b2gills Also `$value.^name ne 'Bool'` may be better written as `$value !~~ Bool`, unless you want to dismiss all possible classes with the name Bool
ingy copies b2gills' code in to see if it can work
b2gills m: sub new-bool (){ anon class Bool {} }; say new-bool().^name eq 'Bool'; say new-bool() ~~ Bool; 15:59
camelia True
False
raschipi ingy, gimme a link to the repo 16:01
ingy raschipi: TestML? 16:01
raschipi yep 16:01
b2gills You may want to put in a `proto method` if you are overriding a method from a parent class to prevent it from dispatching to said parent class. 16:02
ingy github.com/testml-lang/testml/tree/master/lib
b2gills: the cat method is also multi
*@args or @args 16:03
I'll try to figure that one out myself
b2gills If you are only going to use one then I recommend to use +@
ingy right 16:04
buggable New CPAN upload: FINALIZER-0.0.5.tar.gz by ELIZABETH modules.perl6.org/dist/FINALIZER:cpan:ELIZABETH 16:05
raschipi has TestML::TAP $.tap = TestML::TAP.new; can be written as has TestML::TAP $.tap .= new;
b2gills :( @ ) takes one positional :( *@ ) flattens everything it can :( **@ ) flattens the first level, and :( +@ ) does the best of both :( @ ) and :( **@ )
If you ask me, :( *@ ) should be the signature of last resort. 16:07
ingy ok great. makes more sense 16:08
b2gills I tend to bend the language more than most, because I am heavily active on codegolf.stackexchange.com/users/1...ab=answers 16:09
sarna hoelzro: no worries :) 16:10
ingy golfed the rosettacode fizzbuzz to be the shortest fizzbuzz on rosetta
El_Che ingy: does the golfed line include a compiler?
ingy :P
Geth doc: 35a3804b62 | (Elizabeth Mattijsen)++ | doc/Language/5to6-nutshell.pod6
Add se section about P5built-ins
16:11
synopsebot_ Link: doc.perl6.org/language/5to6-nutshell
Geth ¦ user-experience: rafaelschipiura assigned to MattOates Issue Distros don't offer Star. github.com/perl6/user-experience/issues/23
hoelzro sarna, El_Che: I just installed Linenoise on a 18.04 box freshly made on Digital Ocean (rakudo 2018.04.1, with latest zef) - I still can't reproduce the issue =( 16:23
any guidance on how to reproduce it would be very much appreciated!
El_Che hoelzro: yes, I should be able to reproduce in something packaged like docker 16:24
hoelzro I'll try the docker image - docker's acting up on my machine, though =( 16:25
El_Che LeoNerd: it looks like a window from the sawfish era 16:26
(it took me a while to find the name)
oops
laggy terminal on train
sarna hoelzro: I'm on openSUSE tumbleweed with the same packages :( idk what's going on
hoelzro so far this issue has been reported on OpenBSD, Ubuntu 18.04, and Windows 10 16:27
sarna (the same versions I mean)
hoelzro I'm at a loss as to what's going on - unfortunately I haven't been keeping up with perl 6 much lately =/
ingy b2gills, raschipi: github.com/testml-lang/testml/comm...8cbd3ccdbc 16:36
thanks
raschipi I can't clone the repo and test it right now, will do more later. 16:37
El_Che ingy: what's the usecase of Lingy besides "it's cool"? 16:38
do you target a specific niche?
ingy raschipi: `make test` will test 5 langs (including coffee) `make test-perl6-tap` will do just perl6. but be warned, this currently deps on `npm install -g testml-compiler` 16:39
ingy El_Che: you aren't going to $yapc next week are you? 16:39
raschipi I won't install node if that's what you're suggesting.
ingy you'll have to wait for the binary compiler then 16:40
El_Che ingy: no, decided not attend anything this year to finish other stuff
no conferences for me
ingy distributed test in cpan and 6pan don't need the compiler
but testing the repo does
El_Che maybe your talk will be filmed 16:41
ingy El_Che: I've used this style testing for almost all my software tests over last 15+ years (various versions of TestML) 16:42
the new YAML Test Suite for all YAML implementations is in TestML
El_Che ingy: By the way, I am fighting the fight at work against the toml heretics. Love yaml :) 16:44
ingy entire companies (Socialtext, OpenResty) used this for almost all tests
Miyagawa (one of the top perl hackers of all time) used this extensively 16:45
as did many others
it's all about writing tests suites that are almost all data 16:46
testml tests usually only have 1 line of code. something like this: `*input.do-something-testy == *output` that can run over tons of in/out sets 16:47
El_Che interesting 16:48
ingy and the new testml works will work in almost every language that can handle json
json seems to be the commo ground. the testml type system is a superset of json's 16:49
El_Che: so to me, TestML is the cornerstone of Acmeism (and also the best way of writing tests I've found in just single language endeavors) 16:51
El_Che ingy: the cert for testml.org/ is broken (in case it's yours) 16:52
ingy Does anyone remember my friend Ryan King who escaped from the Texas insane asylum during the Austin YAPC and showed up at the hackathon? 16:53
ingy looks at TimToady
ingy Before he went bonkers, we were working together at Socialtext and invented Test::Base together (TestML 0.0.1) 16:54
ingy I think I'll dedicate the testml book to him 16:55
lizmat ingy: is he the one who recommended I should use tmux ?
ingy wearing a white sheet and sandles? yes 16:56
lizmat ah, yes, Jesus telling me to use tmux, I tell the story often :-)
ingy do you now use tmux?
lizmat no
mcmillhj heretic
lizmat hehe
ingy oh well 16:57
El_Che poor guy
yaml drove him crazy
mcmillhj I would rather people try to demonstrate why I should use something, than just telling me to
ingy he probably did
lizmat afk&
ingy he was an amazing programmer and mind. almost all my programming ideas stem to him. 16:58
I miss him 16:59
El_Che: I'll fix that cert now 17:00
jkramer Nevermind, found this docs.perl6.org/syntax/%20Regex%20Interpolation 17:04
Ups
ingy El_Che: hopefully fixed 17:05
wait for DNS changes... 17:06
El_Che: and thanks
raschipi ingy: I hope he recovers. 17:09
jkramer m: say (1,1,1)..(2,2,2) 17:15
camelia 3..3
jkramer What is happening here? ^
jnthn m: say (1,1,1).Numeric
camelia 3
jkramer Aaaah ok thanks :)
geekosaur m: say (1,1,1)...(2,2,2) 17:16
camelia (2 2)
b2gills m: say {++$,++$,++$}...*eqv(3,3,3) 17:21
camelia ((1 1 1) (2 2 2) (3 3 3))
b2gills m: say ++$ xx 3 Xxx 3
camelia ((1 1 1) (2 2 2) (3 3 3))
sena_kun ecosystem-api.p6c.org/projects.json has modules from github(apparently), is there an equivalent that consists of modules from cpan too(additionally to github ones)? 17:30
ingy raschipi: thanks 17:31
El_Che: github says I need to wait 24 hours to enforce https. They need to issue a cert I think. 17:32
but the https works now
buggable New CPAN upload: Sparrowdo-VSTS-YAML-Solution-0.0.1.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/...0.1.tar.gz 17:35
New CPAN upload: Sparrowdo-VSTS-YAML-Build-Assembly-Patch-0.0.1.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/...0.1.tar.gz
New CPAN upload: Sparrowdo-VSTS-YAML-Artifact-0.0.1.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/...0.1.tar.gz
timotimo sena_kun: raw.githubusercontent.com/ugexe/Pe.../cpan.json seems to be what's used by zef for cpan stuff 17:38
sena_kun timotimo, thanks a lot.
buggable New CPAN upload: Sparrowdo-VSTS-YAML-Nuget-0.0.1.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/...0.1.tar.gz 17:45
buggable New CPAN upload: P5fileno-0.0.3.tar.gz by ELIZABETH modules.perl6.org/dist/P5fileno:cpan:ELIZABETH 18:05
buggable New CPAN upload: US-ASCII-0.6.6.tar.gz by RONALDWS cpan.metacpan.org/authors/id/R/RO/...6.6.tar.gz 19:05
buggable New CPAN upload: Inline-Perl5-0.35.tar.gz by NINE modules.perl6.org/dist/Inline::Perl5:cpan:NINE 19:15
buggable New CPAN upload: Sparrowdo-VSTS-YAML-Build-Assembly-Patch-0.0.2.tar.gz by MELEZHIK modules.perl6.org/dist/Sparrowdo::V...n:MELEZHIK 19:35
Railalis Question, is there ever a reason to return Nil to prevent sideeffects? 20:13
timotimo you don't always want to leak the value of your last statement to the caller 20:17
ingy `return;` returns Nil, yes? 20:18
Railalis yes 20:19
m: sub foo() returns Nil { return; }
camelia ( no output )
Railalis m: sub foo() returns Nil { return; }; foo();
camelia ( no output )
jnthn The main reason to use `--> Nil` is to make sure any side-effects of the final statement happen within the bounds of the current sub 20:20
Railalis Are there any arguments as to the best way to declare return type? 20:25
timotimo the --> form allows more different things for syntax reasons 20:27
Railalis do you do that with a trailing comma? 20:28
m: sub foo(Int $bar, --> Nil) { return; } 20:29
camelia ( no output )
Railalis that's kind of weird
jnthn I've never written in that way :) 20:31
*it
Also, writing --> Nil and return; at the end is redundant
jnthn Since the idea of the --> Nil is to say the returned value should be Nil 20:32
pmurias is there a strong preference against using the parcel bundler for rakudo.js?
(or even any even weak opinions why that will be a bad idea) ;)
jnthn (I write it `sub foo(Int $bar --> Nil) { }` to be clear)
buggable New CPAN upload: Sparrowdo-VSTS-YAML-Nuget-0.0.2.tar.gz by MELEZHIK modules.perl6.org/dist/Sparrowdo::V...n:MELEZHIK 20:35
raschipi m: sub foo(Int $bar --> Nil) { 3 }; say foo #won't return 3 20:38
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling foo() will never work with declared signature (Int $bar --> Nil)
at <tmp>:1
------> 3sub foo(Int $bar --> Nil) { 3 }; say 7⏏5foo #won't return 3
raschipi m: sub foo(Int $bar --> Nil) { 3 }; say foo 2 #won't return 3
camelia WARNINGS for <tmp>:
Nil
Useless use of constant integer 3 in sink context (line 1)
lizmat pmurias: my opinion in that respect is even weaker than weak 21:06
pmurias lizmat: parcel seems to be working at least for nqp.js, OTOH all the js tools at stuff that's not built by gigantic tech company feels a bit shoddy ;) 21:19
rabbit_ Hello. I installed zef using the instructions from github.com/ugexe/zef. 21:32
$ git clone github.com/ugexe/zef.git
$ cd zef
$ perl6 -I. bin/zef install .
This creates a dot folder called .perl6 in ~
lizmat that is correct, afaik
rabbit_ But I can't seem to call any of the commands from ~/.perl6/bin/ 21:33
is there an export that I need to add to my bashrc?
lizmat either you add zef/bin to your path, or you symlink zef/bin/zef to a directory that's in your path 21:34
rabbit_ Thanks a bunch. I tried export PATH=$PATH:$HOME/.perl6/bin 21:36
lizmat the ~/.perl6 directory is internal to Perl 6, it contains default precompiled modules, afaik 21:37
afk& 21:42
Mark04 Hi all. I'm trying to learn the ins and outs of signatures and parameter constraints in p6 21:45
How does one constrain the elements of an array parameter to a sub? 21:46
perlpilot You mean like make sure it's an array of Int or array of Str? 21:46
Mark04 perlpilot: thanks for saying it way more clearly than I did :) yes exactly 21:47
I'm browsing this but can't seem to make it work: docs.perl6.org/type/Signature#Type_Constraints
I need a "where" clause I guess do I? 21:49
Mark04 Oh, this works: sub takes_an_array_of_str( @array where { @array.all ~~Str } ) { blabla… } 21:51
I think…
perlpilot yeah, that should work. Though, you might want to consider using a subset if "array of Str" is an important thing for you 21:53
Mark04 perlpilot: subset? is that like a user-defined type?
perlpilot yes 21:54
Mark04 perlpilot: right yes I see how that would help in some cases. I was focused on the sub declarations in this case… but I'll remember subsets in the future thanks 21:56
MasterDuke Mark04: your other option is docs.perl6.org/language/list#index...yped_array 22:01
perlpilot It's a wonder someone hasn't written a typing tutorial that eases people into this stuff. (or maybe it's written but I don't know about it) 22:06
MasterDuke perl6.party/post/Perl-6-Types--Made-for-Humans is a start 22:12
perlpilot yep, but that covers the "easy" cases :-) 22:21
It's when you start trying to do things with arrays and hashes that the problems start
m: sub foo(Array[Int]) {}; foo([1,2,3]); # I think people expect this to work 22:23
camelia Type check failed in binding to parameter '<anon>'; expected Array[Int] but got Array ($[1, 2, 3])
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
lucs perlpilot: In that example, what would the correct sub declaration be for the expectation to be met? 22:53
Oh, just read the backscroll. 22:54