On Sat, Mar 22, 2003 at 12:12:16AM +0900, Chris Pine wrote:
> Honestly, I'd be a little surprised if this got in to the language.
> Depending on your situation (you're trying to make a special-purpose
> language, right?) it might be better to write your own interpreter on top of
> Ruby, snarfing generously.
> 
> For example, if you have a string of code like:
> 
>   foo << { doSomethingHere }
> 
> you could just split the string on the first '<<' and eval the substrings.
> Depending on how robust you need your language to be (I'm assuming not very,
> since you were writing it for people who aren't really programmers, IIRC),
> this should be a relatively easy task, and perfect for Ruby.  There's no
> reason the code used has to be readable by the actual Ruby interpreter, if
> you can write a couple-hundred line interpreter as a go-between.

It'd be easier to make a preprocessor to transform, say
  a <== val
into
  a.__value__=(value)

which moreover allows 
 a <== val1, val2, val3
which might be useful.


-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

martin / bdsi.com (no longer valid - where are you now, Martin?)
	-- from /usr/src/linux/drivers/cdrom/mcd.c