From: William James Date: 2005-09-01T08:26:24+09:00 Subject: Re: Semantics of << and <<- Anders H�ckersten wrote: > Hi, > I recently joined this list, so please forgive me if this question has > been asked recently. I am wondering about the precise semantics of << > and <<-. "Programming Ruby"[1] and the pseudo-BNFs[2][3] say that you > can use a quoted string after <<. As I see it, this means I should be > able to able to use the #{expr} construct inside this string, like this: > print <<"#{2+2}" > foobar > #{4} The purpose of quoting the here-document label is to make the text be treated as though it were enclosed in single quotes. ---------------------------------------------- puts <<'HERE' #{3**3} bells. HERE puts <<"HERE" #{3**3} bells. HERE puts <