General Category > Ideas

Macro-system design

<< < (2/2)

bas:
I agree with https://npf.io/2018/09/go2-contracts-go-too-far. It's too complex IMHO.

When you want an argument to be of a specific type in C, don't you just say myfunc(Foo a), instead of requiring a to be
of type Foo later. The only thing you can't do that way is force multiple arguments to be of some Type 'T' that just supports
the required operations in the macro. Something Generics may solve. Also the typeof() may be needed as in your example.

I want to learn Nim macros more before building my opinion about them.. Today is Nim day ;)

lerno:
Did you think about my generics proposal? "import foo (i32, Bar, f32) as local;" "module foo (A, B, C);"

Navigation

[0] Message Index

[*] Previous page

Go to full version