﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
1029	API para CINT, el intérprete de C y C++	Víctor de Buen Remiro	Víctor de Buen Remiro	"[http://root.cern.ch/drupal/content/cint CINT] es un intérprete de C y C++ open source que permite ejecutar código sin tener que compilar ni crear un fichero ejecutable. El resultado es más lento que el código compilado pero aún así es mucho más rápido que TOL y que la mayoría de los intérpretes de lenguajes de alto nivel.

Mediante la [http://root.cern.ch/viewvc/trunk/cint/doc/cintapi.txt API  de CINT con C] sería posible desde TOL cargar y descargar ficheros  con funciones C y C++ y ejecutar sentencias que las usaran. Esta API sería especialmente útil a la hora de programar ciclos de cálculo largos que en TOL resultan demasiado lentos y que no precisan el uso de los tipos abstractos, sino que pueden expresarse mediante los tipos más simples Real, Text, Date y Matrix

Existen dos funciones para la carga y descarga de funciones en el ámbito global.
{{{
#!cpp
 int G__loadfile(const char *file);
/*
        G__loadfile() incrementally loads source file.
*/

 int G__unloadfile(const char *file);
/*
        G__unloadfile()  unloads source file. If any of the func-
       tions  included  in  the  file  is  busy,  G__unloadfile()
       returns error code (-1) and won't unload it.
*/
}}}

Existen otras dos funciones para la llamada a código interpretado desde C/C++.
{{{
#!cpp
 [anytype] G__calc(char *expression);
/*
        G__calc() evaluates C expression.  It returns the type of
       object  the  argument  expression  returns.  Variables and
       function calls can be used in  the  expression.   Declara-
       tion,  loop  and  conditional statement can not be used in
       the expression.
*/
            int i;
            double a;
            i = G__calc(""1+2+3"");  // returns int
            a = G__calc(""3.14*i"");  // returns double

 [anytype] G__exec_tempfile(char *file);
/*
        G__exec_tempfile() opens temporal source file and execute
       it  in  the  current  context.   The tempfile can contain,
       variable   declaration,   struct,union,enum    definition.
       expression,  loop and control statement and cannot contain
       function definition.  G__exec_tempfile() executes a state-
       ment or statement list surrounded by '{' , '}' and returns
       the last evaluated value.
*/
            {    // example of tempfile
                 int i;
                 double ary[100];
                 for(i=0;i<100;i++) ary[i] = i;
            }
/*
       Then in the main program, you can execute above  statement
       by G__exec_tempfile.
*/
}}}


"	task	closed	highest	TOL Extensions	Kernel	head	critical	fixed		
