From: "Mauricio Fernández" Date: 2003-04-27T03:53:26+09:00 Subject: Re: can you guess On Sun, Apr 27, 2003 at 03:29:14AM +0900, ahoward wrote: > > > what this prints: > > raise "NO FAIR RUNNING IT!" > > class String > def expand(*args) > % args > end > end > > template = "insert into foobar values('%s', '%s')" > puts(template.expand :foo, :bar) > > > if so, why? > % args is read as a string literal, ie. % args <=> "args" <=> %{args} <=> %Q{args} ^ ^ spaces Maybe spaces shouldn't be allowed as delimiters. -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com Footnotes are for things you believe don't really belong in LDP manuals, but want to include anyway. -- Joel N. Weber II discussing the 'make' chapter of LPG