Skip to content

#define like in c or c++ #127

@truebluepl

Description

@truebluepl

Hello Georg,

is there any way to define a kind of macro like in c or c++?

For example I would like find closest power of two of any value.
So the code is:

v = v - 1
v = v | v>>1
v = v | v>>2
v = v | v>>4
v = v + 1

I can't (maybe I'm wrong) use macro like:

!macro ClosestPowerOfTwo v
v = v - 1
v = v | v>>1
v = v | v>>2
v = v | v>>4
v = v + 1
!end

and put in the source:
and #+ClosestPowerOfTwo 12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions