[Ecls-list] Small C/C++ Code Snippet For Output Redirection

Julian Fondren ayrnieu at gmail.com
Tue Feb 24 07:02:37 UTC 2009


> cl_safe_eval(c_string_to_object("(defvar *print-function* nil)")

etc.

I find these macros helpful:

#define READCL(expr) c_string_to_object(# expr)
#define READCLs(var) c_string_to_object(var)

as in:

  cl_eval(READCL((defpackage :cl-hello)));
  cl_eval(READCL((load "cl-hello.lisp")));
  cl_eval(READCL((hello)));
  cl_eval(READCL((defun cl-hello::hello-2 () (format t "Hello, world!~%"))));
  cl_eval(READCL((cl-hello::hello-2)));

from http://github.com/ayrnieu/ecl-examples/tree/master

Cheers,
Julian




More information about the ecl-devel mailing list