Io gets Ruby-style string interpolation

Io

This is nice for people who come to Io from Ruby: Io, the language, now has…

a C implementation of interpolate (by trevor with help from jer)

Just to give people a heads-up on this point. There is a slight
change in behaviour. Instead of using #io{...} to interpolate your
code, you now use #{...}. As well, instead of the string being
returned being mutable, it is now immutable.

Which is in the new tarball release.

Update: Whoops! You need to send an interpolate message to get the interpolation. Not like in Ruby, where it’s automatic. Thanks Jeremy Tregunna, for correcting! And for stopping by.

One thought on “Io gets Ruby-style string interpolation

  1. It’s actually not Ruby-style. In Ruby, interpolation happens automatically, in Io, you have to explicitly pass an “interpolate” message to your string. But we’ve had this going on a year now.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>