Evaluating a String as code -djb

Ned Konz ned at bike-nomad.com
Sat Feb 8 20:59:56 UTC 2003


On Saturday 08 February 2003 12:40 pm, Derek Brans wrote:
> Given a string, is there anyway to evaluate its contents as code in
> the current context?
>
> Essentially I want to write a function that given a string like
> this:
>
> ' This is a test of < | foo | foo := self bar. foo upperCase. > to
> see if it works '
>
> returns a string like this:
>
> 'This is a test of Something to see if it works'

Look at the various messages whose names begin with "evaluate".

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list