BlockClosure

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

BlockClosure

pdigonzelli
Hi all. I need to know how can I convert a string or a Stream content into a
BlockClosure instance.
My point is  i want to write a formula wich has literals. then i want to
replace the literals for specific magnitudes and in the formula and
evaluate the result.

how anyone help me?
TIA
Pablo


Reply | Threaded
Open this post in threaded view
|

Re: BlockClosure

Yar Hwee Boon-3
On Mon, 6 Dec 2004 03:44:13 -0300, Pablo Digonzelli  
<[hidden email]> wrote:

> Hi all. I need to know how can I convert a string or a Stream content  
> into a
> BlockClosure instance.
> My point is  i want to write a formula wich has literals. then i want to
> replace the literals for specific magnitudes and in the formula and
> evaluate the result.

Not sure how complex is your formula, but have you looked at parsers like  
SmaCC?

--
Regards
HweeBoon
MotionObj


Reply | Threaded
Open this post in threaded view
|

Re: BlockClosure

Ian Bartholomew-19
In reply to this post by pdigonzelli
Pablo,

> My point is  i want to write a formula wich has literals. then i want to
> replace the literals for specific magnitudes and in the formula and
> evaluate the result.

I'm confused as to why you can't us a BlockClosure in the normal way - where
the literals are block variables and you pass the actual values as arguments
to the block when it is evaluated.

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.


Reply | Threaded
Open this post in threaded view
|

Re: BlockClosure

Bruno Buzzi Brasesco-2
In reply to this post by pdigonzelli
myBlockClosureFromString := Compiler evaluate: '[:each | each class
printString]'.

Be carefull about the evaluation context (Compiler evaluete:in:).

Regards Bruno

"Pablo Digonzelli" <[hidden email]> escribió en el mensaje
news:[hidden email]...

> Hi all. I need to know how can I convert a string or a Stream content into
> a
> BlockClosure instance.
> My point is  i want to write a formula wich has literals. then i want to
> replace the literals for specific magnitudes and in the formula and
> evaluate the result.
>
> how anyone help me?
> TIA
> Pablo
>
>