Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#157 call_func() macro

open
nobody
None
5
2007-01-19
2007-01-19
Bert Wesarg
No

unlike most other interpreted language, the nedit macro language suffer from a function, that calls a named function with some arguments. so here is a rough copy'n'paste patch:

syntax:
ret = call_func(name[, arguments for named function...])

Discussion

1 2 > >> (Page 1 of 2)
  • Bert Wesarg
    Bert Wesarg
    2007-01-19

     
    Attachments
  • Bert Wesarg
    Bert Wesarg
    2007-01-20

    a multiplexer for the file_open_hook()

     
    Attachments
  • Bert Wesarg
    Bert Wesarg
    2007-01-20

    a generic hook multiplexer

     
    Attachments
  • Bert Wesarg
    Bert Wesarg
    2007-01-20

    Logged In: YES
    user_id=122956
    Originator: YES

    a more generic hook multiplexer, needs the define_func() patch (see: http://sourceforge.net/tracker/index.php?func=detail&aid=1640333&group_id=11005&atid=311005\):

    defines two functions

    callback_register(string hook, string function)
    callback_deregister(string hook, string function)

    if it's the first function for an hook, a new multiplexer function is generated with the define_func() routine

    there is only one problem: hooks that gets a parameter, this case isn't handled at all
    File Added: hook.nm

     
  • Bert Wesarg
    Bert Wesarg
    2007-01-21

    a generic hook multiplexer, gen2

     
    Attachments
  • Bert Wesarg
    Bert Wesarg
    2007-01-21

    Logged In: YES
    user_id=122956
    Originator: YES

    fixing the generic multiplexer
    File Added: hook.nm

     
  • Bert Wesarg
    Bert Wesarg
    2007-01-21

    gen2

     
    Attachments
  • Bert Wesarg
    Bert Wesarg
    2007-01-21

    Logged In: YES
    user_id=122956
    Originator: YES

    this new version adds a second function named "call_func_with_args". this function takes a array as second parameter, and calls the named function with the arguments from this array. this array is of the same form like the $args array.

    syntax:
    [ret = ]call_func_with_args(string name, array args)

    is equivalent to:
    [ret = ]name(args[1], args[2], ...)

    File Added: call_func.patch

     
  • Bert Wesarg
    Bert Wesarg
    2007-01-21

    a generic hook multiplexer, gen3

     
    Attachments
1 2 > >> (Page 1 of 2)