On 11 Oct 2008, at 08:09, Ed Loach wrote:
[..]
As Matthias writes:
"From the
programmer's point of view I don't think it makes much of a
difference
whether the unit is stored in the key or in the value."

hrm with ruby if you are expecting a number in that field and try to parse it, the units will be lost:
Unknown-00-1f-5b-ec-f0-9b:~ shaunmcdonald$ ruby -v
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
Unknown-00-1f-5b-ec-f0-9b:~ shaunmcdonald$ irb
>> "30mph".to_i
=> 30
>>

http://ruby-doc.org/core/classes/String.html#M000802

Now there is a reason from a programmers point of view why units should be left out of the value.

(I now better run an hide while someone comes up with a way to parse that string into an object containing the speed and the units).


Shaun

_______________________________________________
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk

Reply via email to