»ö« 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.
timotimo oh 00:00
m: constant Color = do { my enum Color <Red Green Blue>; Color }; say Red
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
Red used at line 1
timotimo m: constant Color = do { my enum Color <Red Green Blue>; Color }; say Color::Red
camelia Red
timotimo is "our" scoped by default
Garland_g[m] Ah. That makes sense.
Thanks. I have a couple enums with exactly the same key inside, and the "our" scoping was causing compilation errors. 00:03
timotimo the same question was on the channel the other day, unfortunately i forgot the one important word from the Right Answer™ ;) 00:04
Garland_g[m] Hmm... I'm still getting the "A symbol <symbolname> has already been exported" error. I'll be back in a bit. 00:19
For two different enums that happen to have the same key name.
timotimo they'll probably have to get their own blocks 00:20
m: constant Color = do { my enum Color <Red Green Blue>; Color }; constant FinalFantasyCharacter = do { my enum FFC <Cloud Lightning Red>; FFC }; say Color::Red; say FinalFantasyCharacter::Red;
camelia Red
Red
timotimo m: constant Color = do { my enum Color <Red Green Blue>; Color }; constant FinalFantasyCharacter = do { my enum FFC <Cloud Lightning Red>; FFC }; say Red;
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
Red used at line 1
AlexDaniel if there's anyone on this channel who cannot talk, just rejoin 00:58
our bot was unable to give +v properly
Garland_g[m] I figured out my error. I need to export the constants, not the internal enums. And if I use Mymodule::Color as the enum name, I get to call them the same way both inside and outside the file, which is really nice. 00:59
Thanks!
[Coke] . 01:26
SmokeMachine hi! Could some one, please, give me an opinion? im writing an ORM and Id like to know what do you guys think about the way Im thinking to create to describe relationships. Im pretty happy with the `Scalar` (to 1 relationship) and `Positional`(to many relationship) ways... but I have some doubts about the `Associative` (many to many relationships) one. could some one give me an opinion, please? 01:58
github.com/FCO/Red/issues/17
lichtkind does anyone know how to make a circumfix op | | work? 04:04
i tried everything i could come up with
lookatme_q lichtkind, maybe because | is a special infix 04:26
moritz m: sub circumfix:<| |>($a) { say "|$a|" }; |a| 05:50
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 3 circumfix:<| |>($a) { say "|$a|" }; |a|7⏏5<EOL>
expecting any of:
prefix
term
moritz lichtkind: | is already a prefix operator, and the parser cannot chose prefix:| vs. circumfix:| without backtracking 05:51
moritz m: sub circumfix:<§ §>($a) { say "|$a|" }; §a§ 05:51
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
a used at line 1
moritz m: sub circumfix:<§ §>($a) { say "|$a|" }; §4§
camelia |4|
lucs 0 06:04
jmerelo Hi! 07:09
dominix hi J 07:11
jmerelo Hi, dominix 07:16
El_Che the discussion on perlmonks and reddit of ovid's talk on the future of Perl 5 is weird. I am almost happy no one has mentioned Perl 6. 07:46
jmerelo El_Che: I'll have to check it out. He mentioned 3 or 4 things that should go into Perl 5 to make it a bit better. Those things are already in Perl 6. So it's like, Perl 5 can be better by becoming even more like Perl 6 07:47
El_Che yes, that's the subtext I get without havibng seen the talk 07:48
jmerelo El_Che: it was gradual typing, signatures, a minimal class system... Don't remember the next, but I was listening to him and thinking "Now he's gonna say that by having this it's become Perl 6"
El_Che a faster perl 6 with more modules, essentially 07:49
lookatme_q :) 07:50
jmerelo El_Che: well, the thing is that he did mention that Perl 6 is going to become eventually faster than Perl 5. There's the potential there in the MoarVM
El_Che yes, indeed 07:52
masak El_Che: I noticed the sentence that said that Perl has no energy, no sense of direction, no long-term strategy. that's exactly why Perl 6 got started once many years ago. 08:21
jmerelo masak++
masak has power fantasies about the Perl 5 community going "oh noes Perl is dying, we should've done something about this years ago" and Perl 6 jumping out and going "ta-daa!" 08:23
jmerelo masak: Well, as Larry Wall says, "We love Perl for what it is" 08:24
Also, Perl is Perl 08:27
El_Che masak: some pschycologist would argue that it's a repressed fear of the Perl5 people saying: "ah, that's why were dying" :) 08:33
jast the good thing about being a psychologist is that these types of arguments are untestable :) 08:36
El_Che :)
jast my favourite in that direction is evolutionary psychology (the idea that much of our day-to-day behaviour evolved a long time ago). it's unprovable but easy to talk about at length. 08:38
lizmat weekly: lancewicks.com/2018/08/18/the-euro...apceu2018/ 08:54
notable6 lizmat, Noted!
lizmat weekly: blogs.perl.org/users/mohammad_s_anw...eport.html 08:55
notable6 lizmat, Noted!
lizmat weekly: perlmonks.org/?node_id=1220578
notable6 lizmat, Noted!
lizmat is going to be afk until much later today
masak lizmat: thanks for the weekly! I wish I were there in Glasgow! 09:09
also, did lizmat just imply she's been up all night and will sleep through the day? :P
scimon Morning all. 09:24
yoleaux 16 Aug 2018 13:58Z <b2gills> scimon: where clauses can be a statement that is smartmatched automatically (watching livestream) `subset IntOrRat of Numeric where Int|Rat`
16 Aug 2018 13:59Z <timotimo> scimon: i think you had a test for /Hello world/ and expected it to match "Hello world", but whitespace in perl6 regex aren't significant; i think rakudo is supposed to warn about that, though?
16 Aug 2018 14:00Z <timotimo> scimon: sorry, that was actually meant for lancew
scimon b2gills: Thanks 09:25
jnthn: I was thinking of grabbing your StackOverflow answer re environment traits and nicking some of Liz's code from Hash::LRU to make a new module version of it. 09:27
jnthn scimon: Feel free :) 09:29
yoleaux 01:55Z <AlexDaniel> jnthn: any pre-golf thoughts on R#2231 ?
synopsebot_ R#2231 [open]: github.com/rakudo/rakudo/issues/2231 [SEGV][regression][⚠ blocker ⚠] SEGV in Audio::Sndfile
jnthn .tell AlexDaniel The ticket doesn't have a stack trace, which I'd need to give any useful pre-golf thoughts :)
yoleaux jnthn: I'll pass your message to AlexDaniel.
lichtkind moritz thank you i thought about that stuff too and was not quite sure since @ ist also a prefix context op and in fact you can use it build a cricumfix or do I moss something? 09:31
AlexDaniel . 09:32
yoleaux 09:29Z <jnthn> AlexDaniel: The ticket doesn't have a stack trace, which I'd need to give any useful pre-golf thoughts :)
AlexDaniel jnthn: :)
moritz lichtkind: @ is not a prefix op I know 09:38
I know @ as a sigil (which is parsed as part of a term) and I know @( ... ) as a circumfix operator 09:39
lichtkind_ moritz, yes I just checked but it once was an context op at least around 2005-6 ish 09:55
pmurias masak: it's an interesting questing if Perl 6 got fast and was picking up steam would it help or hinder the Perl 5 language 10:25
stmuk_ I don't think perl 5 v perl 6 is a zero sum game 10:44
I also think if ever there is another implemention of perl 5 other than the current it's likely to be written in perl 6 10:45
perl 6 is a potential solution to perl 5's problems. Perl 6 hasn't caused them.
jmerelo stmuk_++ 10:49
squashable6: status
squashable6 jmerelo, Next SQUASHathon in 10 days and ≈23 hours (2018-09-01 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day
scimon My favourite bit of Ovid's talk on the future of Perl was the laughter at the question "What would I like to see added to Perl6". 10:56
stmuk_ personally I've always wanted more features removed from languages than added :) (not the perl way I know) 11:04
jmerelo scimon: right. Perl 6 has got everythin _and_ the kitchen sink. Or the kitchen sink context, as it were. 11:05
jmerelo But Perl 6 is not going to happen by itself. Still a lot of work to do. For instance, in the documentation :-) 11:05
scimon On that note do we have a ticker about adding more documentation for react { whenever {} } blocks? 11:13
scimon lunches 11:18
pmurias re features to add, having a real gradual type system would be cool (OTOH it's likely it would be best to have it on CPAN so you could choose the static type system) 11:32
scimon pmurias: How do you mean? I thought the current type system was pretty impressive. What's it missing? 11:42
pmurias scimon: the current "type system" is mostly runtime assertions 11:47
scimon: in a proper gradual type system once you but your types everywhere you get static type checking at compile time
scimon: the gradual type system are called that way because you can gradually convert your dynamically type program into a statically typed one 11:50
jmerelo scimon: yep, there's a ticket. Let me find it for you 11:59
scimon: it literally says "What the hell is react/whenever" github.com/perl6/doc/issues/2135 12:00
lichtkind jmerelo, greetings was insightful to meet you in person, hope we get soemthing done 12:10
jmerelo lichtkind: likewise. :-) 12:12
lichtkind jmerelo, i would like have something like that but most of it you already have so just a similar index page to the according bits tablets.perl6.org/appendix-b-grouped.html 12:14
jmerelo lichtkind: I had no idea that existed. Is it generated from elsewhere, or written from scratch? 12:16
lichtkind jmerelo, by my own hands :) 12:21
jmerelo lichtkind++ that's a lot of work. It's hosted in some repo?
lichtkind jmerelo, i wroe it 2005-2009 in our german perl forum wiki which is currently down 12:22
lichtkind jmerelo, github.com/perl6/tablets 12:24
JP_ Hi, I’d like to lear more about perl6 12:29
lichtkind just released Math::Matrix 0.25
Ulti JP you came to the right place :D
JP_ And how can I start? 12:30
Ulti JP_ perl6intro.com/ is a good first place and in many langs
lichtkind JP_, that covered good at perl6.org
or that 12:31
Ulti yeah and the other offical docs location to get started rather than just reference on built in objects is docs.perl6.org/language.html 12:32
Ulti JP_: if you dont want to go to the effort of installing Perl 6 yet there are a couple of places you can run example code, one such service can be found here glot.io/new/perl6 12:34
Geth Pod-To-HTML: JJ++ created pull request #44:
Tries to fix a problem with URLs that started with ?
12:37
jmerelo lichtkind: wow, 3 year old. We will need to do stuff about that... 12:45
lichtkind jmerelo, but my goals was to port the good parts into docs since i dont have the time to make this as full time work 12:46
jmerelo, and than eventually adandon them
jmerelo lichtkind: that might not be trivial... 12:47
lichtkind sure
jmerelo lichtkind: and what kind of markup is it using? 12:48
lichtkind markdown 12:48
conversion was painful
jmerelo lichtkind: there's going to be some impedance with the rest of the documentation, which is in Pod 6. I would say it's better to keep it separate for the time being... 12:49
jmerelo lichtkind: in fact, for the foreseeable future. 12:49
jmerelo goes afk for lunch now...
Luneburg Is there any way to remove a specific character from a sequence (i.e. "a") without knowing where it is in the sequence? 13:16
moritz yes, with grep 13:17
Luneburg moritz: Ah, I remember now. Thanks.
moritz m: my \new_seq = ('a' ... *).grep(none('a')); say new_seq.head(10) 13:17
camelia (b c d e f g h i j k) 13:17
moritz m: my \new_seq = ('a' ... *).grep(none('f')); say new_seq.head(10)
camelia (a b c d e g h i j k)
SmokeMachine sorry, Im not trying to spam, just sending it again when there's more people logged in 13:31
hi! Could some one, please, give me an opinion? im writing an ORM and Id like to know what do you guys think about the way Im thinking to create to describe relationships. Im pretty happy with the `Scalar` (to 1 relationship) and `Positional`(to many relationship) ways... but I have some doubts about the `Associative` (many to many relationships) one. could some one give me an opinion, please?
22:58 github.com/FCO/Red/issues/17
SmokeMachine moritz: I had answered your comment 13:49
SmokeMachine moritz: (thanks for the help!) 13:49
moritz SmokeMachine: somehow this is all too much magic for my taste 13:56
SmokeMachine :( 13:57
moritz: is there a way to do that you would prefer? 13:58
moritz SmokeMachine: as I mentioned before, I like the way that SQLAlchemy does it
you declare an attribute/column to be a foreign key 13:59
moritz and then you add a second attribute that is the relationship, and if there is more than one foreign key that maps to the relationship type, you have to specify which one you refer to 14:00
moritz and in the relationship constructor, you can add extra arguments for non-default relationship types (for example uselist=False for a 1:1 relationship that is modeled as a foreign key) 14:01
moritz the problem with callbacks tend to be: what do you do when you don't have an instance? 14:02
for example, you want to generate the DDL for your classes. What instance of your types can you pass in to discover the foreign key relationships? 14:03
those callbacks give you max flexilibity and min introspectability
I guess Track.cd-id (called on the type object) could return a Column object with enough meta data 14:05
moritz but then all the callbacks need to work with both instance and type objects, which is not obvious to the user 14:05
SmokeMachine moritz: it already does... attributes column (as `has $.bla is column`, and `has $.ble is referencing{ Bli.something }`) are Red::AttrColumn and it adds a method on its undefined class that returns the column description. Thats how i can do something like `Question.where: .answer == 42` 14:12
moritz: when I call `.cd-id` on an object, it returns the value of the cd-id 14:16
pmurias SmokeMachine: what do the callback give you? 14:29
scimon Currently I'm working with SQAlchemy and DBIC and muchly prefer DBIC. Mainly because it's easier to have it make SQL requests I'm expecting.
(Good luck BTW)
SmokeMachine pmurias: the column that should be used
scimon: thanks! :) 14:30
pmurias: and that need to be a Block because the column can not be defined yet... 14:31
pmurias so a method will retain a column value when called on an objects and some more general 'column called this' on a type object? 14:33
SmokeMachine pmurias: not a column value, but a column representation... 14:34
pmurias: this: github.com/FCO/Red/blob/master/lib...Column.pm6 14:35
pmurias: I think I didn't get it... :( 14:36
pmurias: yes, that's it! the value on a object and the column description on type object! that's it! 15:04
but on the callback it's always called on a type object... 15:05
if I need to get the value, I get it from the column descriptor and the instance of the object... 15:06
SmokeMachine like here: github.com/FCO/Red/blob/master/lib...ip.pm6#L11 15:07
and here: github.com/FCO/Red/blob/master/lib...ip.pm6#L16 15:08
Ulti I like the idea of column ORMness shadowing just plain class style representations with plain values 15:42
also I am pro maximum magic and syntactic sugar, so long as there is always an escape hatch
the escape hatch doesn't have to be necessarily pretty but does need to be relatively guessable or discoverable, SQLAlchemy is actually awful for this, just today I was trying to work out how to inject plain SQL into the select part of a query 15:43
fairly sure its not really possible, instead you can create an ORM like query from a statement but its a full query and finalised all you can do is annotate over the top the model/column annotation to what is returned so that it can be combined with other ORM queries in sub selects etc 15:45
which would do what I want, but really all I wanted to do was specify a single nugget of SQL for a single column clause in the select
from what I can see at the moment there isn't much around more arbitrary queries in Re 15:46
*Red
outside of the direct ORM relationships
Ulti btw SmokeMachine have you seen Pony in Python? 15:51
ponyorm.com/
Perl 6 definitely has the power to go a step further for nice syntax on queries 15:52
SmokeMachine Util: yes, I did 15:54
Util: Ill take another look
Ulti its kind of crazy what the dev has to do to get that in Python stackoverflow.com/questions/161157...6#16118756 15:55
Ulti a query slang is something I'd be super interested in working on, I really like the SQL one we already have in the ecosystem 15:57
SmokeMachine Util: looking at the first page of pony, I think some day it will be possible to do that query with Red using a code like this one: `Customer.all.grep({ .orders.sum > 1000 })` 16:11
Util: but its far from that currently...
Ulti plus you'd want to use where and subsets right :D 16:14
SmokeMachine Util: do you think it's a good way to go? 16:16
sorry: `Customer.all.grep({ .orders.price.sum > 1000 })` 16:20
buggable New CPAN upload: Trait-Env-0.0.1.tar.gz by SCIMON cpan.metacpan.org/authors/id/S/SC/...0.1.tar.gz 16:22
scimon So I've been totally hard at work today.
scimon And I'm off. Later folks. 16:31
Ulti SmokeMachine the dream: subset PayingCustomer of Customer where *.orders.sum > 1000; 16:40
a nice way to define views at least :)
SmokeMachine That’s a great idea! 16:41
Ulti especially if you can have relationships on them
SmokeMachine Util: I was planning `Customer.alias(PayingCustomer, :on{ .orders.price.sum > 1000 }) 16:43
But subset makes much more sense
Ulti I've never actually checked what subsets produce 16:47
Ulti I assume its full subclass with the where function wrapping the constructor and type object comparisson stuff 16:49
Geth doc: e3c4294708 | (JJ Merelo)++ | htmlify.p6
Adding more info in htmlify to try and find error in #2270
16:55
doc: 984ad94dc6 | (JJ Merelo)++ | doc/Type/Routine.pod6
Adds a simple note on the behavior of is pure on multis

Basically specifying that this could change in the future, if rakudo/rakudo#2215 is solved. This solves #2215
synopsebot_ Link: doc.perl6.org/type/Routine
synopsebot_ RAKUDO#2215 [closed]: github.com/rakudo/rakudo/issues/2215 [regression][testneeded] Blob.subbuf regression since 2018.06
jmerelo Er, I mean 2127. Sorry. Will edit. 16:57
jmerelo realizes you can't edit commits. Well, you can, but once they're pushed they can cause a lot of trouble. Anyway. 17:00
epsilonphase Hi, I've been reading about perl6 for a while now, and I 17:09
... Sorry.... In any case, I was wondering how things are turning out with the macro system?
jmerelo epsilonphase: I think it's still not there. 17:39
sena_kun epsilonphase, you can look at github.com/masak/007/ for some, I believe, work in progress on topic. 17:40
jmerelo epsilonphase: I'm checking out the next version, and I don't see anything planned. You can still use it with "use experimental"
epsilonphase That's what I had suspected. Thanks for confirming it. 17:45
Ulti epsilonphase: this level of macro exists perl6advent.wordpress.com/2012/12/...23-macros/ 17:53
if you do: use experimental :macros;
epsilonphase out of curiosity what makes you specifically interested in macros? 17:54
epsilonphase I've had an interest in lisp for quite a while, but, the prefix order is less readable than postfix or infix, at least, by my eyes. 17:55
Also compile time magic is really neat.
Ulti well you get a lot of that through other means in Perl 6 than the feature called "macros" specifically 17:56
like slangs let you do a lot
Ulti you can essentially grab the compiler mid doing something and take over for some defined context and then hand back 17:58
Ulti epsilonphase: this might interest you github.com/tony-o/perl6-slang-sql 18:00
masak epsilonphase: hi! I am an automated response system that triggered on the word "macros". how may I help you? 18:02
Ulti >:3 18:03
epsilonphase Masak: I was wondering if you'd show up :D I'd read some of your blog posts before coming on. Ulti: That's really neat too. 18:04
masak epsilonphase: I think the 10-word summary is "I'm pleased at how 007 keeps informing Perl 6 macros" 18:05
of course, given that it all happens on the side so far, it's also a little bit obscured
but being able to iterate on a smaller language has helped a lot
epsilonphase I was taken aback when I saw how much it looks like it's also turning into a more or less fully fledged language. Or, rather, I read your intention as that. 18:06
masak yeah... it's a bit of a surprise to me too 18:07
it's already the case that 007 has the fullest implementation of Perl 6 macros to date 18:08
basically, fleshing them out more means cheating less and less with the language 18:10
epsilonphase It's funny how that happens huh? Though.... I'm not sure I see how you operate on the QTrees in 007 in the docs yet. 18:13
masak I'm willing to explain if you feel you have the time and patience
epsilonphase Sure. 18:15
masak simplest case: `moo("something")`, where `moo` is a macro 18:16
epsilonphase Alright.
masak it looks like a normal sub call, but it's a macro call
epsilonphase Lisp would've been out of luck otherwise. 18:17
masak a sub call would invoke during runtime; the macro call invokes sometime during compile time, sometimes as early as right after the `)`
epsilonphase Alright, I think I follow. 18:19
masak in the sub case, the argument is the Str "something"; in the macro case, the argument is the Q::Literal::Str with the value "something"
epsilonphase Okay, so it passes the tokens/syntactic constructs between the ( and )? 18:20
masak yes; basically an argumentlist is a comma-separated list of expr; it passes each expr Qtree as an argument 18:22
similarly, on the other end, a sub returns a regular value but a macro returns a Qtree. that Qtree gets put back into the program in lieu of the macro call 18:23
it's what happens, for example, in examples/name.007
in all of the above, we've not mentioned hygiene. but it's of course there all the time. 18:25
epsilonphase Oh, so, implemented completely, if you had a troublesome area of code doing something silly, could you have it do something like add printing of line numbers between each contained expression?
masak yes, that sounds within the realm of the possible. given something like Perl 6's $?LINE variable 18:27
lately though I've been thinking more about constructions like `amb` and `each`. and syntactic junctions. :)
epsilonphase That sounds like it would definitely simplify the construction of such a macro? Though, I think I know what each does, but what does amb do? 18:28
masak the second-simplest case of a macro invocation is when the macro is an operator. so something like `x == "start" ff x == "end"`, where infix:<ff> is a macro 18:29
oh, `amb` is, hold on, let me link you
github.com/masak/007/issues/13 18:30
masak (note the issue isn't really agreed with itself exactly how the syntax should be) 18:30
epsilonphase That first example kinda reminds me of goal seeking from Prolog.That'd be terrifyingly powerful. 18:30
masak aye 18:31
jmerelo My take on TPCIG dev.to/jj/perl-is-perl-46cm
masak it's made slightly more concrete with github.com/masak/007/issues/349#is...-408550689 which is more recent
epsilonphase Though, if we could get back to where you were going, (the infix macro), is that going to be kinda like how Haskell handles infix operators? 18:33
SmokeMachine masak: do you think someday will macros make it possible to override `&&` and `||`? 18:34
masak SmokeMachine: yes, I hope so. 18:35
SmokeMachine masak: :) 18:36
masak SmokeMachine: I mean, from a 007 perspective, `&&` and `||` are (built-in) macro infixes
pmichaud++ was doubtful at one point where the whole circularity loop would close wrt booleans, conditionals, and those operators. wow, that must be sometime around 2011. 18:37
I think at this point I have a fairly good answer to that.
I'd define `&&` and `||` in terms of `if`. and then `if` in terms of a lower-level control flow API that told the code generator how to write GOTOs. 18:40
epsilonphase: how does Haskell handle infix operators? I'm not sure I know enough about that. I've seen them declared sometimes -- the precedence level is a number...? 18:42
epsilonphase: maybe gist.github.com/masak/010ba2ab93a5...-operators is a good intro to how 007 thinks of operators 18:44
epsilonphase (Honestly that's not part of them that I understand), but I was referring more to the passing of the arguments to either side being translated into sequential args. $v1 <ack!> $v2 is just <ack!>($v1,$v2)
masak aha. well, then, in that case, yes. :) 18:45
somewhat unrelatedly, I'm (very slowly) coming around to the notion of things like infix:<+> delegating to an .add method on the *left* operand -- something Perl 6 doesn't do but a lot of other languages do 18:46
Perl 6 is very CLOS-y in that it prefers multisubs for that 18:47
epsilonphase I don't mind that, but it does throw a lot of established OO techniques through a hoop 18:49
masak I think I was slightly swayed by lambda-the-ultimate.org/node/5509 which is a good read 18:50
epsilonphase: anyway, skipping ahead: the unwritten parts of that guide have sections like "The Q hierarchy", "Quasi blocks", "Macros" -- I've now described up to here -- "Stateful macros", "Closures in macros", "Macros that parse", "Contextual macros", "Evaluating expressions", "Interacting with control flow", and "Parsers and slangs" 18:52
so far I've enjoyed fleshing out the first part of the guide, the language/user part 18:53
I think I'm going to enjoy just as much fleshing out the second part, the macros/parsers part
epsilonphase Macro closures sound like a nifty feature, though a little thought and I suddenly wonder whether or not compile time object orientation makes any sense at all. 18:56
masak I think the most powerful example of a macro closure to date is github.com/masak/007/issues/176#is...-240849038 19:00
that `op.identifier` there finds the `infix:<+>` (or whatever) that was the identifier behind the `+` parsed out of a `[+]` 19:01
and yes, it'd find the _right_ `infix:<+>`, the one that was defined in that scope where it parses
SmokeMachine masak: about the `is parsed` how do I tell to the macro what should be used as each argument? 19:05
masak SmokeMachine: I'm very vague on the details of that one. it needs to be implemented and tried out in practice. 19:07
SmokeMachine: for a long time it was "magically turn each named match in the regex into an argument to the macro invocation"
SmokeMachine: now I'm leaning towards "if the macro has an `is parsed`, then there's an extra `match` parameter", which is more boring and a bit less reachable, but also maybe more predictable 19:08
SmokeMachine hum... thanks
epsilonphase So... the idea is that macro Term:reduce introduces a multimacro(?) which is resolved at compile time specifically for static invocations where the arguments are fixed in advance, then recursively applies the macro to each argument, turning [+] 1 2 3 4 into 1+2+3+4? 19:08
masak there's also a bit of a design hole (in 007) where the actions are in Perl 6. 19:09
epsilonphase: modulo syntax, yes.
timotimo masak: have you ever tried some of the microbenchmarks we sometimes pass around for perl6? do you know if you reach nqp levels of speed with a little care?
masak epsilonphase: in 007, it'd be spelled `[+](1, 2, 3, 4)`; the macro comes across as a term with a value that's a function
eiro ok people: i have the give away from the french consulate of edimburgh. i'll be home tomorrow :)
masak timotimo: not nearly reaching any kinds of speed. 007 is dog slow :) 19:10
timotimo: heh, I/we are still *interpreting* the AST! o.O
timotimo oh, oops :)
eiro (for the ones who don't know the story: i lost my id card at the airport after tpcig, stuck in scotland) 19:11
(there are much worse places to be stuck in: scotland is great)
timotimo still lots of trouble, whew :( 19:12
masak eiro: hugs and good luck
eiro masak, everything is fine now: i can go home tomorrow
masak, i lost my password but saw the /query. reply by mail 19:13
masak oki 19:14
moritz eeks, and glad to know it's turining out OK
hope you didn't miss too much at home
jmerelo eiro: congrats! 19:15
masak epsilonphase: the main takeaway is that the `+` inside the `[+]` is not just "the built-in infix:<+>", but it's whatever infix:<+> you have active when you're parsing that `[+]`. and that's a macro closure.
I recently found how the Dylan Reference Manual describes all this, and I love it 19:17
"This substitution preserves the meanings of names. In other words, each name inserted into the expansion from the macro call refers to the same binding that it referred to in the call, and each name inserted into the expansion from the macro definition refers to the same binding that it referred to in the definition."
"the meanings of names" is a _much_ better term than anything I've used so far
masak source: opendylan.org/books/drm/Macros_Syntax 19:18
epsilonphase That's pretty neat. Dylan's on my list of languages I'd like to try out.
masak yeah, same.
masak if I understand correctly, Dylan was first created with Lisp/sexpr syntax, but later it was decided that it should have more Algol-ish syntax 19:19
epsilonphase Ot 19:20
It is lisp in pascal, from what I've heard.
Guest23430 help 19:56
timotimo hello avi 19:57
what can we do for you today?
Guest23430 just checking out the irc
timotimo cool. we got lots of fun irc bots to play with, and many friendly people 19:58
timotimo m: say "he" ~ "l" x 2 ~ "o" 19:58
camelia hello
Guest23430 where is the baseline Rakudo star documentation stored?
timotimo github.com/perl6/doc/ - i think you mean this? 19:59
Guest23430 thank-you! 20:00
timotimo no problem!
every page on docs.perl6.org also has a direct link to the source file at the bottom i think
masak Guest23430: hello avi 20:04
Guest23430: enjoy #perl6 :)
timotimo dinnertime! TTYL 20:07
lizmat waves from Tyndrum 20:26
yoleaux 15:03Z <brrt> lizmat: we are seeing travis CI problems on OS X, and I don't have OS X, so maybe you could have a look?
lizmat (switched to 4G as the hotel Wifi is apparently over satellite and very latent)
.tell brrt if this is about t/spec/S32-io/file-tests.t, then yes it fails on MacOS 20:27
yoleaux lizmat: I'll pass your message to brrt.
lizmat weekly: dev.to/jj/perl-is-perl-46cm 20:30
notable6 lizmat, Noted!
lizmat weekly: dev.to/scimon/my-first-perl-conference-2j6d 20:35
notable6 lizmat, Noted!
lizmat notable6: weekly 21:23
notable6 lizmat, 11 notes: gist.github.com/fcd6ead769ea84b403...c240c09843
uzl Hey, #perl6! 22:54
m: class Foo { method greet() { say self.^name(); } }; say Foo.new.greet(); 22:55
camelia Foo
True
uzl m: class Foo { method greet() { say self.^name(); } }; Foo.new.greet();
camelia Foo
uzl m: class Foo { method greet($obj:) { say $obj.^name(); } }; Foo.new.greet(); 22:56
camelia Foo
uzl Is using a named invocant syntactic sugar to just use self instead? What additional advantages does using a named invocant provide? 22:58
doc => docs.perl6.org/language/objects#Cl...ce_methods
uzl m: class Foo { method greet(::?CLASS:D $me:) { say $me.^name(); } }; Foo.new.greet(); 23:03
camelia Foo
uzl m: class Foo { method greet(::?CLASS:D :) { say self.^name(); } }; Foo.new.greet();
camelia Foo
jnthn uzl: The only reason I'd do it is to add a :D or :U constraint 23:08
Oh, or if I wanted an rw invocant
vrurg AFAIK, there is no way to have a tempdir which would be autoremoved upon existing a scope. Am I right? 23:09
uzl jnthn: Great! Yeah, I just wanted to make sure that I wasn't losing some functionality by not having it explicitly defined. 23:22
Thanks!
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2018/08/20/...m-tyndrum/
yoleaux 21:45Z <brrt> lizmat: it's not, it's about the NQP build failure because git
b2gills vrurg: You could add a LEAVE phaser that deletes the dir. 23:23
uzl lizmat: Wow, that was fast! Feeling better from the cold? It was a cold, right?! 23:24
lizmat yeah... :-)
vrurg b2gills: sure I can, but what if it's a couple of locations in the code? What if it's several temps?
Would be solvable if its possible to install own LEAVE for a block. 23:25
uzl :-) !
b2gills It may be possible to auto-install a phaser with a macro, but macros are currently experimental. 23:27
jnthn vrurg: Just write some sub with-temp-file(&code) { my $temp-file = ...; code($temp-file); LEAVE unlink $temp-file; } and then use it as with-temp-file -> $file { ... } 23:28
vrurg jnthn: The solution so far, perhaps. Thanks! 23:30
timotimo lizmat++ # weekly is good 23:31
lizmat goes off to try to find the (small) bed she's going to sleep in tonight