EVAL function 
Author Message
 EVAL function

In Perl (or MacPerl), we have EVAL built-in function. Suppose we have a
string of arithmetic expression like "6+5" (or something more complex), we
can evaluate the value of the string simply by:

$str_a = "6+5";
$int_b = EVAL ($str_a);
PRINT $int_b;

The output would be 11.

Do we have equivalent function in RB? If not, any suggestion of
implementation (even for more complex arithmetic expressions)?

Thanks.

/TokiOU

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 25 Dec 2002 03:00:00 GMT  
 EVAL function
Actually yes .... there is a plug in to do this called ... Eval

You can get it here http://imru.bham.ac.uk/screenmath/evileval.sit.hqx

Quote:

> Organization: Deja.com - Before you buy.
> Newsgroups: comp.lang.basic.realbasic
> Date: Sat, 08 Jul 2000 15:40:34 GMT
> Subject: EVAL function

> In Perl (or MacPerl), we have EVAL built-in function. Suppose we have a
> string of arithmetic expression like "6+5" (or something more complex), we
> can evaluate the value of the string simply by:

> $str_a = "6+5";
> $int_b = EVAL ($str_a);
> PRINT $int_b;

> The output would be 11.

> Do we have equivalent function in RB? If not, any suggestion of
> implementation (even for more complex arithmetic expressions)?

> Thanks.

> /TokiOU

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Tue, 31 Dec 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Why is there no eval function in scheme?

2. eval() function

3. eval function

4. Function eval in Haskell?

5. Defining new global functions without eval.

6. eval to invoke a local function?

7. eval to call function

8. "eval" function

9. Call to undefined function eval

10. Adding functions at runtime - understanding eval

11. Adding functions at runtime - understand eval

12. Dynamic creation of generic functions without eval?

 

 
Powered by phpBB® Forum Software