nv-array-lisp

    1.0.6 • Public • Published

    nv-array-lisp

    • nv-array-lisp
    • simulate several basic-lisp-functions
    • for test dynamic-module-methods

    install

    • npm install nv-array-lisp

    usage

    const ary_lisp = require("nv-array-lisp");
    

    example

    > ary_lisp
    Proxy [
      {
            noexist: Symbol(noexist),
            is_nil: [Function: is_nil],
            cons_ary: [Function: cons_ary],
            cons_ele: [Function: cons_ele],
            car: [Function: car],
            cdr: [Function: cdr],
            cxr: [Function: cxr],
            /^c[ad]{2,}r$/: [Function: /^c[ad]{2,}r$/]
      },
      { get: [Function: get] }
    ]
    >
    
    > ary_lisp.car([1,2,3])
    1
    > ary_lisp.cdr([1,2,3])
    [ 2, 3 ]
    > ary_lisp.cdddr([1,2,3,4,5])
    [ 4, 5 ]
    > ary_lisp.caddr([1,2,3,4,5])
    3
    > ary_lisp.cdr([1,2,3,4,5])
    [ 2, 3, 4, 5 ]
    > ary_lisp.cdr([2,3,4,5])
    [ 3, 4, 5 ]
    > ary_lisp.car([3,4,5])
    3
    >
    
    > ary_lisp.cddddddddr([1,2,3,4,5,6,7,8,9,10])
    [ 9, 10 ]
    >
    
    
    > nestize([1,2,3,4])
    [ 1, [ 2, [ 3, [Array] ] ] ]
    >
    > JSON.stringify(x)
    '[1,[2,[3,[4,[]]]]]'
    

    API

    • ary_lisp.noexist

    • ary_lisp.is_nil(ary)

    • ary_lisp.car(ary)

    • ary_lisp.cdr(ary)

    • ary_lisp.cxr(cmd,ary)

    • ary_lisp.cons_ele(ele0,ele1)

    • ary_lisp.cons_ary(ele0,ary)

    • ary_lisp./^c[ad]{2,}r$/(ary)

    • ary_lisp.nestize(ary)

    LICENSE

    • ISC

    Install

    npm i nv-array-lisp

    DownloadsWeekly Downloads

    6

    Version

    1.0.6

    License

    ISC

    Unpacked Size

    3.95 kB

    Total Files

    3

    Last publish

    Collaborators

    • ihgazni2