🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku Set by ChanServ on 14 October 2019. |
|||
uzl[m] | tbrowder: It'd be great if you could add some image to the module's readme showcasing the result from Draw2D::Furniture | 00:06 | |
lizmat++ for keeping on top of things ;-)! | |||
tbrowder | uzl[m]: good idea, i'll see what i can do... | 00:08 | |
00:09
TeamBlast left,
dotdotdot left
00:10
TeamBlast joined
00:11
dotdotdot joined
00:12
AlexDaniel joined,
AlexDaniel left,
AlexDaniel joined
00:26
Circlepuller joined
00:27
TeamBlast left,
Circlepuller is now known as TeamBlast
00:35
upupbb-user1 left
00:42
lucasb left
01:01
mniip left
|
|||
[Coke] | MasterDuke: working on a response. | 01:02 | |
01:05
PacoLinux joined
01:11
mniip joined
01:27
gabiruh joined
01:35
hungrydonkey joined
01:36
devmikey left
|
|||
[Coke] gives up for tonight and posts this as his work in progress: | 01:37 | ||
gist.github.com/coke/91e50f577cfe7...6d44541a3a | 01:45 | ||
Feel free to steal any of that if you're putting together a response. | |||
01:53
Redfoxmoon left,
Redfoxmoon_ joined
01:57
Black_Ribbon joined
02:03
ToddAndMargo joined
|
|||
ToddAndMargo | Anybody home? | 02:03 | |
What is the opposite of "get". I want to send something to the Internet | 02:04 | ||
Grinnz | depends what the server expects but usually POST or PUT | ||
ToddAndMargo | Thank you! I want to send an smtp command | 02:05 | |
Grinnz | I was assuming you were talking HTTP of course, which you weren't :P | ||
en.wikipedia.org/wiki/Simple_Mail_...l_overview describes how SMTP works at a high level | 02:07 | ||
ToddAndMargo | I saw an example of "get" to read an http address, so I presumes a little too much. :'( | ||
Grinnz | it's quite unrelated to HTTP | ||
except that both are TCP-based | |||
ToddAndMargo | do we have a library written for smtp? | ||
Grinnz | well, first of all, you usually only need sendmail if your local system already has a working sendmail | 02:08 | |
smtp is a second choice after that, because you need to authenticate with the smtp server | |||
direct smtp, i should say | 02:09 | ||
ToddAndMargo | if wish. I have to cross platform Linux and Windows. And pain-in-the-neck, I have to talk to OAuth2 servers | ||
Grinnz | I don't see an analogue to Email::Sender for raku, though (which would be your sendmail-or-smtp wrapper) | 02:10 | |
there is modules.raku.org/dist/Net::SMTP::C...:HANENKAMP | |||
02:10
rbt left
02:11
rbt joined
|
|||
Grinnz | for smtp specifically, but you probably want to use another module to build the MIME message | 02:11 | |
modules.raku.org/dist/Email::MIME:cpan:RBT | |||
02:11
ufobat_ joined
|
|||
ToddAndMargo | I have all the mime stuff down. | 02:11 | |
Grinnz | OAuth2 is an HTTP authentication scheme, so I'm not sure how it would apply to sendmail or SMTP | 02:13 | |
ToddAndMargo | indeed. You have to get all that stuff ready first, then include the token with your smtp command | 02:14 | |
02:14
ufobat left
|
|||
ToddAndMargo | Where I am stopped is the syntax to send the token | 02:15 | |
Grinnz | it is probably a message header | 02:16 | |
may even be the same Authorization header a normal HTTP request would use | |||
ToddAndMargo | not seeing a way to add a header to Email::MIME:cpan:RBT. Or a way to talk to the author | 02:19 | |
Grinnz | in the example header-str's value appears to be the set of headers | ||
rbt | Sorry, I didn't write it. Just took over maintaining it. I mostly use it for parsing messages. | 02:20 | |
ToddAndMargo | how do I include an OAuth2 token in the run string? | 02:21 | |
rbt | Good question. It's a port of the perl5 version. Perhaps the docs here will help: metacpan.org/pod/Email::MIME | 02:24 | |
ToddAndMargo | metacpan.org/pod/Email::MIME#header Do we have `header_str_pairs` in our port somewhere? | 02:25 | |
rbt | Yes | 02:26 | |
header-str-pairs() | |||
ToddAndMargo | Maybe I am on the wrong module. I am on modules.raku.org/dist/Net::SMTP::C...:HANENKAMP and my search function comes up zero on "header" | 02:27 | |
02:29
MasterDuke left
|
|||
Grinnz | that is the module for sending the message, not building it | 02:30 | |
02:30
hungrydonkey left
02:31
hungrydonkey joined
|
|||
ToddAndMargo | where should I be? | 02:32 | |
rbt | Both? Build a message (Email::MIME), then take the resulting Str and send it (Net::SMTP*) | 02:33 | |
ToddAndMargo | Got it. Thank you! I have been doing this with a call to cURL (no Auth2 support). I am looking at my module right now | 02:37 | |
02:39
Black_Ribbon left
|
|||
ToddAndMargo | Looks like I just stick it here: my $email = Email::MIME.create(...) | 02:39 | |
[Coke] | off topic: any MTG Arena players here? | ||
if so, feel free to DM me friend details. | 02:40 | ||
02:40
Doc_Holliwood left
|
|||
cpan-raku | New module released to CPAN! Concurrent::PChannel (0.0.1) by 03VRURG | 02:42 | |
ToddAndMargo | rbt; if I get this working, would you mind if I sent you details so you can add it as an example? | ||
rbt | That would be great. | 02:43 | |
ToddAndMargo | best method to contact you? | 02:44 | |
rbt | Can you make a github ticket? | 02:47 | |
github.com/retupmoca/p6-Email-MIME | |||
ToddAndMargo | Will do when I get it figured out. Eventually I am going ot wrap CobiaN Backup with it, as Cobian does not support Auth2 is is not longer supported (split infinitive) plus all my Linux call home programs on the servers I support when Google stops supporting Less Secure Apps on g-suite come July | 02:51 | |
I also have a pythod example, if tht means anything to you guys: stackoverflow.com/questions/114455...2-possible | 02:54 | ||
02:59
AlexDani` joined
03:01
AlexDaniel left,
Manifest0 left
03:02
Manifest0 joined
03:22
AlexDani` is now known as AlexDaniel,
rbt left,
AlexDaniel left,
AlexDaniel joined
03:23
rbt joined
03:26
upupbb-user2 joined
|
|||
timotimo | ToddAndMargo: i assume using Inline::Python is a bit too annoying to deploy to your target systems? | 03:38 | |
ToddAndMargo | I want to learn python and installing it on Windows machine like I want a hole in the head. I love Raku. I actually enjoy programming in it. | 03:40 | |
03:52
pilne left
03:56
vike left
04:00
yht left
04:01
vike joined
|
|||
ToddAndMargo | what is this all about? K:\Windows\NtUtil>zef install OAuth2::Client::Google===> Searching for: OAuth2::Client::GoogleEnabled extracting backends [git path psunzip] don't understand C:\Users\tony/.zef/tmp\1585022838.2848.5555.088006717173\OAuth2-Client-Google-0.1.1.tar.gzYou may need to configure one of the following backends, or install its | 04:07 | |
underlying software - [tar p5tar unzip] | |||
04:10
epony joined
04:36
hungrydonkey left
04:43
aindilis left
04:50
epony left,
epony joined
04:53
epony left
04:55
epony joined
04:59
aindilis joined
05:02
yht joined
05:07
hungrydonkey joined
05:09
molaf joined
|
|||
epony | if you get spammed (info freenode.net/kb/answer/usermodes) set: /mode yournick +R | 05:10 | |
05:24
ToddAndMargo left
05:31
Redfoxmoon_ left,
Redfoxmoon_ joined
05:32
Redfoxmoon_ is now known as Redfoxmoon
05:39
molaf left
05:59
cpup left
06:01
cpup joined
06:08
yht left
06:13
wamba joined
06:23
yht joined
06:31
Doc_Holliwood joined
06:35
sjm_uk joined
06:53
marcusr joined
06:54
no-n joined
06:56
no-n left
07:14
rindolf joined
07:30
MasterDuke joined
07:48
upupbb-user2 left
07:52
pecastro joined
08:24
pecastro left,
sjm_uk left
08:37
dakkar joined
08:39
PacoLinux left
08:58
aborazmeh joined,
aborazmeh left,
aborazmeh joined
09:23
Doc_Holliwood left
|
|||
lizmat clickbaits rakudoweekly.blog/2020/03/23/2020-...ification/ | 09:40 | ||
09:43
hungryd4 joined,
hungrydonkey left
09:45
aindilis left,
aindilis joined
09:55
stoned75_ left
09:56
stoned75 left
10:03
mniip left,
hungryd4 left
10:04
hungrydonkey joined
|
|||
Altreus clicks | 10:12 | ||
dammit! Baited! | |||
10:15
mniip joined
|
|||
[ptc] | that happens to me every week too! | 10:21 | |
Kaiepi | releasable6, status | 10:22 | |
releasable6 | Kaiepi, Next release in ≈4 days and ≈8 hours. 4 blockers. Changelog for this release was not started yet | ||
Kaiepi, Details: gist.github.com/a384e152a37bcbdda5...848833aa6d | |||
Altreus | I was confused why it had the volkswagen logo as the favicon but then I realised it was wordpress | 10:29 | |
tadzik | . o O ( VolksWörter ) | 10:31 | |
tbrowder | .tell uzl[m] take a look at the Draw2D::Furniture now | 10:33 | |
tellable6 | tbrowder, I'll pass your message to uzl[m] | ||
10:37
chloekek joined
10:38
aborazmeh left
|
|||
El_Che | tadzik: vox populi elsewhere :) | 10:38 | |
10:40
MasterDuke left
|
|||
cpan-raku | New module released to CPAN! P5pack (0.0.11) by 03ELIZABETH | 10:46 | |
tbrowder | uzl[m]: short of gihub pages (haven't used yet) that's the only thing i know how to do | 10:51 | |
10:53
upupbb-user2 joined
11:04
aborazmeh joined,
aborazmeh left,
aborazmeh joined
11:13
MasterDuke joined
11:47
squashable6 left
11:48
squashable6 joined
11:49
Tirifto joined
11:58
xxpor joined
12:08
hungrydonkey left
12:26
natrys joined
12:29
hungrydonkey joined
12:33
hungrydonkey left
12:34
hungrydonkey joined
12:40
hungryd79 joined,
hungrydonkey left
12:46
Actualeyes left
12:55
hungrydonkey joined
12:58
hungryd79 left,
hungryd13 joined
13:01
hungryd89 joined
13:02
hungrydonkey left
13:05
hungryd13 left,
hungrydonkey joined
13:08
hungryd89 left,
PacoLinux joined,
Actualeyes joined
13:09
mowcat joined
13:14
hungryd1 joined
13:17
hungrydonkey left
13:18
camelCaser left
13:19
yht left
13:20
camelCaser joined
13:22
hungrydonkey joined
13:23
hungryd1 left
13:32
hungryd67 joined
13:35
hungrydonkey left
13:38
yht joined
13:40
hungrydonkey joined
|
|||
Kaiepi | i have a library that's ready for release once v2020.03 gets released that'll be of interest to anyone who likes their code to be strictly typed github.com/Kaiepi/p6-Data-Record | 13:41 | |
can also be used to sanitize data | |||
13:42
hungryd67 left
13:45
hungrydonkey left
|
|||
lizmat | Kaiepi: cool, and funny to see p6 in that repo's name :-) | 13:45 | |
13:46
hungrydonkey joined
|
|||
rypervenche | lizmat: I love seeing your consistency with the name change. :D | 13:54 | |
lizmat | I'm afraid I put that on me, when I suggested the name change :-) | 13:55 | |
Kaiepi | eh, i'll change the prefix i use for raku repos to ra at some point or other | ||
lizmat | * to actually doing the name change | ||
Kaiepi | there are around a dozen i'll have to do and rerelease to cpan | 13:56 | |
MasterDuke | tadzik: ping (in case you've turned off github notifications). github.com/tadzik/Grammar-BNF/pull/15 | 13:57 | |
tadzik | MasterDuke: I have indeed. Thanks :) | 13:58 | |
MasterDuke | tadzik++ | 13:59 | |
tadzik | no, MasterDuke++ :) | ||
rypervenche | It's still very nice to see people pushing and insisting on changes to ultimately have consistency. It's nice to see it taken seriously. :) | 14:04 | |
Kaiepi | wait, when renaming repos, does the old name redirect to the new one? | 14:05 | |
jnthn | Yes | 14:07 | |
nine is glad to have never used a language prefix for his repos :) | |||
Kaiepi | ah, then there's no problem renaming them then | 14:10 | |
14:12
upupbb-user2 left
14:13
sena_kun joined,
hungrydonkey left,
sena_kun left
14:18
hungrydonkey joined
14:24
cpan-raku left,
cpan-raku joined,
cpan-raku left,
cpan-raku joined
14:30
hungryd67 joined,
hungrydonkey left
14:42
aborazmeh left
15:09
pecastro joined
|
|||
Altreus | That blog post from brian d foy says "The reduction operator ... knows what operations to do first" | 15:10 | |
But the assertion doesn't seem relevant to the topic at hand and is not expounded upon | |||
Can anyone explain what he is referring to? | 15:11 | ||
15:11
sena_kun joined
15:12
molaf joined,
molaf left
15:13
sena_kun left
15:14
sena_kun joined
15:15
Tirifto left,
Tirifto joined,
thundergnat joined
|
|||
thundergnat | Altreus, As I understand it he is referring to the associativity of the operator. EG. [**] 2,3,4 is 2**(3**4) not (2**3)**4) | 15:17 | |
m: say [**] 2,3,4; | |||
camelia | 2417851639229258349412352 | ||
Altreus | But that's the same as what reduce does already | 15:18 | |
Is there an example where it's associative the other way? | |||
2 OP (3 OP 4) | |||
Cos he specifically says it doesn't just apply the operator to the first two and replace them with its result, right? | 15:19 | ||
But that's indistinguishable from the ** example | |||
thundergnat | But.. but it _doesn't_ just do the first two and replace them with its result. | 15:20 | |
m: say (2**3)**4; say 2**(3**4); say [**] 2,3,4 | |||
camelia | 4096 2417851639229258349412352 2417851639229258349412352 |
||
thundergnat | It does the _last_ two and replaces them with its value, because ** is right associative | 15:21 | |
15:23
camelCaser left
15:25
camelCaser joined
|
|||
thundergnat | m: say [/] 40,4,5; say (40 / 4 ) / 5; say 40 / ( 4 / 5 ); # division on the other hand is left associative | 15:26 | |
camelia | 2 2 50 |
||
15:29
thundergnat left
|
|||
colomon | Is there a clever zef trick for getting a list of the currently installed modules? | 15:31 | |
(getting modules installed on new version is my primary headache with upgrading raku) | 15:32 | ||
timotimo | yes zef list --installed | ||
15:32
rbt left
|
|||
timotimo | a new rakudo will just™ recompile the modules from source so you shouldn't have to reinstall modules i think? | 15:32 | |
15:32
rbt joined
|
|||
colomon might still be using rakudobrew | 15:35 | ||
timotimo++ | |||
15:39
Doc_Holliwood joined
|
|||
colomon | Inline::Perl5 not installing on 20.2.1? Failed to find dependencies: perl | 15:56 | |
15:58
abraxxa left
16:06
abraxxa joined,
Altai-man_ joined
|
|||
Geth | doc: sztanyi++ created pull request #3282: change perl method to raku method |
16:07 | |
16:09
sena_kun left
16:10
guifa joined
|
|||
guifa | lizmat++ for weekly | 16:10 | |
16:39
hungryd67 left
16:40
yht left
16:57
sauvin left
17:02
sauvin joined
|
|||
guifa | :-( | 17:03 | |
Houston conference just got cancelled | |||
MasterDuke | amsterdam too i think | 17:04 | |
17:08
molaf joined
|
|||
tbrowder | possible project for the Gnome* modules: a configurable Unicode character widget for copy pasting into Raku source code. any interest as a community project? | 17:10 | |
dakkar | like `gucharmap`? | 17:12 | |
17:18
upupbb-user3 joined
17:22
hungrydonkey joined
17:30
hungrydonkey left
17:45
Kaiepi left,
stux|RC left,
stux|RC-only left,
kybr left,
autarch left,
gordonfish left,
daxim left,
dogbert17 left,
dogbert17 joined,
Kaiepi joined,
autarch joined,
daxim joined,
kybr joined
17:46
gordonfish joined
17:47
stux|RC-only joined,
ribasushi left
17:49
ribasushi joined
17:51
stux|RC joined,
dakkar left
|
|||
guifa | MasterDuke: it’s sad, but understandable. I was really looking forward to it though, would have been my first tech conf | 17:51 | |
tbrowder | dakkar: ?, i'll check it...no, not configurable that i can see, but useful anyway, thnx | 17:52 | |
tellable6 | tbrowder, I'll pass your message to dakkar | ||
tbrowder | i want one that i can configure to a limited set of oft-used chars, best in separate tabs to group them | 17:53 | |
anyone using comma? what is expected to be in the "Raku SDK"? | 17:55 | ||
ah, found it "/path/to/my/raku" | 17:57 | ||
18:00
molaf left
18:07
sena_kun joined
18:08
Altai-man_ left
18:10
AlexDani` joined,
AlexDaniel left
18:11
AlexDani` is now known as AlexDaniel,
AlexDaniel left,
AlexDaniel joined
18:14
rindolf left
|
|||
lizmat | guifa: there will be other conferences... | 18:19 | |
guifa | lizmat: of course! And actually, now that I know I have a place to stay at in NL (one of my good friends is working at the university in Utrecht), maybe I could do the AMS one too | 18:21 | |
18:23
sauvin left
18:31
rindolf joined
18:42
daxim left
18:45
wildtrees joined,
kent\n left
18:48
daxim joined
18:49
upupbb-user3 left
|
|||
wildtrees | is there a way I can do postgres transactions with DBIish? or should I be using some other pg database library? | 18:57 | |
18:58
molaf joined
|
|||
moritz | wildtrees: sure, you can execute a "BEGIN WORK" followed by "COMMIT" or "ROLLBACK" statements | 19:00 | |
wildtrees | can I pass in parameters? I can't seem to use prepare , do seems to work a bit though | 19:04 | |
rbt | $db.do(q{BEGIN}); | 19:05 | |
wildtrees, FYI I fixed the array thing. Just waiting for someone to merge it. github.com/raku-community-modules/...h/pull/176 | |||
wildtrees | I had found a workaround using string_to_array and @array.join(',') , rbt, thanks | 19:06 | |
rbt | Postgresql doesn't support prepared queries for transaction control statements (BEGIN/COMMIT, etc.) | ||
wildtrees | so how can I pass in parameters into a transaction and see if it is successful in DBIish? | 19:07 | |
kinda new to all of this, have done a small amount of sql in the past | 19:08 | ||
rbt | You mean things like isolation level? | ||
You need to build the begin statement yourself. 'BEGIN WORK ISOLATION LEVEL %s'.sprintf('SERIALIZABLE'); | |||
wildtrees | whats isolation level | 19:09 | |
rbt | Hmm What did you mean by "parameters into a transaction" | ||
wildtrees | I want to basically update two different array columns in two different rows either all together or not at all , as an atomic change | ||
rbt | Okay. | ||
wildtrees | so I build the query string myself and pass it to $dbh.do($query) ? | 19:10 | |
rbt | Each statement needs to be it's own string. | ||
So do(q{BEGIN}); | |||
Then $sth = $db.prepare(q{UPDATE ... SET foo = $1}); $sth.execute($param); | |||
Then do(q{COMMIT}); | 19:11 | ||
Erm, I suppose if you want to be fancy you can also use Common Table Expressions for the same thing in a single statement; but that's fairly advanced SQL. | 19:12 | ||
wildtrees | so like do BEGIN, $h1 = prepare($statement1) ; $h.execute ; $h2 = prepare($statement2) ; h2.execute ; do COMMIT (in pseudocode) ? | ||
rbt | Yes. | ||
wildtrees | how do I know if the transaction is successful or not? | 19:13 | |
rbt | CATCH {} | ||
The Pg driver throws very nice exceptions. | 19:14 | ||
wildtrees | rbt, where can I read about the possible errors thrown by the Pg driver? | 19:15 | |
rbt | "Statement Exceptions" github.com/raku-community-modules/DBIish | 19:16 | |
Database level errors are converted into Raku exceptions. | 19:17 | ||
PostgreSQL error classes are documented here: www.postgresql.org/docs/10/errcode...endix.html | |||
19:24
abraxxa left
|
|||
wildtrees | so if I do something like this do BEGIN ; select $1 <> $2 ; some insert ; do Commit ; why does the insert go through even when $1 = $2? how do I condition a transaction? thought the select <> returns false so it will cause the transaction to fail/abort | 19:33 | |
sena_kun | wildtrees, are you asking from DBIish perspective or sql perspective? | 19:35 | |
wildtrees | well I am doing it from dbiISH, but I guess it's more of a pg-sql question, | 19:36 | |
sena_kun | I am not a dbiish pro, but if you're doing a select and then an insert, there is no condition between them. You might want to explicitly `do` (or prepare/execute, whatever) some postgres query with a conditiona insertion, and examples of those are easy to look up | 19:37 | |
*conditional | 19:39 | ||
19:42
kent\n joined
|
|||
rbt | wildtrees, `SELECT $1 <> $2` is not an assertion. It simply returns false. | 19:50 | |
Or true | |||
wildtrees | should I just do the check for raku for now? | ||
Grinnz | sql does not condition transactions. that's up to your program logic | ||
wildtrees | do the check in raku for now | 19:51 | |
rbt | yes. | ||
wildtrees is starting to see the pieces slowly coming together | |||
rbt | Generally you want to do most of the basic checks first before starting to work with the database. | ||
Grinnz | i don't know what DBIish provides, but generally, transaction helpers in code work like: you start a transaction in a scope, if you leave the scope with an exception or otherwise early, it rolls back, otherwise it commits | 19:52 | |
so structuring your code to work like that has the best chance of being useful | 19:53 | ||
wildtrees | just had a type mismatch in a transaction (just test code don't need the actual transaction for now) and it seems to hang the transaction block for further requests | 19:59 | |
rbt | Yep. You need to CATCH exceptions and cleanup state. | 20:04 | |
20:06
Altai-man_ joined
|
|||
Grinnz | your code will need to call either commit or rollback at some point | 20:07 | |
always | |||
rbt | sub write($a, $b) { | ||
# Pre-write tests | |||
die('A must be larger than B') unless $a > $b; | |||
try { | |||
$db.do: q{BEGIN}; | |||
my $sth = $db.prepare: q{INSERT INTO ...}; | |||
$sth.execute($a); | |||
$sth.execute($b); | |||
$db.do: q{COMMIT}; | |||
CATCH { | 20:08 | ||
default { | |||
# log? | |||
$db.do: q{ROLLBACK}; | |||
} | |||
} | |||
} | |||
write($a, $b); | |||
You'll end up with something like that. | |||
20:08
sena_kun left
|
|||
Grinnz | ideally you'd also have it rollback if someone leaves the block without reaching COMMIT, but you can also just avoid doing that | 20:08 | |
rbt | And retry loops for serialization, network, and other temporary errors ... | 20:13 | |
vrurg | Can't change a github repo status in travis-ci. Can anybody check if this is my local problem or it's something global? | 20:21 | |
20:24
AlexDaniel left
20:28
PacoLinux left
|
|||
cpan-raku | New module released to CPAN! Termbox (0.0.2) by 03JJATRIA | 20:31 | |
20:48
Kaiepi left
|
|||
cpan-raku | New module released to CPAN! Termbox (0.0.3) by 03JJATRIA | 21:02 | |
21:09
pilne joined
21:34
chloekek left
21:36
Kaiepi joined
21:42
Actualeyes left
21:59
mowcat left
22:00
Manifest0 left
|
|||
tbrowder | what is the raku version of perl's do block (do {})? | 22:01 | |
i'm guessing "=> {}" | 22:02 | ||
Altai-man_ | tbrowder, what's the semantics? | ||
tellable6 | 2020-03-22T18:25:50Z #raku-dev <AlexDaniel> Altai-man_ btw you can use #whateverable channel to abuse the bots | ||
2020-03-22T18:26:16Z #raku-dev <AlexDaniel> Altai-man_ you don't seem to do it often but maybe that's because you don't want to spam on main channels :) | |||
Altai-man_ | tbrowder, I think just `{}` is enough, no? | 22:04 | |
tbrowder | the do block "returns value of last command in the block" | ||
Altai-man_ | m: my $a = { 1; 2; 42; }; say $a; | ||
camelia | WARNINGS for <tmp>: -> ;; $_? is raw = OUTER::<$_?> { #`(Block|84735176) ... } Useless use of constant integer 2 in sink context (line 1) Useless use of constant integer 1 in sink context (line 1) |
||
Altai-man_ | m: my $a = { say 1; say 2; 42; }; say $a; | ||
camelia | -> ;; $_? is raw = OUTER::<$_?> { #`(Block|65343328) ... } | ||
tbrowder | i'll try it...thnx | 22:05 | |
22:05
Manifest0 joined,
sena_kun joined
|
|||
tbrowder | m: say {23} | 22:05 | |
camelia | -> ;; $_? is raw = OUTER::<$_?> { #`(Block|54582040) ... } | ||
tbrowder | say "{23; 1}" | 22:06 | |
evalable6 | WARNINGS for /tmp/DhJbIVEIyj: 1 Useless use of constant integer 23 in sink context (line 1) |
||
sena_kun | m: say do { say 42; 5000 }; | 22:07 | |
camelia | 42 5000 |
||
22:09
Altai-man_ left
|
|||
tbrowder | m: my $a = do {1;2}; say $a | 22:09 | |
camelia | WARNINGS for <tmp>: 2 Useless use of constant integer 1 in sink context (line 1) |
||
22:10
rindolf left
|
|||
tbrowder | m: my $a = sub {1;2}; say $a | 22:13 | |
camelia | WARNINGS for <tmp>: sub { } Useless use of constant integer 1 in sink context (line 1) |
||
22:14
Kaiepi left
|
|||
tbrowder | m: my $a = => { 1,2}; say $a | 22:14 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Preceding context expects a term, but found infix => instead. at <tmp>:1 ------> 3my $a = =>7⏏5 { 1,2}; say $a |
||
tbrowder | m: sub f(){1;2}; f | 22:15 | |
camelia | WARNINGS for <tmp>: Useless use of constant integer 1 in sink context (line 1) |
||
22:16
caterfxo joined
|
|||
tbrowder | m: sub f(){1;2}; say f | 22:16 | |
camelia | WARNINGS for <tmp>: 2 Useless use of constant integer 1 in sink context (line 1) |
||
vrurg | m: say do { 1; 2; 42 } | 22:17 | |
camelia | WARNINGS for <tmp>: 42 Useless use of constant integer 1 in sink context (line 1) Useless use of constant integer 2 in sink context (line 1) |
||
vrurg | m: say do { say 1; say 2; 42 } | 22:18 | |
camelia | 1 2 42 |
||
lizmat | weekly: O'Reilly stopping *all* conference events permanently: www.oreilly.com/conferences/from-l...ldwin.html | ||
notable6 | lizmat, Noted! (weekly) | ||
tbrowder | looks to me like the p5 do block is some kind of inline function (lamda?) | ||
vrurg | tbrowder: not sure. It's just invoking a block. | 22:19 | |
perl5 has only anonymous subs, if I still remember it right. | |||
Grinnz | do BLOCK just allows you to place a block in expression context | 22:21 | |
tbrowder | but the p5 code i'm looking at...i'll gist it in a few minutes | ||
Grinnz | (in perl) | ||
22:21
wamba left
|
|||
Grinnz | it's not a loop and can't be returned from | 22:22 | |
just returns the last expression | |||
tbrowder | the raku do "creates a supply..." | ||
so are you saying our bare block should be the same? sounds right as sena_kun said, too, but why can't we assign it to a var? | 22:25 | ||
tobs | tbrowder: that can't be true. Maybe you're confusing the do BLOCK syntax with the do method on a Supply? | ||
vrurg | tbrowder: why can't? | ||
m: my &f = { say $_ }; f(pi) | 22:26 | ||
camelia | 3.141592653589793 | ||
tbrowder | well i don't see the do block in our docs | ||
vrurg | tbrowder: ^ this? | ||
tobs | tbrowder: docs.raku.org/language/control#ind...flow_do-do | ||
Grinnz | nope, that's a sub | ||
vrurg | tbrowder: docs.perl6.wakelift.de/language/con...flow_do-do | 22:27 | |
Grinnz: what is a sub? | |||
m: my $a = { say $_ }; $a(42) | 22:28 | ||
camelia | 42 | ||
tbrowder | ok, i couldn't find that in the search box, thnx | ||
Grinnz | you're storing code to execute, rather than just immediately running a block and returning the result as perl's do BLOCK does | ||
vrurg | tbrowder: type 'do' and around the middle of the suggestions list you'll see control flow do | 22:29 | |
Grinnz: Look at my earlier example. | |||
Grinnz | yeah that looks more like it | ||
vrurg | Grinnz: I was answering tbrowder question about assigning a block to a variable. | ||
tbrowder | i was lead astray by the nutshell docs about using repeat instead of do :-D | 22:30 | |
22:30
devmikey joined
22:31
devmikey left,
devmikey joined
|
|||
tobs | oh yeah, that usage of do seems to have been disambiguated from Perl to Raku. Apparently do in Raku can never be made to loop. | 22:31 | |
tbrowder | ok, thanks much folks! | 22:32 | |
Grinnz | do BLOCK while ... is a strange special case in perl anyway, mostly meant to emulate C | ||
22:33
Kaiepi joined,
Kaiepi left,
Kaiepi joined
22:35
Tirifto left
22:37
PacoLinux joined
22:42
natrys left
22:43
sena_kun left
22:51
Doc_Holliwood left
22:55
natrys joined
22:58
natrys left
23:08
Xliff joined
|
|||
Xliff | . | 23:09 | |
23:16
lizmat left
23:27
Kaeipi joined,
Kaiepi left
23:29
Kaiepei joined
23:31
Kaiepi joined,
Kaeipi left
23:34
Kaiepei left
23:40
pecastro left
|
|||
tony-o | . | 23:43 | |
23:46
xelxebar left
|
|||
tony-o | .tell tbrowder did you express wanting to help test zeco? | 23:47 | |
tellable6 | tony-o, I'll pass your message to tbrowder | ||
23:52
upupbb-user3 joined
23:53
Kaeipi joined,
AlexDaniel joined,
AlexDaniel left,
AlexDaniel joined
23:56
Kaiepi left,
Kaiepei joined
|
|||
wildtrees | m: say {say 1; 2}() ; | 23:57 | |
camelia | 1 2 |
||
23:57
Kaeipi left
|