( def ed lambda ( ) ( progn ( cond ( ( null _FILENAME ) ( def _FILENAME "_untitled" ) ) ) ( sh ( strcat _EDITOR _FILENAME ) ) ( nload _FILENAME ) ) ) ;--------------------- ( def sort lambda ( x ) ( cond ( ( null x ) x ) ( ( and ( not ( null x ) ) ( is SET ANY x ) ) ( let ( ( H ( choice x ) ) ( T ( difference x ( makeset H ) ) ) ) ( sort ( seq z ( from z x ) ) ) ) ) ( ( lt ( length x ) 2 ) x ) ( ( and ( not ( null x ) ) ( is LIST ANY x ) ) ( let ( ( H ( hd x ) ) ( T ( tl x ) ) ) ( let ( ( a ( sort ( seq y ( from y T ( lt y H ) ) ) ) ) ( b ( sort ( seq y ( from y T ( geq y H ) ) ) ) ) ) ( append ( append a ( makeseq H ) ) b ) ) ) ) ) ) ;--------------------- ( def sort2 lambda ( f x ) ( cond ( ( null x ) x ) ( ( and ( not ( null x ) ) ( is SET ANY x ) ) ( let ( ( H ( choice x ) ) ( T ( difference x ( makeset H ) ) ) ) ( sort2 f ( seq z ( from z x ) ) ) ) ) ( ( lt ( length x ) 2 ) x ) ( ( and ( not ( null x ) ) ( is LIST ANY x ) ) ( let ( ( H ( hd x ) ) ( T ( tl x ) ) ) ( let ( ( a ( sort2 f ( seq y ( from y T ( lt ( f y H ) 0 ) ) ) ) ) ( b ( sort2 f ( seq y ( from y T ( geq ( f y H ) 0 ) ) ) ) ) ) ( append ( append a ( makeseq H ) ) b ) ) ) ) ) ) ;--------------------- ( def nload lambda ( f ) ( progn ( sh ( strcat ( strcat "seca " f ) "_tmp" ) ) ( load "_tmp" ) ) ) ;--------------------- ( def _ops ( plus _ops ( makeff ( ( quote getas ) ( quote ( ( ANY ) NIL ) ) ) ) ) ) ;--------------------- ( def getas lambda ( o ) ( if ( subset ( dom o ) ( makeset 'rs 'fs 'type 'com ) ) ( let ( ( comm ( strcat ( strcat ( strcat ( ap o 'com ) " | any2sexp " ) ( if ( equal ( ap o 'type ) 'tab ) "-sc" "" ) ) ( cond ( ( subset ( makeset 'rs 'fs ) ( dom o ) ) ( strcat ( strcat ( strcat ( strcat "-F -R '" ( ap o 'rs ) ) "' '" ) ( ap o 'rs ) ) "'" ) ) ( ( member 'rs ( dom o ) ) ( strcat ( strcat "-R '" ( ap o 'rs ) ) "'" ) ) ( ( member 'fs ( dom o ) ) ( strcat ( strcat "-F '" ( ap o 'rs ) ) "'" ) ) ( true "" ) ) ) ) ( a ( popen comm "r" ) ) ( b ( readf a ) ) ( __ ( pclose a ) ) ) b ) ( strcat "ERROR (precondition violated) in function " "getas" ) ) ) ;---------------------