Boost logo

Boost Users :

Subject: Re: [Boost-users] [Wave] Modifying the way function-like macros are interpreted
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2009-12-25 10:42:43


> I am trying to use boost::wave as a preprocessor for LSL, a language
> used in the virtual world Second Life.
>
> There is a data type there for collections of data, but it can only be
> accessed through functions such as llList2String(list,iterator); I
> wanted to define macros that would allow me to do something like
> #define
> x[y] llList2String(x,y), however, wave as it stands does not seem to
> have any immediately obvious way to do this.

As Wave is a preprocessor conforming to the C++ Standard this is not
possible.
But you can define your macro like

    #define x(y) llList2String(x,y)

if that's an option.

OTOH, Wave is open source, so you should be able to find the corresponding
code to add your syntax. Do you want _all_ macros to be defined using the []
syntax or is this something you want to have additionally to the 'normal'
function style syntax?

Regards Hartmut

---------------
Meet me at BoostCon
www.boostcon.com


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net