#158 define() macro built-in

open
nobody
None
5
2008-01-28
2007-01-20
Bert Wesarg
No

unfortunately, "define" is not part of the nedit macro language, so it is not possible to define a new function with the eval() macro, so here is a rough copy'n'paste patch thats defined a new built-in macro subroutine to define a new macro subroutine.

syntax:
define_func(string function_name, string body_of_function)

Discussion

  • Bert Wesarg
    Bert Wesarg
    2007-01-20

     
  • Bert Wesarg
    Bert Wesarg
    2007-01-20

    Logged In: YES
    user_id=122956
    Originator: YES

    added an option to override an previously defined function

    new syntax:
    define_func(string function_name, string body_of_function[, "override"])
    File Added: define_func_macro.patch

     
  • Bert Wesarg
    Bert Wesarg
    2007-01-20

    gen2

     
  • Bert Wesarg
    Bert Wesarg
    2007-01-20

    gen3

     
  • Bert Wesarg
    Bert Wesarg
    2007-01-20

    Logged In: YES
    user_id=122956
    Originator: YES

    fix a little typo
    File Added: define_func_macro.patch

     
  • Bert Wesarg
    Bert Wesarg
    2008-01-28

    gen4

     
    Attachments
  • Bert Wesarg
    Bert Wesarg
    2008-01-28

    Logged In: YES
    user_id=122956
    Originator: YES

    renamed to define(), which involves some parser magic to distinguish between 'define func' and 'define("func", body)'.

    also new: only allow overwriting of macro functions.
    File Added: define_macro.patch

     
  • Bert Wesarg
    Bert Wesarg
    2008-01-28

    • summary: define_func() macro --> define() macro built-in