rb_load_file crashes when there no bracket is provided

S

Saravanan Sar

Hi,

When i tried to load the below mentioned code using rb_load_file it
works

def Category(pArg1)
lvalue = ("\"" + "CatA" + "\"" + pArg1)
eval "#{lvalue}"
end

def is(pArg1)
return "==\"" + pArg1 + "\""
end

i = Category(is('CatB'))

But when i changed the line
i = Category(is('CatB')) to
i = Category is 'CatB' #removing the brackets
rb_load_file crashes. btw i am using borland c++ 6.0

How to solve this problem?

Thanx in advance.

Cheers,
Saravanan A
 
S

Saravanan Sar

Phil said:
Why do you need to remove brackets?

This is basically a set of rules that our client will define. I am
writing DSL so that it will be easy for our client. When i execute the
same using ruby.exe it works but with bracket warning. I think
rb_load_file is crashing because of this warning message.

Please help me

Regards,
Saravanan A
 
S

Saravanan Sar

when rb_gv_set("VERBOSE", Qnil)is executed, it works fine. Basically
this will suppress all the warnings. This is equivalent to "ruby -w"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,311
Members
47,985
Latest member
kazewi

Latest Threads

Top