[tcltk-perl] Re: scalar($w->getOpenFile)
Brought to you by:
hobbs
From: Gisle A. <gi...@Ac...> - 2004-04-21 18:31:37
|
"Jeff Hobbs" <je...@Ac...> writes: > > > The thing is that there is a difference, it's just very, very subtle. > > > The problem is that the subtle distinctions are very important. > > > > So tell me what breaks if we do it like this. > > With your changes, it all remains correct, but you have to > make those changes only to work around a bug IMO. You cannot > generally make the statement that all Tcl lists should be > scalar-ized, as that will ruin performance without purpose. I don't believe it will hurt performance, especially if you look for void context and avoids doing any work at all in that case. What hurts is returning big list in scalar context. How often does that happen? If it turns out to be a problem, then the next step it to return some wrapper object in scalar context instead. The wrapper will automatically stringify if used as a string, but you can still use it as a list if it is a list. I would not go to this complexity before it is proven that it is worth it. --Gisle |