The inclusion of Meta-statements ?

Meta-statements could allow a programmer to define novell entities and data structures

let val = MetaStatement{ 'az', [ pattern => callback [, ...] ] }

FLAGS

'a' - prefix `++`a
'z' - postfix (default) a`[]`
'ez' - infix (or any) `++`a`[]`

EXAMPLE

class DS() extends Array {
    static get [ Symbol.species ] () {
        return Array
    }
    // Methods
    add( n ) { // n == Array of values
        while ( n.length ) {
            this.push( n.shift() )
        }
    }
    addAt( n ) {
        while ( n.length ) {
            this[ n[ 0 ][ 0 ] ] = n[ 0 ][ 1 ]
            n.shift()
        }
    }
    sub( n ) {
        return this.pop( n )
    }
    show {
        return `[ ${ this.join(', ') } ]`
    }
    showAt( n ) {
        return this[ n ]
    }
    spread() {
        return ...this
    }
}

let ds = new DS()

let `[]` = MetaStatement {
    `z`,
    `[ $ ]` => ds.showAt,
    `[ $0 ] = $1` => ds.addAt,
    `.push( $,... )` => ds.add,
    `.pop()` => ds.sub,
    `.length` => ds.length,
    `` => ds.show,
    `[]...` => ds.spread,
}

let a`` = `[]`
a`[0] = 2` // [2]
a`.push( 4 )` // [2,4]
a`[0]` // 2
a`` // [2,4]
a`[]...` // 2,4
a`.length` // 2
a`.pop()` // 4
a`[]...` // 2
a`.length` // 1

// let b`` = `{{ }}`, where {{ }} is a JSON-like object which allows cycles
let b`` = `{{ a:0, b:1, c:2, d:2 }}` // { a:0, b:1, c:2, d:2 }
b`[]: = {{ e:3, f:4, g:5 }} ` // { a, b, c, d } : { e:3, f:4, g:5 } == { a:{ e:3, f:4, g:5 }, b:{ e:3, f:4, g:5 }, c:{ e:3, f:4, g:5 }, d:{ e:3, f:4, g:5 } }
let mykey = 'a'
let myval = 'g'
b`[ ${ mykey } ][ g ] = ${ myval }` //  { a:{ e:3, f:4, g:g }, b:{ e:3, f:4, g:5 }, c:{ e:3, f:4, g:5 }, d:{ e:3, f:4, g:5 } }

Perhaps this is a cleaner notation

let {`a`} = `[]`
{`a[0] = 2`} // [2]
{`a.push( 4 )`} // [2,4]
{`a[0]`} // 2
{`a`} // [2,4]
{`a[]...`} // 2,4
{`a.length`} // 2
{`a.pop()`} // 4
{`a[]...`} // 2
{`a.length`} // 1

// let {`b`} = `{{ }}`, where {{ }} is a JSON-like object which allows cycles
let {`b`} = `{{ a:0, b:1, c:2, d:2 }}` // { a:0, b:1, c:2, d:2 }
{`b[]: = {{ e:3, f:4, g:5 }}`} // { a, b, c, d } : { e:3, f:4, g:5 } == { a:{ e:3, f:4, g:5 }, b:{ e:3, f:4, g:5 }, c:{ e:3, f:4, g:5 }, d:{ e:3, f:4, g:5 } }
let mykey = 'a'
let myval = 'g'
{`b[ ${ mykey } ][ g ] = ${ myval }`} //  { a:{ e:3, f:4, g:g }, b:{ e:3, f:4, g:5 }, c:{ e:3, f:4, g:5 }, d:{ e:3, f:4, g:5 } }

EXAMPLES

A small virtual-machine to execute python-like statements

val = 128
let {`py`} = `#python`
{`py.print('Hello, world!')`}
{`py.scope {`}
{`n = ${val}`}
{`fact = 1`}
{`i = 2`}
{`while i <= n:`}
{`    fact *= i`}
{`    i += 1`}
{`} py.scope`}
{`py.print(fact)`}

And quick test for set-matching by mapping set entries to primes

class DS extends Array {
    static get [ Symbol.species ] () {
        return Array
    }
    // Methods
    #primes = [2,3,5,7]
    #primeIDX = 0
    setCompare( n,m ) {
        let lhs = 1
        let rhs = 1
        let cache = {}
        while ( n.length || m.length ) {
            if( n.length ) {
                let c = 1
                if(n[0] in cache) {
                    c = cache[ n[0] ]
                } else {
                    c = this.#primes[ this.#primeIDX++ ]
                    cache[ n[0] ] = c
                }
                lhs *= c
                n.shift()
            }
            if( m.length ) {
                let d = 1
                if(m[0] in cache) {
                    d = cache[ m[0] ]
                } else {
                    d = this.#primes[ this.#primeIDX++ ]
                    cache[ m[0] ] = c
                }
                rhs *= d
                m.shift()
            }
        }
        return (lhs > 1) && (rhs > 1) && (rhs%lhs == 0)
    }
}

let ds = new DS()

let `()` = MetaStatement {
    `z`,
    `( $,... ) in ( $,... )` => ds.setCompare,
}
let {`r`} = `()`
let {`s`} = `()`
{`r( 2,7,9 ) in s( 2,7,12,9 )`} // true