<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-10162639.post5049529012580336784..comments</id><updated>2009-10-12T17:49:24.482-03:00</updated><category term='ruby'/><category term='classic paper'/><category term='scheme'/><category term='theory'/><category term='scala'/><category term='design patterns'/><category term='java'/><category term='REST'/><category term='security'/><category term='smalltalk'/><category term='soa'/><category term='culture'/><category term='economy'/><category term='information'/><category term='UI'/><category term='metaprogramming'/><category term='music'/><category term='event'/><category term='lisp'/><category term='concurrency'/><category term='book'/><category term='gui'/><category term='component'/><category term='misc'/><category term='mvc'/><category term='exceptions'/><category term='software architecture'/><category term='Sun'/><category term='agile'/><category term='oo'/><category term='DSL'/><category term='tips'/><category term='rails'/><category term='software engineering'/><category term='functional programming'/><category term='coding'/><category term='programming languages'/><category term='review'/><category term='usability'/><category term='rant'/><category term='subversion'/><category term='database'/><title type='text'>Comments on Rafael rambling: Type-safe printf in scala ‽</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.rafaelferreira.net/feeds/5049529012580336784/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10162639/5049529012580336784/comments/default'/><link rel='alternate' type='text/html' href='http://blog.rafaelferreira.net/2009/10/type-safe-printf-in-scala.html'/><author><name>Rafael Ferreira</name><uri>https://profiles.google.com/111735374328481001879</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh3.googleusercontent.com/-uPn1e9oH3dU/AAAAAAAAAAI/AAAAAAAAAAA/YiTmAAqz4Ns/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-10162639.post-4417261088897061888</id><published>2009-10-12T17:49:24.482-03:00</published><updated>2009-10-12T17:49:24.482-03:00</updated><title type='text'>Hi Quintesse. Yes, it should be possible to write ...</title><content type='html'>Hi Quintesse. Yes, it should be possible to write the code in the manner you propose, applying the pimp-my-library pattern to the Int and Calendar classes to add a format method to them. The repetition of &amp;quot;.format(...)&amp;quot; for each argument would be ugly, but not that much.&lt;br /&gt;&lt;br /&gt;But, to be honest, practicality wasn&amp;#39;t my main goal in this exercise. Foremost, because most of time I have to use printf (or .format) is in order to concatenate .toString()&amp;#39;s without any special formatting. The most elegant solution to this case seems to be plain variable interpolation, which sadly Scala lacks.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10162639/5049529012580336784/comments/default/4417261088897061888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10162639/5049529012580336784/comments/default/4417261088897061888'/><link rel='alternate' type='text/html' href='http://blog.rafaelferreira.net/2009/10/type-safe-printf-in-scala.html?showComment=1255380564482#c4417261088897061888' title=''/><author><name>Rafael de F. Ferreira</name><uri>http://www.blogger.com/profile/03350776762967743057</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.rafaelferreira.net/2009/10/type-safe-printf-in-scala.html' ref='tag:blogger.com,1999:blog-10162639.post-5049529012580336784' source='http://www.blogger.com/feeds/10162639/posts/default/5049529012580336784' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1552232444'/></entry><entry><id>tag:blogger.com,1999:blog-10162639.post-2440115802802583556</id><published>2009-10-12T09:36:40.766-03:00</published><updated>2009-10-12T09:36:40.766-03:00</updated><title type='text'>I&amp;#39;m not sure where the value is in this. One o...</title><content type='html'>I&amp;#39;m not sure where the value is in this. One of the advantages of the original method, a single string with formatters, is that you can easily translate it for example. You just give the entire text to a translator and either tell them to leave the formatters alone, only moving them to their correct grammatical position in the sentence, or adjust the formatters to the local customs if necessary.&lt;br /&gt;With your solution that possibility is completely gone.&lt;br /&gt;&lt;br /&gt;I must also say I find it:&lt;br /&gt;a) hardly readable, and&lt;br /&gt;b) I don&amp;#39;t see the advantage over something like this:&lt;br /&gt;&lt;br /&gt;(133.7).format(0, 2) + &amp;quot; USD at &amp;quot; Calendar.getInstance().format(T)&lt;br /&gt;&lt;br /&gt;(this is non-working code of course, but I&amp;#39;m sure something like this could be made)&lt;br /&gt;&lt;br /&gt;Cheers</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10162639/5049529012580336784/comments/default/2440115802802583556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10162639/5049529012580336784/comments/default/2440115802802583556'/><link rel='alternate' type='text/html' href='http://blog.rafaelferreira.net/2009/10/type-safe-printf-in-scala.html?showComment=1255351000766#c2440115802802583556' title=''/><author><name>Quintesse</name><uri>http://www.blogger.com/profile/08969133867152074451</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.rafaelferreira.net/2009/10/type-safe-printf-in-scala.html' ref='tag:blogger.com,1999:blog-10162639.post-5049529012580336784' source='http://www.blogger.com/feeds/10162639/posts/default/5049529012580336784' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-805446829'/></entry></feed>
