-/* uLisp AVR Version 4.0 - www.ulisp.com
-   David Johnson-Davies - www.technoblogy.com - 7th July 2021
+/* uLisp AVR Version 4.0a - www.ulisp.com
+   David Johnson-Davies - www.technoblogy.com - 9th July 2021
    
    Licensed under the MIT license: https://opensource.org/licenses/MIT
 */

  return tf_progn(function, *env);
}

object *apply (symbol_t name, object *function, object *args, object *env) {
  if (symbolp(function)) {
    builtin_t fname = builtin(function->name);
    if ((fname > FUNCTIONS) && (fname < KEYWORDS)) {

    } else function = eval(function, env);
  }
  if (consp(function) && isbuiltin(car(function), LAMBDA)) {
    object *result = closure(0, sym(name), function, args, &env);
    return eval(result, env);
  }
  if (consp(function) && isbuiltin(car(function), CLOSURE)) {
    function = cdr(function);
    object *result = closure(0, sym(name), function, args, &env);
    return eval(result, env);
  }
  error(name, PSTR("illegal function"), function);
  return NULL;
}

