From: Robert Feldt Date: 2003-08-22T21:00:47+09:00 Subject: Re: NODE_DSTR and NODE_EVSTR? skrev den Fri, 22 Aug 2003 20:53:52 +0900: > Hi, > > At Fri, 22 Aug 2003 20:33:25 +0900, > Robert Feldt wrote: >> How are "dynamic" strings represented internally? > > NodeDump or ii would help you. > Have you been able to compile them with 1.8? I haven't. >> I thought >> >> "a#{b}" >> >> was represented >> >> DSTR["a", EVSTR[STR["b"]] > > It is represented as DSTR["a", EVSTR[b]], in your style. > Ok, thanks, it's a bug in my own dumper that mislead me. >> As a concrete example how is >> >> "a#{b}_c#{1+d}" >> >> represented in the internal parse tree? > > DSTR["a", EVSTR[b], "_c", EVSTR[1+d]] > > In 1.8, it will be executed as: > > "a" << b.to_s << "_c" << (1+d).to_s > > Just except with internal functions (correspond to to_s and <<) > will be used directly instead of ordinary methods calls. > Thanks, Robert