Wexpr - References

Author: thothonegan
Tags: gamedev endless wolf_engine wexpr

Quick little update: recently added references to Wexpr. Taken from YAML [called anchors and aliases there] it basically alows a part of the expression to be automatically copied to another part of the expression.

For example: [click here for the basic Wexpr spec]

    ; define a reference named 'commonLeft'
    ; which is the contents of 'idle-left'
    idle-left [commonLeft] @( 
        frames #[f0]
    ; copy 'commonLeft' so that walk-left is the same as idle-left
    walk-left *[commonLeft]

While I dont want to expand Wexpr to be as complex as YAML (more of a souped up JSON), this is one feature i've ended up using a lot in certain files, and its nice to have in Wexpr now.