#!/bin/bash source ${BASH_SOURCE%/*}/test.sh # ------------------------------------------------------------ setglobal value = $[../lishp.sh << """ ((lambda () 10) ) """ ] assert::equals "Integer :: 10" $(value) "Basic lambda without parameters" # ------------------------------------------------------------ setglobal value = $[../lishp.sh << """ ((lambda (x y) (+ x y)) 5 10) """ ] assert::equals "Integer :: 15" $(value) "Basic lambda with parameters" # ------------------------------------------------------------ setglobal value = $[../lishp.sh << """ ( ( (lambda (x) (lambda (y) (+ x y)) ) 2) 3) """ ] assert::equals "Integer :: 5" $(value) "Returning lambda with closure" assert::report