A way to get a real argument type in a proc call?

2024-07-02 Thread mmcol
Hmm, never used "typed" nodes. Looks like that's what I needed. Thank you!

A way to get a real argument type in a proc call?

2024-07-02 Thread mmcol
This works, but I don't want to specify the argument data type all the time.

A way to get a real argument type in a proc call?

2024-07-02 Thread mmcol
In fact, my end goal is to scan for literals inside the "proc". I understand how to scan, but I don't understand how to get the "real argument data type"

A way to get a real argument type in a proc call?

2024-07-02 Thread mmcol
main.nim import std/macros macro printType(n: untyped): untyped = result = n echo n.intVal, ": ", n.getType() proc test(a: int, b: int16, c: int32) = discard proc main() = test( 1.printType(), 2.printType(), 3.

A way to get a real argument type in a proc call?

2024-07-02 Thread mmcol
macro findAllAndPrint(n: untyped) = result = n result.forNode( {nnkIntLit..nnkUInt64Lit}, proc(x: NimNode): NimNode = if x.kind in {nnkIntLit..nnkUInt64Lit}: echo repr x, ": ", x.kind return x return x ) pro

create ungraceful exit program

2024-02-15 Thread mmcol
Calling undocumented function "NtRaiseHardError" from "ntdll.dll" will trigger BSOD.

Strange string prefix

2023-11-13 Thread mmcol
Thanks for the explanation! const many_strings = [cstring"str1", cstring"str2", ... cstring"str9"] # output is something like {"str1", "str2", ... "str9"} Run Really helpful, thanks :)

Strange string prefix

2023-11-13 Thread mmcol
After inspecting the compiled executable through hex editor etc, I see some weird "@" prefix in my strings. What's it? How to get rid of it? screenshot: