| stouset | If everything was a two digit number, or five digit number, or what have you, there'd be no need to do a to_i conversion. Just use character code comparisons. Fuck, you know what you ought to do? |
| Phenax | What? |
| stouset | Make a class for these crazy things. Whatever they are. Make a class to represent them. class FuckedString < String; end, for all I care. then include Comparable, define <=> on it, and be done. |
| rob5 | ~~~~ bad word alert ~~~~ |
| stouset | Object orientation is your friend. There are no bad words. Only bad thoughts. Given, I'm generally guilty of that. |
| starnix17 | can anyone show me an example of how to cycle through an array of hashes, but only cycle through one hash key instead of the whole hash? |
| Phenax | stouset: What is "Comparable" if you don't mind? |
| halorgium | Phenax: a module |
| cdcarter | Phenax: its a module that gives you some awesome methods assuming you have <=> defined |
| stouset | Phenax: ri Comparable Phenax: Generally speaking, "ri #{anything_you_dont_know} ".sub %r{\n}, '' |
| rob5 | this lambda character is very hard to understand |
| halorgium | stouset: no need for a Regex there "\n" will do it |
| stouset | halorgium: Pfft, it gets converted to a regex anyway. |
| cdcarter | rob5: lambdas are anonymous blocks that contain the environment in which they were created. they are objects |
| kith | again i'm having this "cant pass arguments to def initialize when its a singleton" thingy... geez |
| stouset | rob5: lambdas are just blocks that you can pass around as variables. rob5: Well, not "just", but that's the 5-second explanation. |
| kith | are lambdas procs? |
| stouset | kith: Yes. |
| kith | k |
| rob5 | great what the hell is a proc now |
| stouset | kith: lambda { ... } makes a proc that checks its arguments kith: proc { ... } is a synonym for lambda, but should never be used because it's confused with... |
| cdcarter | Proc is the class objects lambda {}, proc{} and Proc.new {} make |
| stouset | kith: Proc.new { ... } which does _not_ check the length of its arguments. rob5: Proc is just a type that holds a block, ripe for execution. |
| cdcarter | stouset: also Proc.new {} has non-loacl return |
| stouset | cdcarter: Communist. |
| kith | ah replaced proc with lambda works just as good :) |
| cdcarter | stouset: ? |
| stouset | kith: proc is getting taken out. Proc.new isn't. |