Questions tagged [macros]

A macro in computer science is a rule or pattern that specifies how a certain input sequence (often a sequence of characters) should be mapped to a replacement output sequence (also often a sequence of characters) according to a defined procedure. Do not use this tag for questions regarding Microsoft's Visual Basic for Applications. VBA evolved from an early macro language, but is not a macro language itself.

13 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
14
votes
0answers
587 views

Autotools detect C++ language standard support

I have been updating my build tools to optionally use autotools (autoconfig/automake/libtool etc.). As part of this change I have written a couple of M4 macros. This not being something I have done ...
3
votes
0answers
39 views

Yet another reflection library

Tried to do my own implementation of reflection(introspection) for using in my next projects. Is it optimized at compile time? If no, how can I improve it? This macro is good interface for adapting ...
3
votes
0answers
72 views

Rust List comprehension macro

I'm very new to Rust and as I've been going through the book I became very interested in its macros. To better understand them I tried to write something of a usable list comprehension like those in ...
3
votes
0answers
84 views

Racket macro for variadic FFI

I'm working on FFI wrapper for SDL2 library in Racket. The library includes several variadic functions (e.g. SDL_SetError, SDL_LogMessage etc); Racket FFI does not have straight way for importing ...
3
votes
0answers
99 views

Allowing switching between operator[] and at() based on NDEBUG macro version

The problem: std::vector and other containers have two functions for accessing / modifying their content: operator[] and ...
2
votes
0answers
92 views

Simple generic macro-generated containers

In order to learn macros in C I decided to make a generic data structures generator for other projects that I have in C. The main macros are the following: ...
2
votes
0answers
304 views

Interpreter for an assembly language with variadic instructions

I am currently implementing a virtual machine that runs a programming language similar to assembly. The difference is that an instruction in this language can have any number of operands. and the ...
2
votes
0answers
97 views

`multiple-value-call` in Scheme

Common Lisp has a "special operator" called multiple-value-call, which does something similar to Scheme's call-with-values but ...
1
vote
0answers
33 views

Trying to speed up VBA macro to generate viable Daily Fantasy Sports lineups

I have created the code below to generate daily fantasy sports lineups from a pool of players that have been entered in my excel file. Right now the code can run through about 16,500 combinations per ...
1
vote
0answers
105 views

Optimizing VBA code , Takes more than 50 minutes to update

Could you please help me optimize the macro, Its taking more than 50 minutes but still no success. The For loop is looping untill 1.0 million + rows. Screen is flickering. I have tried Application....
1
vote
0answers
75 views

Clojure macro to gather functions in a namespace into a map

I'm learning Clojure via a pet project. The project would consist of several workers that would be called from other functions. Each worker is defined in their own namespace as a set of functions (...
1
vote
0answers
52 views

Implementation of catch test framework in Racket

As an exercise in learning how to use Racket macros I decided to implement a subset of the features in the catch test framework for C++. In particular the catch test framework has a unique feature ...
1
vote
0answers
64 views

Creating class method using macro to accept Visitator for each of their fields

I had a lot of classes that used a macro with listed fields. The macro was used to serialization, more like MSGPACK_DEFINE. I need a substitution of this mechanism, ...