Skip to main content
1 vote
0 answers
98 views

I'm trying to construct a typed lambda calculus, something along the lines of: struct Fun<T>(T); // actual definition elided for simplicity struct TypeErasedExpr { /* elided for simplicity */ } ...
1 vote
0 answers
57 views

Is there some clever way to do this that works? class NamedElement: def __init__(self, **kwargs): self.name = Property(name=kwargs.get('name')) #you're going to regret this class Property(...
0 votes
0 answers
22 views

I'm working with metaprogramming in Python and need to dynamically resolve functions. When a variable is directly assigned a function name, everything works. However, when assigned indirectly via ...
1 vote
0 answers
58 views

I have an in-memory table defined as follows in DolphinDB: t = table(2025.01.01 as date, 1 as M01, 2 as M02, 3 as M03, 4 as M04, 5 as M05, 6 as M06, 1 as M07, 2 as M08, 3 as M09, 4 as M10, 5 as M11, 6 ...
0 votes
0 answers
29 views

I have a table “clean_factor“ where the column “y“ indicates the stock returns and the subsequent columns indicate factor exposures. How do I calculate the daily residual return of each stock with the ...
0 votes
0 answers
128 views

The project I'm working on uses a somewhat complex typing system, I have a base class called RID which uses the metaclass RIDType. Custom RID types are classes which derive from RID: class RIDType(...
1 vote
0 answers
67 views

I am trying to transform the code of literal lambda expressions in a Scala-3 macro. I have defined a macro like this def rCode(formal: Expr[Int => Boolean])(using Quotes): Expr[Int => Boolean] = ...
2 votes
0 answers
72 views

This is my example code: #include <iostream> #include <type_traits> template <typename T> void check_type(T&&) { if constexpr (std::is_reference<T>::value) { ...
0 votes
0 answers
48 views

I'm building my own ORM in Python and ran into an issue. I want to track the access to class variables in order to know which ForeignKey is being used in each part of my code. class IQuery(ABC): &...
1 vote
0 answers
37 views

I'm trying to find a way to quietly wrap the main method of a class in a try/catch block. What I'm imagining is a static version of invokeMethod, where I can simply intercept the main method call and ...
1 vote
0 answers
116 views

I'm trying to generate an enum type at compile-time, based on a json file. Following guides like https://developerlife.com/2022/03/30/rust-proc-macro/ I made this : An external crate my_macros since ...
0 votes
0 answers
699 views

How can one define a function that takes a struct in Zig and be able to access all the keys and values In that struct dynamically? I have tried a couple of approaches but I kept getting compile error. ...
1 vote
0 answers
1k views

I have a class which takes in some arguments, with a method that takes and returns a namedtuple. The namedtuple itself is defined within the init based on some inputs, e.g.: class MyClass: def ...
0 votes
0 answers
93 views

I have a question about an issue that's similar to this older question about the dplyr::filter() function, except that my example is a bit more complicated because dplyr::mutate() needs to process ...
0 votes
0 answers
42 views

I am making a rails engine which has a themes folder , in app/apps/themes . When you install the gem in a host application , the user should have the ability to add a new theme depending on their ...

15 30 50 per page
1
2 3 4 5
21