JSON eXtended Notation

Speed Demon...

MacroPlugin Built-in Functions

  1. add

    - args[0] + args[1]

    Ex.

    add(1,2)

  2. and

    - args[0] && args[1]

    Ex.

    and(true,false)

  3. call

    - gets the reference args[0] and invokes its method args[1] and passes array value of args[2]

    Ex.

    call("someInstance.someObject","someFunction",[param1,param2])

  4. check

    - evaluates if args[0] is true, parses args[1] if not parses args[2]. args[1] and args[2] can be a single value or an array of other code to be evaluated.

    Ex.

    check(and(true,false),[set("somevar",1), result(true)],result(false))

  5. collect

    - gets all string of the data it can evalutate as arguments.

    Ex.

    collect([add(a,b),true,false,"hello"]) 
    // evaluates as [add(a,b),true,false,"hello"]

  6. concat

    - args[0] + "" + args[1]

    Ex.

    concat("Hello","World")

  7. create

    - returns a reference to instance of target class registered in its classTypes. to add more classTypes overide the JXN.initClassTypes function.

    Ex.

    set("obj",create("Object"))
    // sets context.obj = new Object()

  8. div

    - args[0] / args[1]

    Ex.

    div(1,2)

  9. eq

    - args[0] == args[1]

    Ex.

    eq(1,1)

  10. get

    - returns the reference to target variable.

    Ex.

    [set("foo","hello"),get("foo")] 
    // get("foo") evalutates to hello

  11. gt

    - args[0] > args[1]

    Ex.

    gt(2,1)

  12. gte

    - args[0] >= args[1]

    Ex.

    gt(2,1)

  13. halt

    - breaks the current loop.

    Ex.

    loop(true,[set("a",1),halt(),set("a",2)]) 
    // context.a evaluates to 1 not 2.

  14. loop

    - args[0] is the condition and args[1] are array of statements to execute.

    Ex.

    [set("i",0),loop(lt(get("i"),10),[set("i",add(get("i"),1))])]
    loops 10 times.
  15. lt

    - args[0] < args[1]

    Ex.

    lt(2,1)

  16. lte

    - args[0] <= args[1]

    Ex.

    lte(2,1)

  17. mod

    - args[0] % args[1]

    Ex.

    mod(2,1)

  18. mul

    - args[0] * args[1]

    Ex.

    mul(2,1)

  19. ne

    - args[0] != args[1]

    Ex.

    ne(2,1)

  20. not

    - !args[0]

    Ex.

    not(true)

  21. or

    - args[0] || args[1]

    Ex.

    or(true,false)

  22. parseInt

    - parseInt(args[0])

    Ex.

    parseInt("1234.5")

  23. result

    - stops current loop or task and forces evalutated argument as returing value.

    Ex.

    task([result(1),result(2),result(3)])
    // returns 1 the code after are ignored

  24. resume

    - place holder function for signifying the reverse of a break. It does not do anything, but arguments to it are still evalutated as normal.

    Ex.

    resume()

  25. set

    - sets the target object property of args[0] with value of args[1].

    Ex

    set("a.b",1234)
    // the property b is now 1234, but a should be a valid reference.

  26. sub

    - args[0] - args[1]

    Ex.

    sub(1,2)

  27. task

    - captures string value of args[0] and returns a task instance that has a run() function. It does not execute its code, it needs to be activitated. Although, you could set the task reference to the context, and use the call to run it later on.

    Ex.

    task([result(1),result(2),result(3)]) 
    // Javascript: var task = jxn.unmarshall(jsn); task.run()--> 1




Copyright (C) 2007 JXN This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

Michael Jackson© is not affiliated with this project.
Gallium31.com