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.

Published by olleolleolle

Olle is a programmer, enjoying sunny Malmö in Sweden.

Join the Conversation

1 Comment

  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 comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.