#ruby-lang - Wed 11 Apr 2007 between 00:00 and 00:12

stousetIf 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?
stousetMake 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 ~~~~
stousetObject orientation is your friend.
There are no bad words. Only bad thoughts.
Given, I'm generally guilty of that.
starnix17can 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?
Phenaxstouset: What is "Comparable" if you don't mind?
halorgiumPhenax: a module
cdcarterPhenax: its a module that gives you some awesome methods assuming you have <=> defined
stousetPhenax: ri Comparable
Phenax: Generally speaking, "ri #{anything_you_dont_know}
".sub %r{\n}, ''
rob5this lambda character is very hard to understand
halorgiumstouset: no need for a Regex there
"\n" will do it
stousethalorgium: Pfft, it gets converted to a regex anyway.
cdcarterrob5: lambdas are anonymous blocks that contain the environment in which they were created.
they are objects
kithagain i'm having this "cant pass arguments to def initialize when its a singleton" thingy... geez
stousetrob5: lambdas are just blocks that you can pass around as variables.
rob5: Well, not "just", but that's the 5-second explanation.
kithare lambdas procs?
stousetkith: Yes.
rob5great what the hell is a proc now
stousetkith: 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...
cdcarterProc is the class objects lambda {}, proc{} and Proc.new {} make
stousetkith: Proc.new { ... } which does _not_ check the length of its arguments.
rob5: Proc is just a type that holds a block, ripe for execution.
cdcarterstouset: also Proc.new {} has non-loacl return
stousetcdcarter: Communist.
kithah replaced proc with lambda works just as good :)
cdcarterstouset: ?
stousetkith: proc is getting taken out. Proc.new isn't.

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86