Newest at the top
2024-11-08 19:13:38 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-11-08 19:09:19 +0100 | xdminsy | (~xdminsy@117.147.71.147) (Read error: Connection reset by peer) |
2024-11-08 19:08:44 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-11-08 19:08:23 +0100 | chele | (~chele@user/chele) (Remote host closed the connection) |
2024-11-08 19:08:20 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) (Quit: sord937) |
2024-11-08 19:08:06 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) Unicorn_Princess |
2024-11-08 19:04:19 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-11-08 18:57:53 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 255 seconds) |
2024-11-08 18:54:05 +0100 | misterfish | (~misterfis@84.53.85.146) misterfish |
2024-11-08 18:53:30 +0100 | longlongdouble | (~longlongd@2405:201:5c16:135:1989:242:cab1:419a) |
2024-11-08 18:52:56 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-11-08 18:52:22 +0100 | <haskellbridge> | <magic_rb> mauke i kind of get what youre saying. But ill have to bang my head against it some more to actually make sense of it |
2024-11-08 18:50:44 +0100 | longlongdouble | (~longlongd@2405:201:5c16:135:1989:242:cab1:419a) (Remote host closed the connection) |
2024-11-08 18:48:34 +0100 | shapr | (~user@4.30.215.226) shapr |
2024-11-08 18:47:14 +0100 | Sgeo | (~Sgeo@user/sgeo) Sgeo |
2024-11-08 18:45:35 +0100 | <EvanR> | *parsing made easy* xD |
2024-11-08 18:43:01 +0100 | <mauke> | (I hope at least some of this made some sense) |
2024-11-08 18:42:59 +0100 | econo_ | (uid147250@id-147250.tinside.irccloud.com) |
2024-11-08 18:42:09 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) (Ping timeout: 248 seconds) |
2024-11-08 18:41:21 +0100 | <mauke> | (two expr3 at the start because after seeing "+", expr3 calls itself) |
2024-11-08 18:41:06 +0100 | <mauke> | for the final "2", we basically do the same thing again: expr3 -> expr3 -> expr2 -> expr1 -> expr0 -> term |
2024-11-08 18:40:19 +0100 | <mauke> | which only succeeds at the top level, with expr3 -> op "+", because the next symbol is a "+" |
2024-11-08 18:40:12 +0100 | acidjnk | (~acidjnk@p200300d6e7283f5628026389afde3b8f.dip0.t-ipconnect.de) acidjnk |
2024-11-08 18:39:52 +0100 | <mauke> | so when 'between' consumes ")", we return back up the expr hierarchy and try all the possible operators on the way up |
2024-11-08 18:39:08 +0100 | <mauke> | after "3": expr3 -> expr2 -> expr1 -> expr0 -> between |
2024-11-08 18:38:07 +0100 | <mauke> | btw, call stack at the point where we consume "3": expr3 -> expr2 -> expr1 -> expr0 -> between -> expr3 -> expr3 -> expr2 -> expr1 -> expr0 -> term |
2024-11-08 18:38:05 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-11-08 18:37:42 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) wootehfoot |
2024-11-08 18:37:10 +0100 | merijn | (~merijn@128-137-045-062.dynamic.caiway.nl) merijn |
2024-11-08 18:36:48 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Max SendQ exceeded) |
2024-11-08 18:36:47 +0100 | <mauke> | which does consume ")" |
2024-11-08 18:36:34 +0100 | <mauke> | on the way back up, no operator parser succeeds in consuming ")", so expr3 returns back into 'between' |
2024-11-08 18:36:13 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) wootehfoot |
2024-11-08 18:35:47 +0100 | <mauke> | which adds another round of expr3 -> expr2 -> expr1 -> expr0 -> term, where we consume 3 |
2024-11-08 18:35:34 +0100 | briandaed | (~root@185.234.210.211) |
2024-11-08 18:35:20 +0100 | <mauke> | then expr3 calls itself (because for simplicity, all of my operators are right associative) |
2024-11-08 18:34:42 +0100 | <mauke> | then we return all the way back up the hierarchy, trying all operators in turn (and failing), until we arrive at expr3 again and op "+" succeeds |
2024-11-08 18:34:01 +0100 | <EvanR> | so basically, try "(" term ")" last |
2024-11-08 18:34:00 +0100 | <mauke> | which presumably successfully consumes 4 |
2024-11-08 18:33:53 +0100 | <mauke> | the inner instance of expr3 climbs down the hierarchy again, but this time there is no "(" to be consumed, so expr0 tries term |
2024-11-08 18:33:11 +0100 | <mauke> | then we try expr3 again. (current call stack: expr3 -> expr2 -> expr1 -> expr0 -> between -> expr3) |
2024-11-08 18:32:26 +0100 | <mauke> | then we immediately climb down the hierarchy to expr0, which consumes the leading "(" |
2024-11-08 18:31:27 +0100 | <mauke> | we start in expr3 (the top level) |
2024-11-08 18:31:07 +0100 | <mauke> | no, that would work fine |
2024-11-08 18:30:53 +0100 | <haskellbridge> | <sm> You are worthy opponent, parser combinators, but they shall return ✊ |
2024-11-08 18:30:37 +0100 | <haskellbridge> | <magic_rb> wouldnt that mean you cant have "(4 + 3) + 2"? |
2024-11-08 18:30:08 +0100 | <mauke> | the traditional way to do rec-descent infix expressions is to have a hierarchy of expression parsers. like expr3 = do { expr2; op "+"; expr3 }; expr2 = do { expr1; op "*"; expr 2 }; expr1 = do { expr0; op "**"; expr1 } expr0 = between "(" ")" expr3 <|> term |
2024-11-08 18:30:05 +0100 | <haskellbridge> | <magic_rb> i think im done for now 😂, thanks again |
2024-11-08 18:29:49 +0100 | <haskellbridge> | <magic_rb> tom asked me what bound tighter and my brains response was "uh, && before || yes" |
2024-11-08 18:29:37 +0100 | <haskellbridge> | <sm> 👍 |