"Ary Manzana" <a...@esperanto.org.ar> wrote in message news:jjbg62$2vi3$1...@digitalmars.com... > On 3/8/12 4:04 PM, Jonathan M Davis wrote: >> On Thursday, March 08, 2012 06:55:17 Steven Schveighoffer wrote: >>> On Wed, 07 Mar 2012 21:14:34 -0500, Ary Manzana<a...@esperanto.org.ar> >>> >>> wrote: >>>> The problem is not mistaking it with something else. The problem is >>>> when >>>> you want to write it. In Ruby my mind works like this: >>>> >>>> Mind: "How would I get a span for 5 seconds?" >>>> Mind: "Let's try 5.seconds" >>>> Mind: "Wow, it works!" >>>> >>>> I'm trying to remember cases when I just wrote what my mind thought it >>>> was correct and I was *so* surprised it worked out of the box in Ruby. >>>> Like writing array.last, and get it to work, instead of >>>> array[array.length - 1]. But in D, from the docs >>>> (http://dlang.org/arrays.html ) >>>> >>>> bar[$-1] // retrieves last element of the array >>>> >>>> I read: bar dollar minus one wait what?? >>> [...] >> >> Yeah. I don't understand how anyone can expect to just write code and >> have it >> work without looking anything up. > > I just stumbled upon this again in Ruby. I have a time object. I want to > know if it's in the past. I wrote: > > time.past? > > it worked! :-)
I don't like to do such things (especially in dynamic languages). I'd be concerned about it *seeming* to work, but not exactly as I expect. Just seems to be programming by guesswork and assumptions. I don't trust it.