From: Konrad Meyer Date: 2007-09-29T03:35:59+09:00 Subject: Re: Can we have these two added to ERb? --nextPart2375444.YyQukg1AuU Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Quoth SpringFlowers AutumnMoon: > I like Ruby tremendously... >=20 > and currently having some headache with the "$" and ";" in PHP, like >=20 > $i =3D $j; >=20 > in every single line, vs Ruby's simplicity >=20 > i =3D j >=20 > maybe the $i is so that outputting the variable is easy in >=20 > print "the value is $i" > in ERb, we need to write >=20 > "the value is #{i}" >=20 > and it is a bit more typing. can we have something like >=20 > "the value is ##i" as a shorthand? and use #{ } when it involves more > complicated expressions? >=20 > The other thing is that in PHP, they use "print" and "echo" to output > the HTML code. In Ruby, we always use <%=3D evaluated_value %> and it > might have a limit of always breaking up the code into <% %> and <%=3D > %> and <% %> >=20 > <% results.each do |k,v| %> > <%=3D "#{k} #{v}" %> > <% end %> >=20 > the people who like to use inject may be happy because they can have it > all in one line <%=3D results.inject {|k,v| k +=3D ... %> >=20 > but if we can have some way that the STDOUT is made into HTML code, like >=20 > <%p results.each {|k,v| printf "... " %> >=20 > or >=20 > <%p >=20 > code >=20 > %> >=20 >=20 > then it can give us some ease when templating. PHP has shorthand as well. =2D-=20 Konrad Meyer http://konrad.sobertillnoon.com/ --nextPart2375444.YyQukg1AuU Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBG/UmJCHB0oCiR2cwRAkMwAKCVh9LsVzktr7w3s05ISR/WSYyfkwCgv2zr j99oJPj4wGf2+JVlBA1DvmI= =BSHe -----END PGP SIGNATURE----- --nextPart2375444.YyQukg1AuU--