(This is a snapshot of my old weblog. New posts and selected republished essays can be found at raganwald.com.) Pete Forde of Unspace emailed to say that the very first time he tried andand, he discovered a bug: nil => nil nil.present? => false nil.andand.present? => true Reg: Embarrassing. Pete: No sir. Not embarrassing, because no one’s ever going to find out they’re down here. Because you’re go
(This is a snapshot of my old weblog. New posts and selected republished essays can be found at raganwald.com.) def formatted_zip_code(digits) case digits.size when 4 then "0#{digits}" when 3 then "00#{digits}" else digits end end This code reads pretty much as the author would have explained how to handle the “digits” variable: If it only has four digits, pre-pend it with a zero. If it only has t
(This is a snapshot of my old weblog. New posts and selected republished essays can be found at raganwald.com.) Well, you recall my mentioning how real life is a lot like high school. The latest manifestation of this is an “Arc backlash.” In case you haven’t seen it, Arc is a programming language designed by Paul Graham and (I think) Robert Morris. Actually, it’s a Lisp dialect, so in some respect
(This is a snapshot of my old weblog. New posts and selected republished essays can be found at raganwald.com.) At Mobile Commons, we have to write a lot of code under time constraints. We also work on a fairly distributed basis, which means that writing readable code is not a luxury, it’s a necessity. We can’t afford to be clever for clever’s sake, but if a new idiom helps make our code easier fo
(This is a snapshot of my old weblog. New posts and selected republished essays can be found at raganwald.com.) I am a long-time fan of self-hosted languages. In that post I listed the reasons I thought that a language should be mostly or entirely written in itself. Here’s another reason writing a language in itself is important: If a language’s core libraries and frameworks are written in that la
(This is a snapshot of my old weblog. New posts and selected republished essays can be found at raganwald.com.) Breaking news! The irb enhancement gem Utility Belt includes String#to_proc String#to_proc is an addition to Ruby’s core String class to enable point-free hylomorphisms… I’ll start again. String#to_proc adds a method to Ruby’s core String class to make lots of mapping and reducing operat
(This is a snapshot of my old weblog. New posts and selected republished essays can be found at raganwald.com.) Anamorphisms are functions that map from some object to a more complex structure containing the type of the object. They are the dual—a fancy word for complement—of Catamorphisms, functions that map from some complex structure down to a simpler object. In simpler terms, a Catamorphism is
(This is a snapshot of my old weblog. New posts and selected republished essays can be found at raganwald.com.) Ken Tilton asked: What is up the power continuum from Lisp? I don’t have a ready answer. However, just because I don’t have an answer doesn’t mean I don’t believe there’s an answer. It could be that Lisp is a little like Democracy. It could be the least powerful programming language poss
(This is a snapshot of my old weblog. New posts and selected republished essays can be found at raganwald.com. A reformatted and cleaned up version of this post can be found here.) I recently re-read the amazing paper Why Functional Programming Matters (“WhyFP”). Although I thought that I understood WhyFP when I first read it a few years ago, when I had another look last weekend I suddenly underst
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く