00:21:51 | * | amadaluzia quit (Quit: ZNC 1.10.0 - https://znc.in) |
00:29:42 | FromDiscord | <bxiwbbd> sent a code paste, see https://play.nim-lang.org/#pasty=HDuQigNS |
00:50:18 | * | xet7 joined #nim |
01:18:36 | * | rockcavera joined #nim |
01:20:50 | FromDiscord | <janakali> @bxiwbbd first one is range[int] type, second is slice object |
01:30:13 | FromDiscord | <bxiwbbd> Why doesn't it treat the first one as a slice? |
01:31:31 | FromDiscord | <demotomohiro> In reply to @bxiwbbd "Why is this happening?": https://nim-lang.org/docs/system.html#typeof%2Cuntyped↵https://nim-lang.org/docs/system.html#TypeOfMode↵https://nim-lang.org/docs/system.html#...i%2Cint64%2Cint64↵In default, `typeof` pefers iterator call than proc call. So `1..2` is interpreted as an iterator. |
01:35:22 | FromDiscord | <bxiwbbd> So it is because of `mode = typeOfIter` |
01:36:19 | FromDiscord | <bxiwbbd> (edit) |
01:39:23 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
01:42:00 | FromDiscord | <bxiwbbd> sent a code paste, see https://play.nim-lang.org/#pasty=eWtRfZbw |
01:42:04 | FromDiscord | <janakali> Well, that's confusing. Does`typeof` need a mode switch? |
01:42:34 | FromDiscord | <bxiwbbd> (edit) "https://play.nim-lang.org/#pasty=hOHwMXaA" => "https://play.nim-lang.org/#pasty=oqeFEyPB" |
01:42:35 | FromDiscord | <janakali> isn't it better to have `typeof` and `typeofIter` |
01:42:57 | FromDiscord | <bxiwbbd> Yes that's default |
01:43:38 | FromDiscord | <bxiwbbd> I was just messing around and found this behaviour |
02:03:52 | FromDiscord | <janakali> One more question: why `typeof` defaults to `typeOfIter`?↵I'd expect the ambiguous expression to be a procedure.↵What is the benefit? |
02:04:29 | FromDiscord | <janakali> I've found the commit that seemingly introduced this behaviour: https://github.com/nim-lang/Nim/commit/da6046dcba20cb4aaff1e5712ac7a33a3c4e8445 |
02:06:12 | FromDiscord | <janakali> sent a long message, see https://pasty.ee/rxPnCqvE |
02:06:22 | FromDiscord | <janakali> (edit) "https://pasty.ee/vYknLXEH" => "https://pasty.ee/NSglDnjc" |
02:06:40 | FromDiscord | <janakali> (edit) "sent a long message, see https://pasty.ee/evkiIdgP" => "> bugfix: overloading resolution for typeof↵↵> little hack so that iterators are preferred over everything else:" |
02:06:58 | FromDiscord | <janakali> (edit) ">" => "but this doesn't tell me much:↵>" | "typeof↵↵>" => "typeof↵>" |
02:20:39 | FromDiscord | <bxiwbbd> sent a code paste, see https://play.nim-lang.org/#pasty=XIeYMNMA |
02:21:40 | FromDiscord | <bxiwbbd> I would naturally expect it to echo string |
02:24:46 | FromDiscord | <janakali> sent a code paste, see https://play.nim-lang.org/#pasty=xHdvaZXY |
02:27:26 | FromDiscord | <bxiwbbd> Even the example is so similar `1..2` 😂 |
02:39:57 | * | xet7 quit (Remote host closed the connection) |
02:45:52 | FromDiscord | <demotomohiro> In reply to @janakali "A-ha! It's not a": It is probably because: https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax |
02:46:01 | FromDiscord | <bxiwbbd> sent a code paste, see https://play.nim-lang.org/#pasty=hadlyGmx |
02:46:27 | FromDiscord | <bxiwbbd> sent a code paste, see https://play.nim-lang.org/#pasty=xUcMNfeb |
02:46:42 | FromDiscord | <Elegantbeef> It's an untyped macro of course it's the same AST |
02:47:10 | FromDiscord | <Elegantbeef> `(1..2).typeof` causes the `(1..2)` to be evaluated first, so it becomes `HSlice[int, int]` |
02:47:35 | FromDiscord | <Elegantbeef> Wheras `typeof 1..2` can evaluate to an iterator as `typeof` is magic that searches for them |
02:48:52 | FromDiscord | <bxiwbbd> In reply to @Elegantbeef "It's an untyped macro": Wait what is wrong with this? |
02:49:06 | FromDiscord | <Elegantbeef> untyped isn't semantically checked |
02:49:09 | FromDiscord | <Elegantbeef> So the ast will be identical |
02:53:26 | FromDiscord | <bxiwbbd> sent a code paste, see https://play.nim-lang.org/#pasty=bXcLBsuW |
02:53:41 | FromDiscord | <Elegantbeef> Right |
02:53:57 | FromDiscord | <Elegantbeef> I don't know what you're trying to show with the AST 😄 |
02:54:55 | FromDiscord | <bxiwbbd> I thought .typeof was some internal template overriding the typeof proc call and expanding to `type(...)` 😶 |
02:55:00 | FromDiscord | <bxiwbbd> No further comments |
02:56:11 | FromDiscord | <bxiwbbd> In reply to @janakali "One more question: why": @ElegantBeef can you answer this? |
02:56:34 | FromDiscord | <Elegantbeef> Likely cause it matches iterator dispatch |
02:57:33 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=VwyPVsqt |
02:58:58 | FromDiscord | <Elegantbeef> Not to mention you can have an iterator match a procedure name and be invoked inside of iterators |
02:59:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=lhaJwRmI |
03:09:54 | FromDiscord | <bxiwbbd> sent a code paste, see https://play.nim-lang.org/#pasty=kznSjwRn |
03:10:30 | FromDiscord | <Elegantbeef> It relates to the default behaviour cause when you do `typeof(x.iterator)` you expect the value to be the type the iterator yields |
03:11:38 | FromDiscord | <Elegantbeef> if you have to specify you want the type of the iterator you're liable to walk into either education issues, or obscure errors |
03:17:55 | FromDiscord | <bxiwbbd> In reply to @bxiwbbd "Seems quirky to me": and about this? |
03:25:32 | * | skippy8 joined #nim |
03:25:48 | FromDiscord | <Elegantbeef> What about it? |
03:26:13 | FromDiscord | <Elegantbeef> There's always going to be an issue one way or another |
03:26:26 | FromDiscord | <Elegantbeef> I've written more code around iterators myself |
03:27:07 | FromDiscord | <bxiwbbd> I'm sort of starting to understand your code. |
03:28:15 | FromDiscord | <bxiwbbd> `t.items` seems to be handled as a special case in `typeof()`, it doesn't appear to be a value that can be passed to normal functions |
03:32:15 | FromDiscord | <bxiwbbd> nim says `typeof` is a proc but treats it differently in this case (`typeof stuff.items`) |
03:34:06 | FromDiscord | <janakali> typeof is operator (compiler magic)↵https://nim-lang.org/docs/manual.html#special-types-typeof-operator |
03:35:20 | * | rockcavera quit (Remote host closed the connection) |
03:36:24 | FromDiscord | <bxiwbbd> sent a code paste, see https://play.nim-lang.org/#pasty=zQcZXSGq |
03:41:02 | FromDiscord | <janakali> @bxiwbbd it's abstraction | interface, if you check source code for this procedure - it's empty:↵ https://github.com/nim-lang/Nim/blob/fbdc9a4c19aafc25937aaa51f5c1f01084094688/lib/system.nim#L57↵what is compiler magic: https://en.wikipedia.org/wiki/Magic_(programming) |
03:43:45 | FromDiscord | <bxiwbbd> sent a code paste, see https://play.nim-lang.org/#pasty=uKDRlWew |
03:45:13 | FromDiscord | <bxiwbbd> (edit) "https://play.nim-lang.org/#pasty=VaeOfjmR" => "https://play.nim-lang.org/#pasty=BdJPMkoG" |
03:46:37 | FromDiscord | <janakali> first is a procedure without arguments and without return type↵second fails because func doesn't exist it's an alias for `proc(){.noSideEffect.}` |
03:48:16 | FromDiscord | <janakali> (edit) "first is a procedure ... withouttype" added "type" | "type↵second" => "type (pretty useless tbh)↵second" |
03:50:15 | FromDiscord | <janakali> sent a code paste, see https://play.nim-lang.org/#pasty=QdbuYCLZ |
03:58:39 | FromDiscord | <bxiwbbd> @janakali Are you involved in the compiler development? You seem to know alot about the nim project |
04:00:46 | FromDiscord | <Elegantbeef> > first is a procedure type without arguments and without return type↵Nope |
04:00:50 | FromDiscord | <Elegantbeef> First is a generic typeclass |
04:01:55 | FromDiscord | <Elegantbeef> Can be seen when you do `var a: proc` |
04:03:08 | FromDiscord | <bxiwbbd> ...meaning typeof was acting as an operator again |
04:03:28 | FromDiscord | <Elegantbeef> No |
04:04:06 | FromDiscord | <Elegantbeef> `typeof(proc)` returns `typedesc[proc]` which is valid as there is a `proc` type class. There is no `func` typeclass so it errors |
04:09:03 | FromDiscord | <janakali> In reply to @Elegantbeef "`typeof(proc)` returns `typedesc[proc]` which": thank you for correcting me, is there a definition somewhere in stdlib for procs? or it's just part of compiler? |
04:09:11 | FromDiscord | <janakali> (edit) "procs?" => "proc classes?" |
04:09:25 | FromDiscord | <Elegantbeef> It's a builtin typeclass |
04:09:40 | FromDiscord | <janakali> ah, ok then |
04:41:53 | FromDiscord | <lainlaylie> which are listed here: https://nim-lang.org/docs/manual.html#generics-type-classes |
06:13:18 | * | thunder quit (Ping timeout: 244 seconds) |
06:17:40 | * | thunder joined #nim |
07:38:09 | * | end quit (Ping timeout: 260 seconds) |
07:38:58 | * | bcksl quit (Ping timeout: 276 seconds) |
07:57:15 | * | bcksl joined #nim |
08:02:30 | * | end joined #nim |
08:58:33 | * | jjido joined #nim |
09:08:50 | * | beholders_eye joined #nim |
09:14:50 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
09:34:40 | * | jjido joined #nim |
09:38:58 | * | jjido quit (Client Quit) |
10:04:01 | * | skippy8 quit (Ping timeout: 248 seconds) |
10:05:57 | * | beholders_eye quit (Ping timeout: 276 seconds) |
10:15:41 | * | andy-turner joined #nim |
10:17:33 | * | beholders_eye joined #nim |
11:07:55 | * | andy-turner quit (Read error: Connection reset by peer) |
11:07:59 | * | andy-turner__ joined #nim |
11:09:54 | * | andy-turner__ quit (Read error: Connection reset by peer) |
11:10:01 | * | andy-turner__ joined #nim |
11:16:58 | * | andy-turner joined #nim |
11:18:13 | * | andy-turner__ quit (Ping timeout: 248 seconds) |
11:18:34 | * | andy-turner quit (Read error: Connection reset by peer) |
11:18:55 | * | andy-turner joined #nim |
11:20:16 | * | andy-turner quit (Max SendQ exceeded) |
11:21:48 | * | andy-turner joined #nim |
11:24:08 | * | andy-turner quit (Read error: Connection reset by peer) |
11:24:29 | * | andy-turner joined #nim |
11:26:40 | * | andy-turner_ joined #nim |
11:29:01 | * | andy-turner quit (Read error: Connection reset by peer) |
11:34:12 | * | andy-turner joined #nim |
11:34:27 | * | andy-turner_ quit (Quit: Leaving) |
12:04:01 | * | bcksl quit (Ping timeout: 248 seconds) |
12:05:28 | * | end quit (Ping timeout: 276 seconds) |
12:08:13 | * | PMunch joined #nim |
12:13:07 | * | skippy8 joined #nim |
12:24:06 | * | bcksl joined #nim |
12:31:02 | * | end joined #nim |
12:35:28 | FromDiscord | <ayex> sent a long message, see https://pasty.ee/bVeBkYXX |
12:37:02 | * | beholders_eye quit (Ping timeout: 244 seconds) |
13:17:12 | * | beholders_eye joined #nim |
14:02:06 | FromDiscord | <ase8540> Much less is much more. Burn your supplies periodically. Else price will not go up. Utilities are important but first priority still scarcity of tokens or coins!🙂 |
14:02:40 | * | PMunch quit (Quit: Leaving) |
14:10:49 | * | thunder quit (Remote host closed the connection) |
14:11:38 | * | thunder joined #nim |
14:18:22 | FromDiscord | <janakali> sent a long message, see https://pasty.ee/WBvLwHTt |
14:24:04 | FromDiscord | <ayex> sent a code paste, see https://play.nim-lang.org/#pasty=RvCpBcxW |
14:24:42 | FromDiscord | <ayex> in the working python version, I am also passing 20. |
14:31:05 | FromDiscord | <ayex> hm right, on the ms page it says it would from win11 onwards. very strange |
14:55:35 | * | amadaluzia joined #nim |
15:01:36 | * | jjido joined #nim |
15:14:36 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
15:52:06 | * | andy-turner quit (Read error: Connection reset by peer) |
15:52:22 | * | andy-turner joined #nim |
16:01:46 | FromDiscord | <spotlightkid> sent a long message, see https://pasty.ee/hcDHgNOa |
16:01:59 | FromDiscord | <spotlightkid> Should I open an issue? |
16:06:21 | * | beholders_eye quit (Quit: WeeChat 4.6.3) |
16:10:44 | * | xet7 joined #nim |
16:29:01 | * | andy-turner__ joined #nim |
16:29:20 | * | andy-turner quit (Read error: Connection reset by peer) |
16:31:40 | * | thunder quit (Remote host closed the connection) |
16:32:06 | * | thunder joined #nim |
16:33:15 | * | andy-turner__ quit (Read error: Connection reset by peer) |
16:33:25 | * | andy-turner__ joined #nim |
16:34:19 | * | thunder quit (Remote host closed the connection) |
16:36:32 | * | thunder joined #nim |
16:38:49 | * | thunder quit (Remote host closed the connection) |
16:45:14 | * | andy-turner__ quit (Read error: Connection reset by peer) |
16:45:23 | * | andy-turner__ joined #nim |
16:49:53 | * | andy-turner joined #nim |
16:50:50 | * | andy-turner__ quit (Read error: Connection reset by peer) |
16:55:35 | * | andy-turner quit (Read error: Connection reset by peer) |
16:55:57 | * | andy-turner joined #nim |
16:57:34 | * | andy-turner quit (Max SendQ exceeded) |
16:58:00 | * | andy-turner joined #nim |
17:01:09 | * | andy-turner quit (Read error: Connection reset by peer) |
17:01:13 | * | jjido joined #nim |
17:01:15 | * | xet7 quit (Ping timeout: 252 seconds) |
17:01:33 | * | andy-turner joined #nim |
17:02:10 | * | xet7 joined #nim |
17:02:57 | * | andy-turner quit (Max SendQ exceeded) |
17:04:22 | * | andy-turner joined #nim |
17:05:31 | * | andy-turner quit (Max SendQ exceeded) |
17:07:36 | * | andy-turner joined #nim |
17:08:58 | * | andy-turner quit (Max SendQ exceeded) |
17:09:22 | * | andy-turner joined #nim |
17:10:39 | * | andy-turner quit (Max SendQ exceeded) |
17:11:02 | * | andy-turner joined #nim |
17:12:15 | * | andy-turner quit (Max SendQ exceeded) |
17:12:38 | * | andy-turner joined #nim |
17:38:02 | * | xet7 quit (Ping timeout: 268 seconds) |
17:39:46 | * | xet7 joined #nim |
18:14:20 | FromDiscord | <pmunch> The iterations thing is easily solved by the switch it suggests |
18:15:03 | FromDiscord | <pmunch> But the other stuff sounds strange |
18:22:09 | * | beholders_eye joined #nim |
18:24:09 | * | andy-turner quit (Read error: Connection reset by peer) |
18:43:04 | * | xet7 quit (Remote host closed the connection) |
18:55:42 | * | beholders_eye quit (Ping timeout: 276 seconds) |
19:22:42 | * | ntat joined #nim |
19:42:42 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
20:23:27 | * | ntat quit (Quit: leaving) |
20:38:09 | * | thunder joined #nim |
20:50:00 | * | thunder quit (Remote host closed the connection) |
20:50:26 | * | thunder joined #nim |
20:54:13 | * | thunder quit (Remote host closed the connection) |
20:54:37 | * | thunder joined #nim |
21:13:25 | * | jjido joined #nim |
21:30:55 | * | skippy8 quit (Quit: WeeChat 4.6.3) |
21:52:01 | * | thunder quit (Quit: Leaving) |
22:06:30 | * | thunder joined #nim |