<ggreer>
it'd be overdesigned. too many features interacting in too many ways
<ggreer>
ah
<rking>
But I think C is the right tool for this job.
<ggreer>
yeah. process startup time is faster than perl
<ggreer>
and C is easier to optimize, since you can get at the low-level implementation details
<rking>
ggreer: Is the --type thing an intentional feature-removal or is it a TODO?
<rking>
I actually never really used it in ack, using recursive globs for similar tasks
<ggreer>
I never used --type, so I never wrote it
<ggreer>
underneath, --type mostly looks at file extensions. I think there are some one-off bits of code in ack for special things like makefiles and rakefiles
mpan has joined #ruby-lang
gregmoreno has quit [Ping timeout: 256 seconds]
postmodern has joined #ruby-lang
krohrbaugh has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
<zenspider>
vlad 2.3.1 released
havenn has quit [Read error: Connection reset by peer]
havenn has joined #ruby-lang
mjio has quit []
seanstickle has joined #ruby-lang
<zenspider>
headius: oi
sabfer has joined #ruby-lang
<drbrain>
what do you think of this change to rubygems:
<drbrain>
`gem search` defaults to remote, and anchors on the first character (like `gem list` today)
<drbrain>
`gem list` defaults to local (like today)
<drbrain>
I like it
<drbrain>
does anybody use `gem search`?
<zenspider>
works for me
<zenspider>
yeah. one japanese core guy
mistym has joined #ruby-lang
mistym has quit [Changing host]
<zenspider>
search through the tix
mistym has joined #ruby-lang
<zenspider>
he uses it all the time
<drbrain>
yeah, and he wants it to be remote like this :)
havenn has quit [Read error: Connection reset by peer]
havenn has joined #ruby-lang
havenn has quit [Remote host closed the connection]
sush24_ has joined #ruby-lang
jds has quit [Ping timeout: 248 seconds]
mrsolo has quit [Quit: Leaving]
<headius>
zenspider: looking
<zenspider>
thanks
<zenspider>
I suspect it will also be the case on rubinius
<zenspider>
transparent message sends
mpan has quit [Ping timeout: 248 seconds]
<zenspider>
tho... I'd guess taht mocha and others have the same problem... no?
wyhaines has quit [Remote host closed the connection]
<headius>
I'll have to look at how you're mocking
CoverSlide is now known as CoverSlide|Away
<headius>
hmm
<zenspider>
isn't there a fairly standard C pretty printer / reformatter ?
<zenspider>
I don't want to ungolf by hand
<headius>
zenspider: do you have any more information than is in the bug, like what we might be doing differently?
<zenspider>
indent... right.
gregmoreno has joined #ruby-lang
sabfer has quit [Quit: sabfer]
<headius>
the error message is very strange
<zenspider>
headius: no. I'm only guessing that internally you're doing a call to == or something and my stupid proxy is recording it as if it were a user level msgsend
<headius>
ahhh
seanstickle has quit [Quit: seanstickle]
seanstickle has joined #ruby-lang
sabfer has joined #ruby-lang
<zenspider>
hah. and worse.. it seems to be generated from mock.rb itself? haha
sush24_ has quit [Quit: This computer has gone to sleep]
<headius>
reproduced here, anyway
<zenspider>
kk
<zenspider>
is this a bug in my code being too deep or what?
BigO has joined #ruby-lang
<headius>
hmm
<headius>
this error comes directly from the mock's method_missing eh?
<zenspider>
BUGS: indent has even more switches than ls(1).
<zenspider>
hahaha
<zenspider>
headius: I believe so
<headius>
hmm
<headius>
triggered from the include? call in verify
havenn has joined #ruby-lang
<headius>
that's strange
sabfer has quit [Quit: sabfer]
tridge_ has quit [Remote host closed the connection]
BigO has quit [Remote host closed the connection]
<zenspider>
line 134 of mock.rb pushes on a hash w/ the retval as a value
<zenspider>
I don't see how/why that's getting hit via @actual_calls[name].include?
<headius>
that's what I'm seeing for @actual_calls[name] right before it fails
thatdutchguy has quit [Remote host closed the connection]
<headius>
I think you're right about us calling == somewhere, but for us to call it on the mock it would have to be in the array we're calling include? against
<headius>
something like that
<headius>
so yeah, the returning the mock seems to be the key
<headius>
the mock is returned from foo, which leads to it being stored as retval in that hash, which leads to us eventually calling methods against it to do include?
<headius>
that is probably an impl difference in our include? somewhere
<headius>
theory sounding good so far?
<zenspider>
yeah
<zenspider>
maybe MRI does extra checks before trying msgsend ==
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
WillMarshall has joined #ruby-lang
WillMarshall has quit [Client Quit]
WillMarshall has joined #ruby-lang
WillMarshall has quit [Client Quit]
<erikh>
stop expressing your opinions as gospel and it probably wouldn't be an issue
ryanf has quit [Ping timeout: 264 seconds]
Guest51695 has left #ruby-lang [#ruby-lang]
datanoise has quit [Ping timeout: 256 seconds]
<whitequark>
erikh: everything expressed is an opinion, by definition
<erikh>
I'm not stepping into this metaphysical pile of horseshit. You can phrase things like "I don't like that" or "that's a stupid, useless idea". one of them actually has merit, the other is bullshit that can be argued out of existence.
<whitequark>
they're equivalent, and unless you can justify the point, both useless
<charliesome>
variable variables are mostly a stupid useless idea
<charliesome>
i'd like to see a valid use for them in php
ryanf has joined #ruby-lang
<erikh>
whitequark: because you're frequently wrong, and almost always say the latter.
r0bglees0n has joined #ruby-lang
<whitequark>
erikh: it's not like I would agree with you easier if I phrase it as the former.
<erikh>
if you phrased it as the former it's actually your opinion, and doesn't attack the need for such a thing.
<erikh>
for what it's worth, perl (and probably php, but I don't know) do things with soft references that you'd use ruby's #send or #instance_variable_get for
gnufied has joined #ruby-lang
<whitequark>
"attack the need"? like the ramblings of a random guy on irc would actually affect something
<erikh>
right, like taking stock in a 20 year old kid who thinks he knows everything
gregmoreno has quit [Remote host closed the connection]
rekky has joined #ruby-lang
<whitequark>
I don't quite understand what do you mean by "taking stock" here
jxie has quit [Ping timeout: 246 seconds]
<erikh>
oh, nevermind. we can have this conversation when you grow up.
jxie has joined #ruby-lang
tenderlove has joined #ruby-lang
<whitequark>
(#send in php) yeah, I recall seeing that construct used for programmatically specifying the name of method being called. it's funny how almost none of the comments below list that feature.
wmoxam_ is now known as wmoxam
blazes816 has quit [Quit: blazes816]
<whitequark>
erikh: I wonder where you've learned my age. as in, I know it's somewhere on the internet, but I wonder where is it in particular.
<erikh>
you said it in here once
<erikh>
I have a knack for remembering details.
wmoxam has quit [Changing host]
wmoxam has joined #ruby-lang
<erikh>
besides, it's not exactly hard to figure out.
<whitequark>
ha. nice memory.
wyhaines has joined #ruby-lang
<erikh>
extreme devotion to a one true programming style, emphasizing cultural programming fads over solving the problem, inability to empathize with others that work differently
brianpWins has joined #ruby-lang
<erikh>
early 20's, probably fresh out of college. I'd put a month's salary on that prediction any day of the week.
JohnBat26 has joined #ruby-lang
<whitequark>
erikh: you're mostly correct, through the way I actually work somewhat differs from the way I discuss things on IRC when I'm bored.
<whitequark>
and a college dropout, but that doesn't matter much.
<zenspider>
gah
datanoise has joined #ruby-lang
<zenspider>
man... I need an on demand sysadmin... I hate this shit. it should just work
<zenspider>
and stay up
<zenspider>
and heal itself
<zenspider>
and and and... pony
<erikh>
did you see that minitest project thingy I messaged you?
<erikh>
I applied minitest to integration testing entire networks of machines
<erikh>
working pretty well. the code is still pretty much ass but it does work.
<zenspider>
skimmed it
<erikh>
we already have a few tests; I can already verify that many scenarios where chef might break some machine interop (zone transfers, syslog, redis replication for example) will be determined long before they even make it into git, much less our systems
<erikh>
anyhow, if it isn't obvious I'm really excited about it and where it's going
<zenspider>
heh
<erikh>
largely because it's working and I started on the idea at seattle.rb
<zenspider>
yeah... it is a bit obvious :P
<erikh>
so it's a long time coming
<erikh>
heheh
<zenspider>
nice
<zenspider>
ok. I'm out.
<erikh>
later.
datanoise has quit [Ping timeout: 255 seconds]
mistym has quit [Remote host closed the connection]
tridge has joined #ruby-lang
burgestrand has quit [Quit: Leaving.]
thinkdevcode has quit [Remote host closed the connection]
burgestrand has joined #ruby-lang
towski has joined #ruby-lang
burgestrand has quit [Ping timeout: 245 seconds]
gregmoreno has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
rekky has quit [Quit: rekky]
rekky has joined #ruby-lang
replore has joined #ruby-lang
towski has quit [Remote host closed the connection]
replore has quit [Remote host closed the connection]
ryanf has quit [Ping timeout: 245 seconds]
gregmoreno has quit [Ping timeout: 264 seconds]
bluepojo has quit [Quit: Leaving.]
mupilot has quit [Quit: mupilot]
datanoise has joined #ruby-lang
mpan has quit [Ping timeout: 248 seconds]
RickHull has left #ruby-lang [#ruby-lang]
mrsolo has joined #ruby-lang
Nisstyre has quit [Quit: Leaving]
burgestrand has joined #ruby-lang
rippa has joined #ruby-lang
mjio has quit []
datanoise has quit [Ping timeout: 252 seconds]
robbyoconnor has joined #ruby-lang
havenn has joined #ruby-lang
havenn has quit [Remote host closed the connection]
<epitron>
hmmm... this seems like an odd question, and it's a weird scenario because i want to keep all my code in one file *and* be performant...
<epitron>
but, does anyone know of a good way of defining a class from within a method?
<epitron>
(i'm defining a class in a method because i want to lazy load a gem only if it's needed)
<drbrain>
Class.new
<epitron>
lemme see
<drbrain>
epitron: you'll need const_set to give it a name
<drbrain>
ruby -e 'loop do Class.new end' # all the classes
<epitron>
hahah
<epitron>
i just realized it would be way easier if i wrapped my code in a string, and evaled it
<epitron>
but i've got interpolation in there... and heredoc is eagerly evaluating that
<epitron>
is there a way to make a heredoc-like thing that's not interpolated?
<charliesome>
that's where ruby took a bit too much of lisp!
<andrewvos>
charliesome: Ergh. What is the value of the first argument in the second call?
<charliesome>
andrewvos: nil
<andrewvos>
charliesome: Waa?
swav has joined #ruby-lang
<andrewvos>
Ohh
<charliesome>
andrewvos: () is nil
<andrewvos>
I get it
<charliesome>
most of ruby's grammar works mostly as you'd expect most of the time
<judofyr>
in my little language, you can do: `a = (1, 2, 3); foo.bar a` and it's exactly the same as `foo.bar(1, 2, 3)`
<charliesome>
judofyr: like perl?
<judofyr>
charliesome: well, not quite. every function just take a single value.
<charliesome>
oh
<judofyr>
(1, 2, 3) is a one value
<judofyr>
(a record)
<charliesome>
so if you write
<charliesome>
foo.bar(1,2,3), then that passes (1,2,3) as one argument?
<judofyr>
yes
<charliesome>
interesting
<charliesome>
can you write 'foo.bar 1 2' if foo.bar returns another function?
tridge has quit [Remote host closed the connection]
<judofyr>
maybe :)
<judofyr>
but I have pattern matching for functions to make it easier. e.g: def foo [bar, baz] { … }
<judofyr>
[bar, baz] matches a record of size 2
<judofyr>
[bar] matches anything else than void or record
<judofyr>
[] matches void
<charliesome>
smells like haskell and ruby got intimate
vlad_starkov has joined #ruby-lang
<chendo>
bow chika wow wow
<charliesome>
hi chendo
<chendo>
sup
vlad_starkov has quit [Read error: Connection reset by peer]
<judofyr>
charliesome: generally, I want `a = …; foo a` to always be equal to `foo …`
<charliesome>
judofyr: i feel like copying perl's argument semantics would be a nicer way to achieve that than restricting functions to taking one argument
<judofyr>
charliesome: well, it's pretty much the same, no?
<judofyr>
all perl functions take a single value (an array that's automatically de-referenced) ?
<judofyr>
or, all functions take a list
<judofyr>
in my lang, all functions take a record
<charliesome>
say you had
<judofyr>
the only difference is in the treatment of single values (e.g. there's no such thing as a single-element record)
<charliesome>
a = …; foo(1, a, 3)
dankest has quit [Quit: Leaving...]
<charliesome>
would that pass (1, …, 3) or (1, (…), 3)
<judofyr>
(1, …, 3)
<judofyr>
a = (1, 2, 3); would lead to (1, (1, 2, 3), 3)
<charliesome>
so records are flattened when put inside other records?
<judofyr>
no
<judofyr>
records must have parenthesize around them :)
<banisterfiend>
andrewvos: Yeah, it opens the singleton class for the object to the right of the >>
<andrewvos>
I don't like the "class << whatever" syntax then
<andrewvos>
I always look at is as "add self to class"
<judofyr>
stardiviner: a = "hello"; class << a; def t; size; end; end; a.t #=> 5
<banisterfiend>
right of the <<*
<stardiviner>
judofyr: I see
<judofyr>
andrewvos: use singleton_class.class_eval then
<judofyr>
:)
<andrewvos>
judofyr: :)
<banisterfiend>
andrewvos: that's a weird-ish mental model ;)
<judofyr>
stardiviner: it's most commonly used for class methods: class Foo; class << self; def bar; end; end; end.
<andrewvos>
banisterfiend: I've not ever been called normal.
<judofyr>
stardiviner: that bar is available as Foo.bar
<banisterfiend>
hehe
<banisterfiend>
andrewvos: i guess you're trying to give "<<" similar meaning to Array#<< ?
<andrewvos>
banisterfiend: Yeah
<banisterfiend>
fair enough
<andrewvos>
banisterfiend: My point exactly.
<andrewvos>
banisterfiend: It should be something like "singleton; def singleton_method; end; end;"
<stardiviner>
judofyr: why use that style ? class Foo; class << self; ... Does it has some difference with instance method or class method ?
<judofyr>
stardiviner: `def self.bar` is just a short-cut for `class << self; def bar; end; end`
<banisterfiend>
andrewvos: yeah the "class << o" syntax is kind of weird
<banisterfiend>
i wonder why he selected it
<stardiviner>
judofyr: thanks, I see. I think def self.bar is better.
<judofyr>
stardiviner: people use `class << self` for mostly two reasons: (1) it's a way to group several class methods without repeating "self."
<judofyr>
stardiviner: and (2) you can do stuff like attr_accessor: `class << self; attr_accessor :bar; end`
<judofyr>
stardiviner: Foo.bar = 1; p Foo.bar
<stardiviner>
banisterfiend: Actually I'm reading an article "Just Enough Ruby", it has add a instance method to an instance with this singleton class style.
<banisterfiend>
stardiviner: yu can just do it with: def obj.meth; end
<stardiviner>
judofyr: I see. good idea
<banisterfiend>
stardiviner: though sadly you see a lot of people doing this instead: class << obj; define_method(:meth) { }; end
<banisterfiend>
which is totally unnecessary
<stardiviner>
banisterfiend: really , this is a short-cut again ?
<banisterfiend>
stardiviner: Yeah
<stardiviner>
banisterfiend: cool. I like your style
<banisterfiend>
stardiviner: it's not my style, it's ruby's ;)
<stardiviner>
banisterfiend: you're right.
<stardiviner>
:)
<stardiviner>
And one more question, I'm going to confused on those lot of ruby concepts, like upper thing. So, is there a complete tutorial or reference about this ?
<andrewvos>
Upper thing?
<stardiviner>
And actually I'm going to read book Programming Ruby. Does it will explain this completely ? If yes, I have no other needs
<stardiviner>
andrewvos: yes, like that, and something like Kernel is mix in Object etc
carloslopes has joined #ruby-lang
<stardiviner>
I hope my first understanding is correct, instead of correct after found what I have in my brain is wrong. So the first reading is important.
<stardiviner>
s/correct/correct them/
robotmay has joined #ruby-lang
robotmay has quit [Remote host closed the connection]
robotmay has joined #ruby-lang
<burgestrand>
stardiviner: explain upper thing
<stardiviner>
burgestrand: upper thing: class << object ; end is a singleton class, the method inside it will be available on that object.
<rue>
Correct
<stardiviner>
so, Does anybody has good suggestion for my second question ?
<andrewvos>
Ruby Koans stardiviner.
carloslopes has quit [Remote host closed the connection]
<stardiviner>
judofyr: not at all, I like this style
heftig has quit [Quit: leaving]
dc5ala has quit [Quit: Ex-Chat]
<judofyr>
stardiviner: this channel is also a pretty good place to ask for help ;)
<stardiviner>
judofyr: Read by self is a good and basic skill for a person who want to be a hacker .... ;) And ask in IRC can not always get in time answer, also sometimes not correct, even the interactive is check and humanable for human.
<judofyr>
andrewvos: I'd prefer #each_with_state where the state object includes e.g. the index, the next object, the prev object, last? and first`
kitallis has joined #ruby-lang
<judofyr>
first?*
<andrewvos>
judofyr: Yeah
mupilot has joined #ruby-lang
<andrewvos>
judofyr: I have a class that can parse either a file or the contents of that file as a String. Is it sane to have a method #parse that takes both, and then tests for file existence at the beginning?
TommyBlue has quit [Quit: Coyote finally caught me]
<andrewvos>
def parse(file_or_text)
<judofyr>
andrewvos: I prefer def parse_file(file); parse(File.read(file)) end
<andrewvos>
judofyr: Wow that is literally my code exactly :/
carloslopes has quit [Remote host closed the connection]
leopard_me has quit [Quit: Computer has gone to sleep.]
sailias has joined #ruby-lang
<kalleth>
rking: i usemap <F8> :set invhlsearch hlsearch?<CR>
<rking>
Hrm, odd
<kalleth>
so it acts as a toggle
<rking>
But then the next time you search it's off
<kalleth>
yeah
<kalleth>
its modal
<kalleth>
;)
<judofyr>
I have nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
<rking>
Well, fwiw you can golf that down to :set hlsearch!<cr>
<apeiros_>
are there established and good patterns for libs which are implemented both, in pure ruby and as C extension?
<rking>
But I like the way it works where it's on most of the time and I only clear it when I'm feeling OCD.
<apeiros_>
I mean with regards to how the requires are done
<judofyr>
apieros: I think having foo_ext and lib/foo.rb with require "foo_ext" is common
<apeiros_>
judofyr: and how do you handle the duality part?
<apeiros_>
i.e., I have foo/bar, foo/baz etc. in pure ruby
<judofyr>
and the problem?
<rking>
apeiros_: Aren't they normally separate gems? E.g. ruby-mysql
<apeiros_>
do you just require them all before requiring foo_ext and wrap the foo_ext require in begin/rescue in case it doesn't work (unsupported platform)?
<apeiros_>
judofyr: overriding the methods is one problem, handling availability of the native extension the other
<apeiros_>
or, another
anannie has quit [Ping timeout: 248 seconds]
outoftime has joined #ruby-lang
shtirlic has joined #ruby-lang
Weems has joined #ruby-lang
Weems has joined #ruby-lang
Weems has quit [Changing host]
tjadc has quit [Ping timeout: 248 seconds]
shtirlic_ has quit [Read error: Operation timed out]
tjadc has joined #ruby-lang
chimkan has quit [Quit: chimkan]
smaddock has joined #ruby-lang
anannie has joined #ruby-lang
thinkdevcode has joined #ruby-lang
banisterfiend has joined #ruby-lang
chimkan_ has joined #ruby-lang
leopard_me has joined #ruby-lang
zmack has quit [Remote host closed the connection]
znake has quit [Read error: Connection reset by peer]
enebo has joined #ruby-lang
mistym has quit [Remote host closed the connection]
thinkdevcode has quit [Remote host closed the connection]
BlaXpirit has joined #ruby-lang
mars777 has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
r0bglees0n has joined #ruby-lang
tjadc has quit [Quit: No Ping reply in 180 seconds.]
tjadc has joined #ruby-lang
kith has quit [Ping timeout: 244 seconds]
<andrewvos>
What's a nice way to detect OS?
kith has joined #ruby-lang
kith has quit [Changing host]
kith has joined #ruby-lang
Croms has joined #ruby-lang
retro|cz has quit [Ping timeout: 244 seconds]
tjadc_ has joined #ruby-lang
<andrewvos>
Like, #windows?, #osx?
<yorickpeterse>
You'd have to check RUBY_PLATFORM to see if it matches something
<andrewvos>
yorickpeterse: I jst want a gem
tjadc has quit [Ping timeout: 256 seconds]
davidbalber|away is now known as davidbalbert
jgomez has quit [Ping timeout: 256 seconds]
gsav has joined #ruby-lang
<yorickpeterse>
Don't know of any sadly
sush24_ has quit [Quit: This computer has gone to sleep]
gsav_ has joined #ruby-lang
gsav has quit [Client Quit]
gsav_ has quit [Client Quit]
gsav has joined #ruby-lang
gsav_ has joined #ruby-lang
<andrewvos>
:( :(
<workmad3>
andrewvos: ohai gives that sort of info
anannie has quit [Remote host closed the connection]
gsav_ has quit [Client Quit]
anannie has joined #ruby-lang
<andrewvos>
workmad3: Kind of just want a tiny little gem that does it.
<mistym>
I've heard good things about that one. Haven't read it myself though.
alejandrito has joined #ruby-lang
alejandrito has left #ruby-lang [#ruby-lang]
<mistym>
I also liked Programming Ruby.
<anannie>
I've heard of that, but it requires a lot more programming experience than I have, because some of it seems magical. One of the most amazing things is the sudoku example they give in the first chapter or so... I can't even imagine implementing something like that
<judofyr>
"and why I’m happy with you pirating my book if you so choose"
xyzodiac has quit [Quit: Computer has gone to sleep.]
<anannie>
judofyr: I meant ex*t*ensive not expensive
<judofyr>
haha
<anannie>
I can afford books :)
<judofyr>
:)
<andrewvos>
I can afford GOLD PLATED books
<anannie>
I ain't *that* broke
* imperator
discovers that he reintroduced a bug in sys-uname on windows, dammit
<anannie>
What I'm more concerned about is finding a book that matches my level and takes me on to the next one in terms of programming and understanding of the language.
<andrewvos>
havenn: Yeah I know that, and I know the soundtrack :)
<judofyr>
havenn: heh, I was just about to mention that anannie stole andrewvos' "an"-prefix tab-completion :)
mupilot has quit [Read error: Connection reset by peer]
<havenn>
andrewvos: I like track 2.
mupilot has joined #ruby-lang
<andrewvos>
anannie: GIVE IT BACK
<judofyr>
havenn: is that "This Book is made from …"?
<havenn>
judofyr: Yup.
<judofyr>
been a while since I've listened to it
<anannie>
andrewvos: Never!
<judofyr>
what was it again? lemonades?
<andrewvos>
havenn: I like Arm In The Foam
<judofyr>
smoke?
<havenn>
^
<judofyr>
rabbits!
<judofyr>
of course
<anannie>
So the two suggestions is The well grounded rubyist and Why's poignant guide to ruby. What do both teach me in terms of programming and the depth of understanding of ruby?
<judofyr>
and "smoke and mayonnaise"
<anannie>
* two suggestions are
<havenn>
anannie: Well Grounded Rubyist is more modern and less whimsical.
<judofyr>
anannie: _why's guide is more of a wild ride. I never finished it to be honest.
<zzak>
anannie: just read it, google's your friend
<anannie>
andrewvos: Give me a gold plated book and I shall add a z the an to become anzannie
<zzak>
The Well-Grounded Rubyist takes you from interested novice to proficient practitioner.
banisterfiend has quit [Remote host closed the connection]
<zzak>
the pickaxe book is also good, though a little more verbose
<havenn>
anannie: Not a book but Ruby Koans is worth going through if you haven't already: http://rubykoans.com/
<andrewvos>
havenn: Yes, books are for nerds. Ruby Koans are good.
<anannie>
zzak: I usually try to learn from people first before I can turn to other resources
<zzak>
now go, spend all your monies and free time
<zzak>
there are reviews of each of those books out there
banisterfiend has joined #ruby-lang
<anannie>
So to sum up The Well Grounded Rubyist + Ruby Koans + _why's guide + RubyTapas. I shall do my research and figure out which is a better fit and I'll follow through on that
nazty has quit [Read error: Connection reset by peer]
<banisterfiend>
anannie: i thoguht "the ruby programming language" was great
nazty has joined #ruby-lang
<judofyr>
anannie: the most important thing is to always program. find interesting problems and try to solve them in Ruby.
<havenn>
banisterfiend: I soo agree. I <3 that book. Gets hard near the end, I'm still trying to plow through. :)
<anannie>
zzak: I can't immediately gauge the earnestness of a reviewer through reading a few paragraphs. Over here I have an understanding that the regulars are competent and generally people I want to take advice from, that's why I asked before doing an extensive Google search
<zzak>
right, no book is going to teach you all of the semantics
davidbalber|away is now known as davidbalbert
<zzak>
anannie: fair enough
<anannie>
banisterfiend: I'm afraid it's above my level a bit. I gave the example of the bruteforce soduku solver he writes at the starting and that was mindblowing to read. I can't build something like that on my own. I'm not sure if I'm ever going to be able to create something like that on my own, so it's a bit above me I'm afraid
<banisterfiend>
anannie: skip that, i did
<banisterfiend>
it's just showing you the kind of things u can do, you're def. not meant to understnad it at that point
<judofyr>
anannie: it's also a great book to have as a reference
<banisterfiend>
just glance over it and pick u a few things
dankest has quit [Quit: Leaving...]
<anannie>
judofyr: The problem with me is that the problems I want to solve are always seemingly out of reach of my understanding and abilities. My actual understanding and abilities are so limited that almost everything I could try has been done before. It's hard to find an unsolved problem *I* could tackle that hasn't been done before
<banisterfiend>
pick up*
<havenn>
anannie: Have you gotten through tryruby.org?
<anannie>
That makes sense. I'll make sure that I buy a copy
<judofyr>
don't worry if it's been done before
<anannie>
havenn: I did learn code the hard way
imajes has quit [Excess Flood]
<banisterfiend>
anannie: writing a game is fast and fun way to learn a language IMO
<havenn>
anannie: Then you should be able to breeze through tryruby.org, that is another fun half-hour thing to do.
<banisterfiend>
libgosu.org
<anannie>
havenn: Okay it's on my to-do list
* anannie
goes to libgosu.org
<judofyr>
banisterfiend: releasy looks interesting. haven't seen it before. how does it bundle into .exe?
xyzodiac has joined #ruby-lang
shtirli__ has quit [Remote host closed the connection]
imajes has joined #ruby-lang
shtirlic_ has joined #ruby-lang
<banisterfiend>
judofyr: it just uses ocra
<anannie>
Not a game but I could use Gosu to make a 2D control environment for a machine on the ground, and then pipe through a camera feed and put it up or something
banisterfiend has quit [Remote host closed the connection]
<judofyr>
anannie: sounds like a fun project
<darix>
anannie: also keep in mind the rule: write it once, throw it away. write it again with the knowledge you gained when you did the prototype :)
<anannie>
judofyr: Yes it would be an awesome project
kurko_ has quit [Ping timeout: 246 seconds]
<judofyr>
anannie: I also had projects like that, but I was always distracted by the small stuff
<anannie>
darix: That's an awesome way to approach things!
<judofyr>
like, "oh, I need a way to communicate with the camera" and then I'm stuck making that thing perfect :P
<anannie>
judofyr: Don't worry it's not likely that I'll be able to achieve this any time soon
alvaro_o has joined #ruby-lang
<darix>
*takes note* judofyr has the perfect lib to talk to a camera;)
kurko_ has joined #ruby-lang
heftig has quit [Quit: leaving]
shtirlic_ has quit [Ping timeout: 255 seconds]
brianpWins has quit [Quit: brianpWins]
datanoise has joined #ruby-lang
vlad_starkov has joined #ruby-lang
dc5ala has joined #ruby-lang
judofyr has quit [Remote host closed the connection]
<andrewvos>
Want vim plugin that loads output from `ps ax`, and then stores all pids, and then when you delete lines it goes off and `kill -9`s them.
ulisescab has joined #ruby-lang
dankest has joined #ruby-lang
dous has joined #ruby-lang
lupine has joined #ruby-lang
Uranio has quit [Remote host closed the connection]
krohrbaugh has joined #ruby-lang
<imperator>
andrewvos, how much does this gig pay?
thisirs has quit [Remote host closed the connection]
<andrewvos>
imperator: You will get to make me happy, which is enough for any man.
<andrewvos>
Wait hang on
afgeneralist has joined #ruby-lang
madish has joined #ruby-lang
CoverSlide|Away is now known as CoverSlide
thatdutchguy has quit [Remote host closed the connection]
thatdutchguy has quit [Remote host closed the connection]
AlHafoudh has joined #ruby-lang
AlHafoudh has quit [Max SendQ exceeded]
towski has joined #ruby-lang
AlHafoudh has joined #ruby-lang
AlHafoudh has quit [Max SendQ exceeded]
eyda|mon has left #ruby-lang ["WeeChat 0.3.9"]
AlHafoudh has joined #ruby-lang
banisterfiend has joined #ruby-lang
thatdutchguy has joined #ruby-lang
sent-hil has quit [Remote host closed the connection]
rolfb has joined #ruby-lang
justinram has joined #ruby-lang
<tpope>
darix: well against all odds I actually saw this, but he still didn't stick around long enough
mrsolo has joined #ruby-lang
<tpope>
Smol is dead on. Add bundler.vim to the mix and you're in business
robbyoconnor has quit [Ping timeout: 250 seconds]
thatdutchguy has quit [Remote host closed the connection]
naquad has joined #ruby-lang
<yorickpeterse>
Is there a method in the Array class that behaves like [x..y] but also deletes the elements? So basically delete/delete_at but with a range
<yorickpeterse>
basically the values are determined using `expander_values = values.slice(current_index - vars_before_expander, val_length - (vars_length - 1))`
<yorickpeterse>
if that makes any sense
<whitequark>
ah, that's for masgn nodes
_br_ has joined #ruby-lang
<whitequark>
it's a bit simpler as you don't need to handle optional arguments
<yorickpeterse>
the stuff like `*foo, foo = 10, 20`
<whitequark>
yup
<yorickpeterse>
Not sure what those are called, I call them expander assignments
carloslopes has quit [Remote host closed the connection]
<whitequark>
it's called "multiple assignment" I believe
<whitequark>
note that there are some corner cases with 'foo, bar = *a'
<yorickpeterse>
hm, haven't tested that yet
<yorickpeterse>
though I think I can't really solve that on a parser level
<yorickpeterse>
since the parser doesn't know what "a" contains
imajes has quit [Excess Flood]
_br_ has quit [Excess Flood]
_br_ has joined #ruby-lang
<whitequark>
yorickpeterse: "f, b = 1", "f, b = *1", "f, b = *[1]" and "f, b = [1]" all behave the same
imajes has joined #ruby-lang
<yorickpeterse>
Hm
xyzodiac has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
_br_ has quit [Excess Flood]
_br_ has joined #ruby-lang
<naquad>
i have 2 objects, both include Enumerable, both implement indexer ([]) and i need to set values of first to second. what's the best way to do this? atm I have: FIELDS.each {|f| dst[f] = src[f]} ## where FIELDS is constant containing array of field names
_br_ has quit [Excess Flood]
wyhaines has quit [Ping timeout: 246 seconds]
_br_ has joined #ruby-lang
xyzodiac has quit [Quit: Computer has gone to sleep.]
<whitequark>
zzak: I wonder why don't import existing ffi implementation
Hakon has quit [Ping timeout: 264 seconds]
<zzak>
i'm not sure i understand that statement
<zzak>
whitequark: can you rephrase?
BigO has quit [Remote host closed the connection]
_br_ has joined #ruby-lang
<whitequark>
zzak: sorry I wasn't clear in that. what I meant is that there is already an FFI interface which is more or less well-supported in jruby and rubinius
<whitequark>
and on MRI too, with the ruby-ffi gem
<whitequark>
it seems logical to implement a compatible interface in MRI core, as it's done in other implementations
<whitequark>
lianj: that's easy, ruby-ffi is under LGPL
<whitequark>
so it cannot be simply imported
_br_ has quit [Excess Flood]
<lianj>
duh
<whitequark>
but I don't see value in creating yet another incompatible interface either
sent-hil has joined #ruby-lang
<lianj>
me loves ffi. change license and include it :D
datanoise has joined #ruby-lang
erpuds has quit [Quit: erpuds]
<zzak>
whitequark: i think fiddle is good and it's there for a reason
<zzak>
if you want to file a ticket for any incompatibilities or bugs, be my guest :)
<whitequark>
zzak: as I understand it, fiddle is an iterative improvement for DL
<lianj>
bug: this lib
<zzak>
yah
rolfb has joined #ruby-lang
rolfb has quit [Client Quit]
<whitequark>
zzak: so yeah, I'd phrase the bug as "deprecating DL not in favor of ruby-ffi", but I understand that licensing in this case prohibits the inclusion. which is a pity.
<zzak>
what is wrong with fiddle?
<zzak>
other than, it's not library X
_br_ has joined #ruby-lang
_br_ has quit [Excess Flood]
<lianj>
if ffi license would be changed, is there a change to include it in mri stdlib?
<drbrain>
lianj: there's always a chance
<whitequark>
zzak: the API provides significantly less features than ffi gem
<lianj>
drbrain: ;)
<whitequark>
zzak: it's not fiddle being bad as of itself, it's about increasing fragmentation
_br_ has joined #ruby-lang
erpuds has joined #ruby-lang
<lianj>
zzak: any lib using fiddle?
<lianj>
drbrain: *high chance?
<whitequark>
lianj: stdlib does for things like win32ole
<drbrain>
lianj: if it's more featureful than ffi and tenderlove agrees, yes
<lianj>
you mean more featureful than fiddle thereß
<lianj>
sadly iirc tenderlove dislikes ffi already, so i should get my hopes down
<zzak>
because of licensing, i think there is better chance to implement requested features in fiddle than to replace it
_br_ has quit [Excess Flood]
erpuds has quit [Client Quit]
<lianj>
zzak: but from a usage view, fiddle is/wants to replace ffi. not the other way around
<whitequark>
zzak: there isn't any value in adding features to fiddle when you already can use ffi and have all three platforms supported
enebo has quit [Quit: enebo]
davidbalber|away is now known as davidbalbert
<zzak>
i thought fiddle also supported all three platforms?
<zzak>
they're both based on libffi
<whitequark>
zzak: just checked, it's an open issue in jruby and it doesn't grep in rbx
<whitequark>
ruby-ffi interface is the only option now, if you want to be cross-platform
<zzak>
oh, i thought by platform you mean windows, osx, etc
<zzak>
cross-implementation you mean
<whitequark>
yes
sent-hil has quit [Remote host closed the connection]
_br_ has joined #ruby-lang
<whitequark>
or cross-engine (given that we have RUBY_ENGINE...)
<zzak>
lianj: what is the difference?
<lianj>
zzak: people use ffi
srbaker has joined #ruby-lang
<lianj>
i cant find a single project that uses fiddle
_br_ has quit [Excess Flood]
_br_ has joined #ruby-lang
_br_ has quit [Excess Flood]
<lianj>
drbrain: oh, tenderlove added fiddle like 3 years ago
_br_ has joined #ruby-lang
<lianj>
stdlib is a ghetto :(
<drbrain>
lianj: lies
<whitequark>
it should get better with gemification of stdlib
BlaXpirit has quit [Quit: Quit Konversation]
<zzak>
X is bettar than Y
<lianj>
zzak: again, dl/fiddle is rarly used in libs while ffi a lot
<lianj>
also the rbx/jruby argument is there
<zzak>
looks like jruby is using DL
<headius>
our fiddle is implemented atop FFI
<headius>
ditto for DL
<zzak>
for win32ole
<zzak>
?
shtirlic has quit [Remote host closed the connection]
<zzak>
ahh, i was looking at 1.6
<lianj>
headius: atop of libffi, not the ruby-ffi gem api. which even jruby/rbx build into their core
<lianj>
headius: is there a project using fiddle?
<headius>
lianj: hmm?
<headius>
our dl and fiddle are implemented using the ruby-ffi API
<headius>
we just happen to ship it
<headius>
I don't know of any projects using fiddle
srbaker has quit [Quit: Computer has gone to sleep.]
<lianj>
then im just stupid and confused again. link?
brianpWins has quit [Remote host closed the connection]
gregmoreno has quit [Remote host closed the connection]
<lianj>
ok, so its not. is it really the same code? i recall having some trouble with jruby ffi not implementing some methods ruby-ffi had, or it was just out of sync
Xzyx987X_ has joined #ruby-lang
<lianj>
s/is it/didnt know it is/
gregmoreno has joined #ruby-lang
mupilot has quit [Ping timeout: 265 seconds]
mupilot_ is now known as mupilot
thatdutchguy has quit [Remote host closed the connection]
jnoon has quit [Ping timeout: 255 seconds]
Xzyx987X has quit [Ping timeout: 276 seconds]
TheMoonMaster_ is now known as TheMoonMaster
<lianj>
haha, let me get this right, if your lib uses dl, you would use ffi within fiddle within dl. yo dawg
<postmodern>
why does stdlib have both dl and fiddle?
<tenderlove>
postmodern: backwards compatibility. dl will be removed
<postmodern>
tenderlove, when?
<postmodern>
tenderlove, ruby 3.0?
<tenderlove>
probably 2.1?
<tenderlove>
ya
<tenderlove>
I'm not sure
<cout>
I don't like any of the ffi options I've seen because none of them read the header files to find out what C typedefs you get (e.g. if a particular type is 64-bit on one platform and 32-bit on another)
workmad3 has joined #ruby-lang
<cout>
once upon a time I thought about writing a C parser just for that
havenn has joined #ruby-lang
<postmodern>
i like ffi, i've written a dozen ffi bindings, works fine
<tenderlove>
cout: DL has a simple C parser, but ya, dealing with that stuff sucks
<postmodern>
auto-parsing the headers is nice, but parsing and evaluating macros is not trivial
<cout>
tenderlove: it's easy with ruby's C API
<lianj>
cout: in luajit's ffi you have to run the header files with a preprocessor or they fail. so ffi.include('/usr/include/foo.h') wont work in most cases either
<cout>
tenderlove: my code just doesn't work with jruby easily :(
<cout>
lianj: that's odd; why doesn't the library just preprocess the input?
jsaak has quit [Ping timeout: 246 seconds]
<postmodern>
downside of parsing the header files, is your library than requires the C library and the headers
<lianj>
tenderlove: your plan would be to write on fiddle to drop require 'dl' in your gist and then impelemnt the ruby-ffi api ontop of fiddle?
<tenderlove>
ya
<postmodern>
why not just use ffi?
<tenderlove>
lianj: in trunk ruby you don't need the `dl` require