Does monkey have macros?

About Monkey 2 Forums Monkey 2 Programming Help Does monkey have macros?

This topic contains 6 replies, has 4 voices, and was last updated by  nerobot 1 year, 11 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #7906

    AaronK
    Participant

    Hi guys. I want to whip up a unit testing framework and need macros to do so. Does monkey have ’em?

    Cheers
    Aaron

    #7907

    abakobo
    Participant

    Macros are not there.
    There is aliases but not real macros.

    #7917

    cocon
    Participant

    You need macros for processor logic or for generating code?

    #7995

    cocon
    Participant

    Also I found today that with the powers of reflection you can literally change the objects at runtime. See reflectiontest.monkey2 example.

    #8017

    AaronK
    Participant

    @cocon I just need macros to wrap code so I can do something like this

    REQUIRES(DoSomething() = false) and have the code portion both checked and put into an exception to help with error tracking.

    Basically if you look at any C++ UNIT testing framework like Catch etc, then I want that sort of functionality.

    #8071

    cocon
    Participant

    I see, in that case you would go for classic functions at this time.

    This is a feature that does not exist in Monkey. You can get only
    the most basic directives for preprocessor conditional logic.
    http://www.monkey-x.com/docs/html/Programming_Language%20reference.html#preprocessor

    #8080

    nerobot
    Participant

    There is an Assert function in monkey.debug namespace to check conditions.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.