🦋 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.
00:02 wingfold left 00:06 wingfold joined 00:08 indathrone joined 00:15 indathrone left 00:16 tejr left 00:18 tejr joined 00:25 simcop2387 left 00:29 clarjon_1 joined 00:32 clarjon1 left 00:38 clarjon_1 left 00:47 abraxxa left 00:51 abraxxa joined 00:55 HarmtH left 00:59 indathrone joined 01:19 wingfold left, wingfold joined 01:20 guifa2 joined 01:21 HarmtH joined 01:22 wingfold_ joined, wingfold left 01:24 wingfold_ left, wingfold joined, kleb joined 01:25 wingfold left 01:26 wingfold joined, simcop2387 joined 01:27 wingfold left 01:28 wingfold joined
kleb howdy folks! I am writing a simple parser to port a function from one language to another -- basically what I want is for the parsing script to convert the whole signature from c++ to rust, writing a TODO at the top of the commented body.  The entire thing is almost working except for one thing: I am having trouble figuring out how to write a 01:28
grammar rule for "the entire function body, including surrounding curly braces"
I would like to be able to write something like: ```raku
rule bracketed-function-body { '{' <function-body> '}' }
rule function-body { .* } 01:29
or something like that
01:30 wingfold left, wingfold joined
kleb i can control the input text such that i can guarantee exactly one function and body is the program input 01:30
01:31 wingfold_ joined, wingfold left
kleb when i do that, the rule for "function-body" looks like it is starting to work, but with Grammar::Tracer I can see it stop short, for apparently no reason 01:33
01:33 wingfold_ left, wingfold joined
kleb does anybody know why these grammar rules are incorrectly parsing? thanks in advance for any help 01:35
01:35 wingfold left 01:36 wingfold joined 01:41 wingfold left, wingfold joined 01:42 wingfold_ joined, wingfold left 01:43 wingfold joined, wingfold_ left 01:48 wingfold_ joined, wingfold left
kleb nevermind! I am going to manually split it up with simple searching and string splitting as a preliminary step 01:52
01:52 kleb left 01:57 webstrand left 02:03 sno joined 02:08 kvw_5 joined 02:11 kvw_5_ left 02:13 juststanger joined 02:14 juststanger left 02:31 wingfold_ left, wingfold joined 02:36 wingfold left 02:50 wingfold joined 02:51 neshpion left 02:54 Doc_Holliwood left, wingfold left 02:56 tejr_ joined, tejr left, tejr_ is now known as tejr 03:06 wingfold joined 03:12 wingfold_ joined, wingfold left 03:16 wingfold_ left 03:28 wingfold joined 03:29 wingfold_ joined, wingfold left 03:31 gugod left 03:34 wingfold_ left 03:47 wingfold joined 03:57 guifa2 left 04:32 guifa2 joined 05:14 wamba joined 05:19 Xliff joined 05:25 Petya joined 05:27 wingfold left 05:31 aindilis joined 05:34 wamba left, wamba joined 05:40 wingfold joined 05:53 parabolize left 06:05 wamba left, wamba1 joined 06:07 Sgeo left 06:11 softmoth left 06:12 jmerelo joined 06:14 Petya left 06:31 Doc_Holliwood joined
jmerelo m: dd % (1,2,3,4) 06:32
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3dd %7⏏5 (1,2,3,4)
expecting any of:
infix
infix stopper
postfix
statement end
statement modifier…
jmerelo m: dd % .new(1,2,3,4) 06:33
camelia Hash element = {"1" => 2, "3" => 4}
jmerelo m: dd $ .new(1,2,3,4)
camelia Default constructor for 'Any' only takes named arguments
in block <unit> at <tmp> line 1
jmerelo m: dd .new(1,2,3,4) 06:34
camelia Default constructor for 'Any' only takes named arguments
in block <unit> at <tmp> line 1
jmerelo m: dd + .new(1,2,3,4)
camelia Default constructor for 'Any' only takes named arguments
in block <unit> at <tmp> line 1
06:47 wamba joined, wamba1 left
jmerelo m: say |(1,2,$(3,4)) 06:47
camelia 12(3 4)
jmerelo m: say |(1,2,my $ = (3,4))) 06:53
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> 3say |(1,2,my $ = (3,4))7⏏5)
jmerelo m: say |(1,2,my $ = (3,4))
camelia 12(3 4)
07:03 wamba left 07:09 ufobat_ joined 07:18 wamba joined 07:25 guifa2 left 07:32 wingfold_ joined, wingfold left 07:36 wingfold_ left 07:38 domidumont joined 07:51 wingfold joined 07:58 HarmtH_ joined 07:59 HarmtH left 08:08 pecastro joined
jmerelo We're preparing a proposal for Google's season of docs: perl-foundation-outreach.github.io...ocs-ideas/ Contribute by joining as a mentor, or with new ideas 08:26
08:27 Manifest0 left 08:28 Manifest0 joined 08:31 abraxxa left 08:32 abraxxa joined 08:36 abraxxa left 08:37 abraxxa joined 08:43 wamba left, Xliff left 08:49 domidumont left 08:50 dakkar joined 08:53 sena_kun left 08:57 wingfold left, wingfold joined 09:00 frost-lab joined 09:01 wingfold left 09:03 sena_kun joined, dakkar left 09:04 dakkar joined 09:15 wingfold joined 09:19 wingfold_ joined, wingfold left 09:24 wingfold_ left, imcsk8 left 09:26 imcsk8 joined 09:36 wingfold joined 09:56 cog left 10:00 lizmat joined 10:10 wamba joined 10:19 wingfold_ joined, wingfold left 10:24 wingfold_ left
lizmat clickbaits rakudoweekly.blog/2021/03/22/2021-...mes-begin/ 10:32
10:35 wingfold joined 10:37 wingfold_ joined, wingfold left 10:41 Kaiepi left, wingfold_ left 10:51 squashable6 left 10:52 squashable6 joined, squashable6 left 10:53 squashable6 joined 10:55 wingfold joined, domidumont joined 11:01 wingfold_ joined, wingfold left 11:06 wingfold_ left 11:19 wingfold joined 11:25 Kaiepi joined 11:33 avarab left 11:34 avar joined 11:35 Kaiepi left, frost-lab left 11:37 Kaiepi joined 11:45 rindolf joined 11:50 xinming left 11:51 maggotbrain left 11:53 xinming joined 12:06 wingfold left 12:18 wingfold joined 12:22 wingfold left 12:35 wingfold joined 12:39 wamba left 12:41 Doc_Holliwould joined 12:45 Doc_Holliwood left 12:46 wamba joined 12:54 _jrjsmrtn left, __jrjsmrtn__ joined 13:01 dakkar left 13:03 dakkar joined 13:22 mowcat joined 13:27 tyilanmenyn is now known as tyil
MasterDuke finally got around to watching the fosdem videos, all very good 13:40
13:51 Doc_Holliwould left 13:58 jmerelo left 14:14 Black_Ribbon left 14:25 wingfold left 14:26 wingfold joined 14:27 Sgeo joined 14:30 Doc_Holliwould joined 14:35 Doc_Holliwould left 14:50 simcop2387_ left 14:54 wamba left, parabolize joined 15:01 softmoth joined 15:18 wamba joined 15:34 rba left, rba joined, DiffieHellman left 15:35 patrickbkr[m] left, unclechu left, AlexDaniel` left, DiffieHellman joined 15:36 uzl[m] left 15:37 Nasrudin left, guifa2 joined, broquaint left, tusooa left, CIAvash left, broquaint joined, [ptc]_ left 15:38 [ptc] joined, pwr22 left, nine left, kiti_nomad[m] left, Tirifto[m] left, JJAtria[m] left, l-as left, avar left, juanfra__ left, ThaEwat left, nine joined, avar joined 15:39 judd7 left, kvw_5_ joined, lizmat left 15:41 mowcat left, judd7 joined 15:42 kvw_5 left, kvw_5_ left 15:43 wingfold left, wingfold joined 15:44 kvw_5 joined 15:48 kvw_5 left 15:49 kvw_5 joined 15:50 AlexDaniel` joined 15:54 patrickbkr[m] joined 15:58 uzl[m] joined 16:04 unclechu joined 16:05 Nasrudin joined 16:07 CIAvash joined 16:16 tusooa joined 16:19 kiti_nomad[m] joined, Tirifto[m] joined 16:20 l-as joined 16:21 JJAtria[m] joined 16:23 pwr22 joined 16:24 juanfra__ joined 16:26 ThaEwat joined 16:40 webstrand joined 16:41 xinming left 16:42 Kaiepi left 16:43 Kaiepi joined 16:49 simcop2387_ joined 16:54 jmerelo joined
summerisle is there a default IO::Handle for STDOUT/STDIN available? 17:10
i recall seeing it somewhere but i can't find it in the docs
also thanks raydiak++ for reporting that
codesections m: dd $*OUT
camelia Handle element = IO::Handle.new(path => IO::Special.new("<STDOUT>"), chomp => Bool::True, nl-in => $["\n", "\r\n"], nl-out => "\n", encoding => "utf8")
tellable6 2021-03-22T02:28:08Z #raku-dev <tbrowder> codesections new release of Math::FractionalPart has routine as discussed...comments welcome, never too late for changes prior to v1. 17:11
summerisle ah
17:11 clarjon1 joined
summerisle for some reason i was thinking $*STDOUT 17:11
codesections yeah, I could see it being either, honestly 17:12
The variables page in the docs site has a full list
(which I end up checking often :D) 17:13
summerisle same 17:18
17:19 MasterDuke left
guifa2 me: "0 .. $foo". me: "oops, that's one too many, make it 0 .. $foo - 1". Comma: NO, you can rewrite $foo - 1. Me: "Okay, fine, 0 ..^ $foo". Comma: NO, you can rewrite 0..^$foo). Me: .... 17:21
codesections it really wants ^$foo, I guess? Seems a bit prescriptive 17:23
speaking of things I keep needing to look up, I can never seem to keep the names of &squish and :squash straight in my head 17:33
raydiak summerisle: np, it was a fun little bug hunt. the real credit goes to vrurg++ for the swift patch 17:34
summerisle absolutely
moon-child I've never been able to handle development tools that critique my code as I type 17:37
syntax highlighting, yes; compilation warnings, yes; but that sort of thing would drive me insane
codesections moon-child: I've used them, and they don't drive me insane. But I've moved away from them -- imo, people underestimate how distracting popups like that are/overestimate how much they can multitask 17:40
17:40 dakkar left
codesections says hypocritically, as he splits attention between coding and IRC 17:40
moon-child popups, yeah. I've also tried to use autocomplete, but am generally unable to use it usefully 17:41
nice at the shell prompt, but it's very easy to predict what's going to happen there
codesections agreed
17:41 domidumont left
raydiak I can be a bit stuck in my ways, but those things feel to me like a mountain bike with training wheels... 17:42
moon-child It's--I feel like autocompletion has a lot of potential. Maybe if languages like hazel become mainstream it'll be better
codesections I'm not familiar with that one
moon-child it uses a structured editor with typed holes
17:43 patrickb joined, simcop2387_ left
moon-child so, you edit essentially the ast 17:43
codesections Ah. So the file is _never_ in an invalid state, right? I must have heard of that and just forgotten the name
guifa2 codesections: It just does a little underline letting me know that. There's options to clean up code, but in this case, it *was* absolutely right. ^$foo was much clearer in the context 17:44
moon-child meaning that in a context like 'x + y', you specify the '+' first, and then it already knows that x and y have to be arithmetic
codesections (or there's something else with same idea)
moon-child you might be thinking of paredit?
codesections no, I was thinking of a language – I wouldn't mix that up with paredit, since I use that every day! 17:45
(well, smartparens, but still)
moon-child ah, huh. I don't know then 17:46
codesections yeah, it must have been Hazel and the name didn't stick. The phrase 'typed holes' rings some bells, and hazel seems to be the only language that comes up when I search that term 17:48
18:00 simcop2387_ joined 18:10 wamba left 18:22 lizmat joined 18:34 aluaces left 18:44 vrurg left 18:51 jmerelo left, ufobat_ left 18:58 wingfold left 18:59 wingfold joined, aluaces joined 19:02 vrurg joined, softmoth_ joined 19:04 wingfold left, softmoth left 19:06 vrurg left 19:15 wingfold joined 19:17 wamba joined 19:20 wingfold left 19:24 HarmtH_ left 19:27 guifa2 left 19:29 brown121407 left 19:33 wingfold joined 19:35 HarmtH joined 19:37 wingfold left 19:43 HarmtH left, HarmtH_ joined 19:51 wingfold joined 19:53 wingfold_ joined, wingfold left 19:54 HarmtH_ left, HarmtH joined
japhb moon-child: Years ago when I took a course in Android dev (without bothering to get really good at Java first), I discovered that the autocomplete was so good -- and ancient Java so incredibly redundant -- that quite literally about half of the source code had been generated by the autocomplete. I would type a couple characters, try the autocomplete, and blam, almost always worked. 19:55
19:57 wingfold_ left
moon-child that's horrifying 19:58
20:09 wingfold joined, wingfold_ joined, wingfold left 20:12 mowcat joined 20:14 wingfold joined, wingfold_ left 20:18 wingfold left 20:27 guifa2 joined 20:31 wingfold joined 20:34 softmoth_ left 20:35 softmoth_ joined 20:36 vrurg joined 20:39 softmoth_ is now known as softmoth 20:52 wamba left 21:02 indathrone left 21:06 wingfold left, vrurg left, wingfold joined, vrurg joined 21:09 patrickb left 21:10 wingfold left 21:12 MasterDuke joined 21:23 wingfold joined 21:27 wingfold left 21:29 nebuchadnezzar left 21:30 nebuchadnezzar joined
codesections m: Int.?abs 21:40
camelia Invocant of method 'abs' must be an object instance of type 'Int', not
a type object of type 'Int'. Did you forget a '.new'?
in block <unit> at <tmp> line 1
21:40 wingfold joined
codesections should the `.?` operator prevent that error, or am I misunderstanding how it's supposed to work? 21:41
(I ran into that trying to look up an attribute in a custom type that could be either an instance or a type object, and thought `.?` would save me) 21:42
21:44 rindolf left
codesections ((Also, Johnathan's recent post was the first time I'd heard the name "the call me, maybe" operator for `.?`. I'm not sure who came up with that, but they deserve a medal :D)) 21:44
21:45 wingfold left 21:46 vrurg left 21:50 HarmtH left 21:51 HarmtH joined
moon-child codesections: .? saves you from a method whose name isn't present, like 21:53
m: 5.?lsdkjfl
camelia ( no output )
moon-child (personally, I think that's a lot less useful than what you wanted it to be, but ¯\_(ツ)_/¯)
21:53 wingfold joined 21:54 berber44 joined
codesections yeah, I get that, but isn't the .abs method "not present" on Int:U? 21:54
sure, it's present on Int:D, but...
japhb moon-child: It's useful for chaining: $obj.foo.?bar.?baz.?quux 21:55
If the return from $obj.foo might be a usable object or might be a Failure or Nil or somesuch.
moon-child codesections: it's a multi method
japhb: that doesn't really help, though 21:56
m: Nil.?abs
camelia Use of Nil in numeric context
in block <unit> at <tmp> line 1
japhb Or alternately if the return from $obj.foo might be one of two different types, only one of which can handle the chain of following method calls.
codesections I mean, I get that. But we could have it throw the right sort of error to be caught by `.?`, rigth? 21:57
21:57 wingfold_ joined, wingfold left
codesections I guess I'm asking if there's a design reason to _not_ have .? catch :D methods on :U types, or if it's just a nice-to-have feature that no one has gotten around to adding yet 21:58
ugexe eh anytime i try to chain with .? it ended up backfiring
japhb moon-child: I'm guessing that's a matter of "too many things are Cool". :-( 21:59
21:59 wingfold_ left, wingfold joined
japhb ugexe: I've used it productively, but I don't use it that often. 21:59
moon-child japhb: wh-oh--why is Nil Cool?
moon-child personally doesn't think that Nil is particularly cool 22:00
ugexe m: say Int.?foo.?Int
camelia Use of Nil in numeric context
0
in block <unit> at <tmp> line 1
japhb moon-child: I don't know the answer to that. I dunno if there's a reason or an accident of history there. 22:01
22:04 wingfold left 22:05 wingfold joined 22:06 wingfold left, wingfold joined, vrurg joined 22:11 vrurg left 22:26 HarmtH left 22:27 HarmtH joined 22:30 dogbert11 joined 22:31 dogbert12 joined, dogbert12 left 22:32 dogbert12 joined 22:34 dogbert17 left 22:35 daxim left, dogbert11 left 22:43 daxim joined 22:54 b2gills left 23:00 HarmtH left 23:02 HarmtH joined 23:05 b2gills joined 23:07 gordonfish- joined 23:08 gordonfish- left, gordonfish- joined, gordonfish left, gordonfish- is now known as gordonfish 23:18 bigdata joined 23:24 HarmtH_ joined, maggotbrain joined 23:25 HarmtH left 23:42 wingfold left, wingfold joined 23:43 guifa2 left 23:47 wingfold left 23:59 wingfold joined