Accessing lib functions without braces

View: New views
4 Messages — Rating Filter:   Alert me  

Accessing lib functions without braces

by Veena Gondhalekar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Is there a way to access/execute user-defined precompiled library functions
from the interactive cint interface WITHOUT using braces?

For example, if I have the following function in my file myfuncs.h:

void add(int a, int b);    // displays result a+b

and create a customized interpreter "mycint" with makecint that embeds
the above function, I would like to invoke add() from the interactive
environment without the braces, i.e. I would like to do -

=======
>
> mycint

(..... interactive interface started....)

mycint> add(456, 123)
579
mycint> quit
>
=======


Is there a way to do the above? Currently, I can only invoke add() with the
braces as follows:

=======
> mycint

(..... interactive interface started....)

mycint> {add(456, 123);}
579
mycint> quit
>
========

That seems rather painful. It's very easy to miss a brace or the semicolon!

All the examples in the demo directory for makecint invoke user-defined
archived library functions from other files and not from the interactive
environment.

I've had some success by faking it with G__init_cint(), G__calc()  etc., but
that fails as soon as the arguments of the called functions get somewhat
complicated or have white spaces.  And I also don't have the actual
interactive interpreter environment anymore, e.g., I can't invoke the
previous call(s) using the up-arrow on the keyboard.

Thanks for any pointers.


Veena



Re: Accessing lib functions without braces

by Axel Naumann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Veena,

you can switch to CINT's other prompt mode by defining the proprocessor
macro -DG__ROOT when building cint. I will make that a bit more
accessible soon. Let me know if that does what you need.

Cheers, Axel

Veena Gondhalekar wrote:

> Hi all,
>
> Is there a way to access/execute user-defined precompiled library functions
> from the interactive cint interface WITHOUT using braces?
>
> For example, if I have the following function in my file myfuncs.h:
>
> void add(int a, int b);    // displays result a+b
>
> and create a customized interpreter "mycint" with makecint that embeds
> the above function, I would like to invoke add() from the interactive
> environment without the braces, i.e. I would like to do -
>
> =======
>> mycint
>
> (..... interactive interface started....)
>
> mycint> add(456, 123)
> 579
> mycint> quit
> =======
>
>
> Is there a way to do the above? Currently, I can only invoke add() with the
> braces as follows:
>
> =======
>> mycint
>
> (..... interactive interface started....)
>
> mycint> {add(456, 123);}
> 579
> mycint> quit
> ========
>
> That seems rather painful. It's very easy to miss a brace or the semicolon!
>
> All the examples in the demo directory for makecint invoke user-defined
> archived library functions from other files and not from the interactive
> environment.
>
> I've had some success by faking it with G__init_cint(), G__calc()  etc., but
> that fails as soon as the arguments of the called functions get somewhat
> complicated or have white spaces.  And I also don't have the actual
> interactive interpreter environment anymore, e.g., I can't invoke the
> previous call(s) using the up-arrow on the keyboard.
>
> Thanks for any pointers.
>
>
> Veena
>
>
>


Re: Accessing lib functions without braces

by Veena Gondhalekar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Axel,

I see no difference with -DG__ROOT. I still need the semicolon and the
braces to call my library functions.
Thanks.

Veena



On 1/30/08 1:23 AM, "Axel Naumann" <Axel.Naumann@...> wrote:

> Hi Veena,
>
> you can switch to CINT's other prompt mode by defining the proprocessor
> macro -DG__ROOT when building cint. I will make that a bit more
> accessible soon. Let me know if that does what you need.
>
> Cheers, Axel
>
> Veena Gondhalekar wrote:
>> Hi all,
>>
>> Is there a way to access/execute user-defined precompiled library functions
>> from the interactive cint interface WITHOUT using braces?
>>
>> For example, if I have the following function in my file myfuncs.h:
>>
>> void add(int a, int b);    // displays result a+b
>>
>> and create a customized interpreter "mycint" with makecint that embeds
>> the above function, I would like to invoke add() from the interactive
>> environment without the braces, i.e. I would like to do -
>>
>> =======
>>> mycint
>>
>> (..... interactive interface started....)
>>
>> mycint> add(456, 123)
>> 579
>> mycint> quit
>> =======
>>
>>
>> Is there a way to do the above? Currently, I can only invoke add() with the
>> braces as follows:
>>
>> =======
>>> mycint
>>
>> (..... interactive interface started....)
>>
>> mycint> {add(456, 123);}
>> 579
>> mycint> quit
>> ========
>>
>> That seems rather painful. It's very easy to miss a brace or the semicolon!
>>
>> All the examples in the demo directory for makecint invoke user-defined
>> archived library functions from other files and not from the interactive
>> environment.
>>
>> I've had some success by faking it with G__init_cint(), G__calc()  etc., but
>> that fails as soon as the arguments of the called functions get somewhat
>> complicated or have white spaces.  And I also don't have the actual
>> interactive interpreter environment anymore, e.g., I can't invoke the
>> previous call(s) using the up-arrow on the keyboard.
>>
>> Thanks for any pointers.
>>
>>
>> Veena
>>
>>
>>
>


Re: Accessing lib functions without braces

by Axel Naumann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Veena,

uh, right, I'm terribly sorry for wasting your time rebuilding CINT - I
actually should have realized that :-/

The easiest solution is to set INPUTMODE in configure to "c++". I will add a
switch for that at some point (it's now on my to-do list).

Cheers, Axel.

On 2008-01-30 17:00, Veena Gondhalekar wrote:

> Hi Axel,
>
> I see no difference with -DG__ROOT. I still need the semicolon and the
> braces to call my library functions.
> Thanks.
>
> Veena
>
>
>
> On 1/30/08 1:23 AM, "Axel Naumann" <Axel.Naumann@...> wrote:
>
>> Hi Veena,
>>
>> you can switch to CINT's other prompt mode by defining the proprocessor
>> macro -DG__ROOT when building cint. I will make that a bit more
>> accessible soon. Let me know if that does what you need.
>>
>> Cheers, Axel
>>
>> Veena Gondhalekar wrote:
>>> Hi all,
>>>
>>> Is there a way to access/execute user-defined precompiled library functions
>>> from the interactive cint interface WITHOUT using braces?
>>>
>>> For example, if I have the following function in my file myfuncs.h:
>>>
>>> void add(int a, int b);    // displays result a+b
>>>
>>> and create a customized interpreter "mycint" with makecint that embeds
>>> the above function, I would like to invoke add() from the interactive
>>> environment without the braces, i.e. I would like to do -
>>>
>>> =======
>>>> mycint
>>> (..... interactive interface started....)
>>>
>>> mycint> add(456, 123)
>>> 579
>>> mycint> quit
>>> =======
>>>
>>>
>>> Is there a way to do the above? Currently, I can only invoke add() with the
>>> braces as follows:
>>>
>>> =======
>>>> mycint
>>> (..... interactive interface started....)
>>>
>>> mycint> {add(456, 123);}
>>> 579
>>> mycint> quit
>>> ========
>>>
>>> That seems rather painful. It's very easy to miss a brace or the semicolon!
>>>
>>> All the examples in the demo directory for makecint invoke user-defined
>>> archived library functions from other files and not from the interactive
>>> environment.
>>>
>>> I've had some success by faking it with G__init_cint(), G__calc()  etc., but
>>> that fails as soon as the arguments of the called functions get somewhat
>>> complicated or have white spaces.  And I also don't have the actual
>>> interactive interpreter environment anymore, e.g., I can't invoke the
>>> previous call(s) using the up-arrow on the keyboard.
>>>
>>> Thanks for any pointers.
>>>
>>>
>>> Veena
>>>
>>>
>>>
>
>

LightInTheBox - Buy quality products at wholesale price