View Source Document

env.robin

;'<<SPEC'

    -> Tests for functionality "Evaluate Robin Expression (with Small)"

`env` evaluates to all the bindings in effect at the point of execution
where this form is encountered, as an alist.

    | (bind lookup-r
    |   (fexpr (args env)
    |     (bind self (eval env (head args))
    |       (bind target (eval env (head (tail args)))
    |         (bind items (eval env (head (tail (tail args))))
    |           (if (equal? items ()) ()
    |             (if (equal? (head (head items)) target) (tail (head items))
    |               (self self target (tail items))))))))
    |   (lookup-r lookup-r (literal symbol?) (env)))
    = (symbol?)

`env` expects no arguments.  Any arguments supplied will be simply ignored
and discarded, without being evaluated.

    | (bind lookup-r
    |   (fexpr (args env)
    |     (bind self (eval env (head args))
    |       (bind target (eval env (head (tail args)))
    |         (bind items (eval env (head (tail (tail args))))
    |           (if (equal? items ()) ()
    |             (if (equal? (head (head items)) target) (tail (head items))
    |               (self self target (tail items))))))))
    |   (lookup-r lookup-r (literal symbol?) (env (goofah whatever))))
    = (symbol?)

'<<SPEC'

(define env (fexpr (args env) env))