» Home » macro » Page 1
C/C++ Macro: How to generate two separate sections of code with one macro (boost preprocessor library?)
Category : Programming Languages

I'm looking for a method or a way to generate a list of typedefs and a list of object instantiations from a list of macro-invocations, defining the class types and the constructor parameters of these objects.


It should look like the (not working) code below. The problem to solve is a way to generate to different lists out of one list of macro invocations. I guess this is a problem t


View Replies


Can I make a clojure macro that will allow me to get a list of all functions created by the macro?
Category : Programming Languages

I would like to have a macro which I'll call def-foo. Def-foo will create a function, and then will add this function to a set.


So I could call


(def-foo bar ...)
(def-foo baz ...)

And then there would be some set, e.g. all-foos, which I could call:


all-foos
=> #{bar, baz}

Essentially, I'm just try


View Replies


How to set the macro results into the excel column? Am new to Macro's and very basic. Please explain it
Category : Programming Languages

'Need to set the value of employee(0), employee(1)......,employee(25) in the A column of excel "Sheet1".


Sub testingarray()
For n = 0 To n = 25
employee(n) = Chr(n + 65)
Next n
For n = 0 To n = 25
MsgBox employee(n)
Next n
End Sub
'Tried to use this:** Please say if am wrong
Public Sub putvalue()
Range("A1").Value = employee(0)
View Replies


Creating C macro with ## and __LINE__ (token concatenation with positioning macro)
Category : Programming Languages

I want to create a C macro that creates a function with a name based
on the line number.
I thought I could do something like (the real function would have statements within the braces):


#define UNIQUE static void Unique_##__LINE__(void) {}

Which I hoped would expand to something like:


static void Unique_23(void) {}

<

View Replies


OnBuildBegin does not fire in Visual Studio Macro until I run it from Macro Explorer
Category : Programming Languages

I have the following Visual Studio Macro:


Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports MyMacros.EnvironmentEvents
Imports System.Diagnostics
Public Module Module1
Private WithEvents buildEvents As EnvDTE.BuildEvents = EnvironmentEvents.BuildEvents
Public Sub BuildEvents_OnBuildBegin() Handles buildEvents.O

View Replies


Adding a previously defined macro to the macro ring in Emacs
Category : Web Design

I've been using kmacro commands such as kmacro-name-last-macro to save keyboard macros. The problem is that after I have saved a macro and even added it to my .emacs file, I come across an error and want to edit the macro using kmacro-step-edit-macro. If my named macro is no longer in the macro ring (the default kmacro-ring-max is 8) I can't use any of the


View Replies


CPP: avoiding macro expansion of a macro function parameter
Category : Programming Languages

what I'd like to do (for logging purposes) is something like this:


this code has been written to show my problem, actual code is complex and yes, I have good reasons to use macros even on C++ =)


# define LIB_SOME 1
# define LIB_OTHER 2
# define WHERE "at file #a, line #l, function #f: "
// (look for syntax hightlighting error at SO xd)
# define LO

View Replies


How do I write a macro-defining macro in common lisp
Category : Programming Languages

I have about two macros (and climbing) in my codebase that look like this:


(defmacro def-stat-method (method-name stat)
`(progn
(defmethod ,method-name ((monster monster))
(getf (stats monster) ,stat))
(defmethod (setf ,method-name) (value (monster monster))
(setf (getf (stats monster) ,stat) value))))

and th


View Replies


How to Take Macro Pictures With a Kodak EasyShare P850 Macro
Category : Electronics
Released in 2005, the Kodak EasyShare P850 is part of Kodak's class of "advanced digital cameras," according to the website Digital Photography Review. The camera is compact point and shoot model that is built around a 12x optical zoom Schneider Kreuznach lens. The lens will focus as close as 3.9 inches, which makes it an ideal lens to use for macro or close-up photography for flowers or other si

View Replies


function that creates macro with macro name supplied as a parameter
Category : Development Tools & Services

I am trying to define a function that will create a macro and am running into problems when I try to dynamically supply the macro's name. Here's narrowed-down code that exemplifies the issue I am facing:


(defn create-times-macro [n]
(defmacro thatManyTimes [a]
`(* ~n ~a)))
(create-times-macro 2)
(thatManyTimes 3) ;; evals to 6

So far


View Replies


Next
2012 / 2017 Copyrights BigHow , All Rights Reserved .