Hassan Abu-Jabir

Results 37 comments of Hassan Abu-Jabir

> For more advanced codegen, I would recommend using `$exec` though. Is there a generally accepted way to, for instance, retrieve the fields of a struct in a c3 script...

I will try using generic modules for this. Is there an example how to interact with the type parameters in a generic module?

Conceptually i want to achieve something like this: ``` struct NumberInput { //.. } struct StringInput { // .. } macro input_from_type($FTy) { $if @typeis($FTy, uint): return NumberInput; $elseif @typeis($FTy,...

Ah i understand. The `$include` was my missing link for this use case. Thank you very much. Defining a multi array list or tagged union is still unwieldy. It could...

Or can that already done via a macro that builds the json from the available type information?

Yep i will, looks interesting, simple and extremely powerful. is this on the main branch now or some other branch?

So far this works for me. One thing that seems to be a missing piece is to get the type of a `member_ref` akin to `$typeof` for normal variables that...

Also being able to return types would be nice. Using macros in type position could also be very useful in the context of this system, that would allow me to...

As an example i a currently have this code: ``` module generics; import std::io; macro view_of($Ty) { var $out = $concat("struct ", $Ty.nameof, "View {"); $foreach ($member : $Ty.membersof) var...

Ah i see the `$assert(false)` in the default branch makes this switch const evaluatable. Is this already documented somewhere if not i could go ahead and write a section either...