(command.CommandList children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} { (braced_var_sub token: <Id.VSub_Name SPECIALFORMS_LAMBDA_SH> suffix_op: (suffix_op.Unary op_id:Id.VTest_Plus arg_word:{<true>}) ) } {<Id.Lit_RBracket ']'>} ) (command.ControlFlow token:<Id.ControlFlow_Return return>) ] ) (C {<declare>} {<-g>} {<Id.Lit_VarLike 'SPECIALFORMS_LAMBDA_SH='> <true>}) (C {<.>} { (braced_var_sub token: <Id.VSub_Name BASH_SOURCE> suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{<Id.Lit_Slash '/'> <'*'>}) ) <'/common.sh'> } ) (C {<.>} { (braced_var_sub token: <Id.VSub_Name BASH_SOURCE> suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{<Id.Lit_Slash '/'> <'*'>}) ) <'/test.sh'> } ) (C {<.>} { (braced_var_sub token: <Id.VSub_Name BASH_SOURCE> suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{<Id.Lit_Slash '/'> <'*'>}) ) <'/specialforms.sh'> } ) (C {<.>} { (braced_var_sub token: <Id.VSub_Name BASH_SOURCE> suffix_op: (suffix_op.Unary op_id:Id.VOp1_Percent arg_word:{<Id.Lit_Slash '/'> <'*'>}) ) <'/callable.lambda.sh'> } ) (command.ShFunction name: 'evaluator::specialforms::lambda' body: (BraceGroup children: [ (C {<declare>} {<Id.Lit_VarLike 'env='> (DQ (${ Id.VSub_Number 1))}) (C {<declare>} {<Id.Lit_VarLike 'functionName='> (DQ (${ Id.VSub_Number 2))}) (C {<declare>} {<Id.Lit_VarLike 'args='> (DQ (${ Id.VSub_Number 3))}) (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <length> } {($ Id.VSub_DollarName '$args')} ) terminator: <Id.Op_Semi _> ) (C {<declare>} {<-i>} {<Id.Lit_VarLike 'length='> (DQ (${ Id.VSub_Name RESULT))}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.Op_Less left: {($ Id.VSub_DollarName '$length')} right: {<2>} ) ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<stderr>} {(DQ <'usage: (if condition true-branch false-branch)'>)}) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [206 219] ) ] ) (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <first> } {($ Id.VSub_DollarName '$args')} ) terminator: <Id.Op_Semi _> ) (C {<declare>} {<Id.Lit_VarLike 'formalArgs='> (${ Id.VSub_Name RESULT)}) (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <rest> } {($ Id.VSub_DollarName '$args')} ) terminator: <Id.Op_Semi _> ) (C {<declare>} {<Id.Lit_VarLike 'expressions='> (${ Id.VSub_Name RESULT)}) (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <Lambda> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <new> } {(DQ (${ Id.VSub_Name env) <' '> (${ Id.VSub_Name formalArgs) <' '> (${ Id.VSub_Name expressions))} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:RESULT) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name RESULT))} spids: [302] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Number '$0')} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {($ Id.VSub_DollarName '$BASH_SOURCE')} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(command.ControlFlow token:<Id.ControlFlow_Return return>)] spids: [320 334] ) ] ) (command.CommandList children: [ (command.Sentence child:(C {<createTestEnv>}) terminator:<Id.Op_Semi _>) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:env) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name RESULT))} spids: [358] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <new> } ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:command) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name RESULT))} spids: [375] ) ] ) ] ) (C {<appendToList>} {($ Id.VSub_DollarName '$command')} {<Identifier>} {(DQ <lambda>)}) (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <new> } ) terminator: <Id.Op_Semi _> ) (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <append> } {($ Id.VSub_DollarName '$command')} {($ Id.VSub_DollarName '$RESULT')} ) (C {<appendToList>} {($ Id.VSub_DollarName '$command')} {<Integer>} {<1>}) (command.CommandList children: [ (command.Sentence child: (C {<evaluator> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <eval>} {($ Id.VSub_DollarName '$env')} {($ Id.VSub_DollarName '$command')} ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:lambda) op: assign_op.Equal rhs: {(${ Id.VSub_Name RESULT)} spids: [437] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <toSexp>} {(DQ (${ Id.VSub_Name lambda))} ) terminator: <Id.Op_Semi _> ) (C {<assert> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <equals>} {(DQ <'(lambda () 1)'>)} {(DQ (${ Id.VSub_Name RESULT))} {(DQ <'(lambda () 1)'>)} ) ] ) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <Lambda> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <getEnv> } {($ Id.VSub_DollarName '$lambda')} ) terminator: <Id.Op_Semi _> ) (C {<assert> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <equals>} {($ Id.VSub_DollarName '$env')} {($ Id.VSub_DollarName '$RESULT')} {(DQ <'<original env> = <stored env>'>)} ) ] ) (command.CommandList children: [ (command.Sentence child:(C {<createTestEnv>}) terminator:<Id.Op_Semi _>) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:env) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name RESULT))} spids: [520] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <new> } ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:command) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name RESULT))} spids: [537] ) ] ) ] ) (C {<appendToList>} {($ Id.VSub_DollarName '$command')} {<Identifier>} {(DQ <lambda>)}) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <new> } ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:argList) op: assign_op.Equal rhs: {(${ Id.VSub_Name RESULT)} spids: [566] ) ] ) ] ) (C {<appendToList>} {(${ Id.VSub_Name argList)} {<Identifier>} {<a>} {<Identifier>} {<b>} {<Identifier>} {<c>} ) (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <append> } {($ Id.VSub_DollarName '$command')} {($ Id.VSub_DollarName '$argList')} ) (C {<appendToList>} {($ Id.VSub_DollarName '$command')} {<Integer>} {<1>}) (command.CommandList children: [ (command.Sentence child: (C {<evaluator> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <eval>} {($ Id.VSub_DollarName '$env')} {($ Id.VSub_DollarName '$command')} ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:lambda) op: assign_op.Equal rhs: {(${ Id.VSub_Name RESULT)} spids: [622] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <toSexp>} {(DQ (${ Id.VSub_Name lambda))} ) terminator: <Id.Op_Semi _> ) (C {<assert> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <equals>} {(DQ <'(lambda (a b c) 1)'>)} {(DQ (${ Id.VSub_Name RESULT))} {(DQ <'(lambda (a b c) 1)'>)} ) ] ) (command.CommandList children: [ (command.Sentence child:(C {<createTestEnv>}) terminator:<Id.Op_Semi _>) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:env) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name RESULT))} spids: [678] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <new> } ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:command) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name RESULT))} spids: [695] ) ] ) ] ) (C {<appendToList>} {($ Id.VSub_DollarName '$command')} {<Identifier>} {(DQ <lambda>)}) (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <new> } ) terminator: <Id.Op_Semi _> ) (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <append> } {($ Id.VSub_DollarName '$command')} {($ Id.VSub_DollarName '$RESULT')} ) (C {<appendToList>} {($ Id.VSub_DollarName '$command')} {<Identifier>} {<x>} {<Identifier>} {<y>}) (command.CommandList children: [ (command.Sentence child: (C {<evaluator> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <eval>} {($ Id.VSub_DollarName '$env')} {($ Id.VSub_DollarName '$command')} ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:lambda) op: assign_op.Equal rhs: {(${ Id.VSub_Name RESULT)} spids: [761] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <toSexp>} {(DQ (${ Id.VSub_Name lambda))} ) terminator: <Id.Op_Semi _> ) (C {<assert> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <equals>} {(DQ <'(lambda () x y)'>)} {(DQ (${ Id.VSub_Name RESULT))} {(DQ <'(lambda () x y)'>)} ) ] ) (command.CommandList children: [ (command.Sentence child:(C {<createTestEnv>}) terminator:<Id.Op_Semi _>) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:env) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name RESULT))} spids: [817] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <new> } ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:command) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name RESULT))} spids: [834] ) ] ) ] ) (C {<appendToList>} {($ Id.VSub_DollarName '$command')} {<Identifier>} {(DQ <lambda>)}) (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <new> } ) terminator: <Id.Op_Semi _> ) (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <append> } {($ Id.VSub_DollarName '$command')} {($ Id.VSub_DollarName '$RESULT')} ) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <new> } ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:sc1) op: assign_op.Equal rhs: {(${ Id.VSub_Name RESULT)} spids: [886] ) ] ) ] ) (C {<appendToList>} {($ Id.VSub_DollarName '$sc1')} {<Identifier>} {<Id.Lit_Other '+'>} {<Integer>} {<1>} {<Integer>} {<2>} ) (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <append> } {($ Id.VSub_DollarName '$command')} {($ Id.VSub_DollarName '$sc1')} ) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <new> } ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:sc2) op: assign_op.Equal rhs: {(${ Id.VSub_Name RESULT)} spids: [930] ) ] ) ] ) (C {<appendToList>} {($ Id.VSub_DollarName '$sc2')} {<Identifier>} {<Id.Lit_Other '+'>} {<Integer>} {<2>} {<Integer>} {<3>} ) (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <LinkedList> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <append> } {($ Id.VSub_DollarName '$command')} {($ Id.VSub_DollarName '$sc2')} ) (command.CommandList children: [ (command.Sentence child: (C {<evaluator> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <eval>} {($ Id.VSub_DollarName '$env')} {($ Id.VSub_DollarName '$command')} ) terminator: <Id.Op_Semi _> ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:lambda) op: assign_op.Equal rhs: {(${ Id.VSub_Name RESULT)} spids: [975] ) ] ) ] ) (command.CommandList children: [ (command.Sentence child: (C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <toSexp>} {(DQ (${ Id.VSub_Name lambda))} ) terminator: <Id.Op_Semi _> ) (C {<assert> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <equals>} {(DQ <'(lambda () (+ 1 2) (+ 2 3))'>)} {(DQ (${ Id.VSub_Name RESULT))} {(DQ <'(lambda () (+ 1 2) (+ 2 3))'>)} ) ] ) (C {<assert> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <report>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<Id.Lit_LBracket '['>} { (braced_var_sub token: <Id.VSub_Number 1> suffix_op: (suffix_op.Unary op_id:Id.VTest_Plus arg_word:{<isset>}) ) } {<Id.Lit_RBracket ']'>} ) (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='> <Id.Lit_Equals '='>} {(DQ <debug>)} {<Id.Lit_RBracket ']'>} ) ] ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<variable> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <printMetadata>})] spids: [1024 1054] ) ] ) ] )