User Tag List

Results 1 to 2 of 2

Thread: Function Pointers

  1. #1
    Keese
    ZC Developer

    Join Date
    Jan 2007
    Age
    34
    Posts
    52
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    781
    Level
    9
    vBActivity - Bars
    Lv. Percent
    80.93%

    Function Pointers

    So, I've been making some progress to adding function pointers to zscript: https://github.com/gwx/ZeldaClassic/...ction-pointers

    CODE: Show
    void test() {
    Trace(-99);
    }
    void test(int x) {
    Trace(x);
    }
    global script Active {
    void run() {
    int f = @test;
    f();
    f = @test(int);
    f(-50);
    }
    }


    Up until now, I've been focusing on getting it to work (which it does), but not any aspects of type safety.
    So, continuing forward, I figure I can either add vaguely C style types:

    int(bool, int) x = @test;

    Or model it after angelscript's approach:

    funcdef int TYPE_NAME(bool, int);
    // ...
    TYPE_NAME x = @test;

    Any preferences on which, or other considerations?

  2. #2
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,763
    Level
    21
    vBActivity - Bars
    Lv. Percent
    69.38%
    (( Applauds ))

    Fantastic work, mate. With you on the parser, while I wok on ZScript, we'll get this beastie done.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social