djbkd has quit [Remote host closed the connection]
milardovich has joined #ruby
Rodya_ has joined #ruby
gizmore has joined #ruby
pi2 has quit [Ping timeout: 260 seconds]
d^sh has quit [Ping timeout: 248 seconds]
milardov_ has quit [Ping timeout: 240 seconds]
gizmore|2 has quit [Ping timeout: 260 seconds]
Bhootrk_ has joined #ruby
d^sh has joined #ruby
jinie has quit [Ping timeout: 240 seconds]
jameser has joined #ruby
masterasia has joined #ruby
<masterasia>
is anyone familiar with ruby functional programming?
<masterasia>
What if I can't find a way to map an input to an output without keeping state
Rodya_ has quit [Quit: Leaving...]
jinie has joined #ruby
jameser has quit [Client Quit]
<elomatreb>
masterasia: Do you have a concrete example?
maryo has joined #ruby
CBebop has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has joined #ruby
harai has quit [Ping timeout: 255 seconds]
milardovich has quit [Ping timeout: 248 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dimik has joined #ruby
BTRE has quit [Read error: Connection reset by peer]
harai has joined #ruby
maxvaillancourt1 has joined #ruby
apparition47 has joined #ruby
apparition47 has quit [Client Quit]
kreantos has joined #ruby
djbkd has joined #ruby
<baweaver>
masterasia: without examples we couldn't tell you, though it would be best to remember that Ruby is not a purely functional language.
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
bronson has joined #ruby
kreantos has quit [Ping timeout: 248 seconds]
milardovich has joined #ruby
runescape07rsps has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
milardovich has quit [Ping timeout: 248 seconds]
belmoussaoui has quit [Ping timeout: 255 seconds]
maxvaillancourt1 has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
dviola has quit [Quit: WeeChat 1.9]
eckhardt has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
apparition47 has joined #ruby
belmoussaoui has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
minimalism has quit [Quit: minimalism]
milardovich has joined #ruby
theRealGent has quit [Ping timeout: 255 seconds]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardov_ has joined #ruby
BTRE has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
CBebop has quit [Quit: See you later, Space Cowboy.]
CBebop has joined #ruby
CBebop has quit [Client Quit]
CBebop has joined #ruby
Joufflu has quit [Read error: Connection reset by peer]
harfangk has joined #ruby
Joufflu has joined #ruby
gix has quit [Ping timeout: 240 seconds]
eckhardt has joined #ruby
redondos has joined #ruby
gix has joined #ruby
gothicsouth has quit [Read error: Connection reset by peer]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gothicsouth has joined #ruby
harfangk has quit [Ping timeout: 240 seconds]
cadillac_ has quit [Ping timeout: 248 seconds]
hutch34 has joined #ruby
Toledo has quit [Quit: No Ping reply in 180 seconds.]
Toledo has joined #ruby
cadillac_ has joined #ruby
mim1k has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has quit [Ping timeout: 252 seconds]
ornerymoose has joined #ruby
segy has quit [Ping timeout: 252 seconds]
KeyJoo has quit [Ping timeout: 260 seconds]
nofxxxx has joined #ruby
segy has joined #ruby
<cconstantine>
I'm thinking about building a gem with native extensions for a c++ library I'm writing. My library uses a slightly non-trivial cmake build system and I'm wondering how easy it is to make use of that when building the native extension. All my googling is just giving me people failing to install gems with native extensions :(
nofxxx has quit [Ping timeout: 240 seconds]
imode has quit [Ping timeout: 246 seconds]
rockman37 has joined #ruby
rockman37 has left #ruby [#ruby]
hutch34 has quit [Ping timeout: 252 seconds]
QualityAddict has quit [Remote host closed the connection]
apparition47 has quit [Quit: Bye]
milardovich has joined #ruby
milardov_ has quit [Ping timeout: 252 seconds]
bronson has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
Ishido has joined #ruby
alex`` has joined #ruby
harfangk has joined #ruby
segy_ has joined #ruby
milardov_ has joined #ruby
segy has quit [Ping timeout: 240 seconds]
segy_ is now known as segy
milardovich has quit [Ping timeout: 252 seconds]
McQueen has joined #ruby
McQueen has quit []
gothicsouth has quit [Ping timeout: 248 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gothicsouth has joined #ruby
twillkens has quit [Ping timeout: 240 seconds]
segy has quit [Ping timeout: 240 seconds]
rippa has joined #ruby
enterprisey has quit [Read error: Connection reset by peer]
ornerymoose has quit [Quit: ornerymoose]
enterprisey has joined #ruby
milardovich has joined #ruby
bitsmart has joined #ruby
milardov_ has quit [Ping timeout: 240 seconds]
imode has joined #ruby
sbstudios has joined #ruby
BTRE has quit [Read error: Connection reset by peer]
enterprisey has quit [Remote host closed the connection]
Emmanuel_Chanel has quit [Ping timeout: 248 seconds]
mkali has joined #ruby
Ishido has quit [Ping timeout: 240 seconds]
uZiel has quit [Ping timeout: 268 seconds]
djbkd has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby
djbkd has quit [Client Quit]
Ishido has joined #ruby
harai has quit [Ping timeout: 240 seconds]
Dimik has quit [Ping timeout: 260 seconds]
bronson has joined #ruby
djbkd has joined #ruby
QualityAddict has joined #ruby
harai has joined #ruby
milardov_ has joined #ruby
Tungki has joined #ruby
Emmanuel_Chanel has joined #ruby
bronson has quit [Ping timeout: 248 seconds]
milardovich has quit [Ping timeout: 240 seconds]
jyaworski has quit [Ping timeout: 264 seconds]
mwlang has joined #ruby
ledestin has joined #ruby
samlisl_ has quit [Ping timeout: 248 seconds]
milardov_ has quit []
jyaworski has joined #ruby
ur5us has joined #ruby
mwlang has quit [Quit: mwlang]
amosbird has left #ruby ["WeeChat 1.9-dev"]
maryo has quit [Ping timeout: 240 seconds]
apparition47 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
harfangk has quit [Ping timeout: 240 seconds]
QualityAddict has quit [Remote host closed the connection]
lxsameer has joined #ruby
mson has quit [Quit: Connection closed for inactivity]
conta has joined #ruby
harai has quit [Ping timeout: 260 seconds]
Guest40 has joined #ruby
QualityAddict has joined #ruby
_main_ has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
_main_ has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
kent\n has quit [Ping timeout: 246 seconds]
_main_0 has joined #ruby
__main__ has quit [Ping timeout: 252 seconds]
cats has quit [Ping timeout: 255 seconds]
kent\n has joined #ruby
Miron has quit [Ping timeout: 252 seconds]
ramortegui has quit [Ping timeout: 252 seconds]
cats has joined #ruby
Miron has joined #ruby
Pisuke has joined #ruby
c__ has joined #ruby
c__ has quit [Max SendQ exceeded]
MyMind has quit [Ping timeout: 240 seconds]
c__ has joined #ruby
c__ has quit [Max SendQ exceeded]
c__ has joined #ruby
claudiuinberlin has joined #ruby
c__ has quit [Max SendQ exceeded]
c__ has joined #ruby
c__ has quit [Max SendQ exceeded]
A124 has quit [Read error: No route to host]
marr has joined #ruby
A124 has joined #ruby
ramortegui has joined #ruby
runescape07rsps has quit [Quit: Leaving]
imode has quit [Ping timeout: 252 seconds]
ur5us has quit [Remote host closed the connection]
cconstantine has quit [Ping timeout: 255 seconds]
apparition47 has joined #ruby
ramortegui has quit [Ping timeout: 240 seconds]
dionysus69 has joined #ruby
dionysus69 has quit [Quit: dionysus69]
bronson has joined #ruby
cufujuku has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
Guest40 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramortegui has joined #ruby
lel has quit [Ping timeout: 252 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
Guest40 has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
lel has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
oleo has quit [Remote host closed the connection]
psychicist__ has joined #ruby
oleo has joined #ruby
cats has quit [Ping timeout: 255 seconds]
ur5us has joined #ruby
cats has joined #ruby
Miron has quit [Ping timeout: 255 seconds]
marr has quit [Ping timeout: 248 seconds]
Miron has joined #ruby
lxnr has joined #ruby
lxnr has quit [Client Quit]
ramortegui has quit [Quit: Ex-Chat]
ramortegui has joined #ruby
harai has joined #ruby
mkali has quit [Quit: mkali]
conta has quit [Quit: conta]
Tungki has quit [Read error: Connection reset by peer]
conta has joined #ruby
ur5us has quit [Remote host closed the connection]
agent_white has quit [Quit: brb]
<Mon_Ouie>
You can use system to call cmake from your extconf.rb, I'd probably do that to compile a static library and link it to the bindings
ramortegui has quit [Ping timeout: 246 seconds]
gfvcastro has quit [Read error: Connection reset by peer]
romankapitonov has joined #ruby
roshanavand has joined #ruby
ShalokShalom_ has joined #ruby
guille-moe has joined #ruby
A124 has quit [Quit: '']
belmoussaoui has quit [Remote host closed the connection]
ShalokShalom has quit [Ping timeout: 252 seconds]
conta has quit [Quit: conta]
tomphp has joined #ruby
horst has joined #ruby
tomphp has quit [Read error: Connection reset by peer]
romankapitonov has quit [Read error: Connection reset by peer]
tomphp has joined #ruby
romankapitonov has joined #ruby
marr has joined #ruby
thnee has left #ruby ["WeeChat 1.8"]
phinxy has joined #ruby
tomphp has quit [Read error: Connection reset by peer]
tomphp_ has joined #ruby
phinxy has left #ruby [#ruby]
mtkd has quit [Ping timeout: 260 seconds]
romankapitonov has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
tomphp_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
romankapitonov has joined #ruby
Fysicus has joined #ruby
mikecmpbll has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
romankapitonov has joined #ruby
minimalism has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
tomphp has joined #ruby
romankapitonov has joined #ruby
bronson has joined #ruby
<linduxed>
here's a question i can't really figure out for myself
<linduxed>
i very much like to have the `initialize` method be populated with nothing but instance variable assignment
<linduxed>
that way i can instantiate objects knowing that there will be no side effects or behaviour triggered from the `.new` method
t-recx has joined #ruby
<linduxed>
at the same time, if one follows that as a strict rule, then one must expect instance methods can exhibit behaviour that could have been prevented if the `initialize` method did validation
<linduxed>
example: let's say that i have a Database class and that the initialize method has one argument: database_path
bronson has quit [Ping timeout: 260 seconds]
<linduxed>
let's also say that Database only has one instance method: write_text
<linduxed>
#write_text takes a string and writes it to the database. the details of how are not important
Ishido has quit [Ping timeout: 240 seconds]
<linduxed>
by deciding on having #initialize only do instance variable setting, suddently the #write_text method needs to care for such things as "is @database_path a valid path?"
<linduxed>
"@database_path.nil?"
<linduxed>
these are things that one could argue would be helped by having a validation step as a part of #initialize, but then i couldn't instantiate objects as easily
<linduxed>
i've been considering keeping #initialize in this rather pure form, but add a .build method to the Database class, essentially having a factory methdo
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<linduxed>
but I'm unsure whether this is more confusing than beneficial
Fysicus has quit [Quit: The Truth Is Just An Excuse For A Lack Of Imagination]
<matthewd>
linduxed: Personally, I don't see much point
maryo has joined #ruby
<matthewd>
I'd agree that instantiating an object shouldn't "do stuff", but I'd apply a more semantic filter to what that threshold looks like
WeiJunLi has joined #ruby
<linduxed>
hmmm, maybe ensuring correctness of what one tries to instantiate could be likened to the syntactic checks that are made (did you supply the right arguments? is this arg a string or a number?)
<linduxed>
but then one needs to consider the existence of plenty of classes with the #valid? method
jameser has joined #ruby
roshanavand has quit [Ping timeout: 255 seconds]
WeiJunLi has quit [Ping timeout: 240 seconds]
snickers has joined #ruby
firstdayonthejob has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ShalokShalom_ is now known as ShalokShalom
TomyLobo has joined #ruby
charliesome has joined #ruby
marr has quit [Ping timeout: 240 seconds]
yqt has joined #ruby
Fysicus has joined #ruby
<PacificSalmon>
`#valid?` is very ORM-y, or AR-y. so is the approach you're taking. if the arguments for `#initialize` are in an invalid state, then raising an ArgumentError is probably suitable.
<clemens3>
linduxed: in this case what if the file moves or gets deleted after the initialization, you might still have to deal with errors later as well
<PacificSalmon>
it sounds a bit like you might be thinking yourself into a box for no gain. and also over thinking, so everything is complicated.
<matthewd>
IMO there's a difference between "invalid-invalid" and "not conforming with business rules", and despite the name, a #valid? is more often the latter
<clemens3>
and this whole purity thing regarding side effects, if you have a database, you have side effects.
<linduxed>
PacificSalmon: raising ArgumentError might indeed be a good idea for some things!
<matthewd>
Passing an integer to MyURL.new is exceptional, whereas MyURL#valid? might check whether it returns a 200
<linduxed>
clemens3: true... while optimistic treatment of the database would simplify code, it wouldn't account for potential severe changes
Guest40 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<linduxed>
clemens3: i specifically wrote "pure form" to avoid the expression "pure state", which i thought would imply something about side effects. i was just referencing the code structure. on the other hand, using "pure" already has its implications, i guess
firstdayonthejob has quit [Quit: WeeChat 1.9]
Guest40 has joined #ruby
firstdayonthejob has joined #ruby
<linduxed>
matthewd: hmmm, will have to think how it applies to my code
<linduxed>
thanks for all of your input!
<PacificSalmon>
what are you writing exactly? there's some libraries out there that can handle 'attribute validation' in a AR-esque way if you're trying to plug that feature into something else.
<linduxed>
PacificSalmon: tiny script which has a simple YAML file as a "database". nothing long running, which means that above discussion is purely academical for the purposes of my application
<PacificSalmon>
alright. i see. well, have a look: https://github.com/solnic/virtus - if you want to enforce types and all that stuff, on regular ruby objects, may be useful
<PacificSalmon>
but sounds like something way more simple would work
firstdayonthejob has quit [Quit: WeeChat 1.9]
<linduxed>
i mostly asked for future reference, since i've been opting to have nothing but instance variable initialization in my #initialize methods for some time now, due to the comfort of always knowing that they can be instantiated without behaviour
sepp2k has joined #ruby
<linduxed>
oooh, a solnic library!
<linduxed>
reminds me of the fact that i should try out the DRY libraries
<linduxed>
dry-validataion could be cool for this kind of purpose
<PacificSalmon>
yeah. i never really checked out dry-* stuff, and i think examples in virtus readme are a lot better. dry-* readme is missing examples, and the docs are quite in-depth before getting to any code. but i would guess, it's just as good.
jtdowney has joined #ruby
dionysus69 has joined #ruby
firstdayonthejob has joined #ruby
vondruch has quit [Quit: vondruch]
firstdayonthejob has quit [Client Quit]
vondruch has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
__Yiota has joined #ruby
charliesome has quit [Read error: Connection reset by peer]
charliesome has joined #ruby
Guest40 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has joined #ruby
skweek has quit [Read error: Connection reset by peer]
t-recx has quit [Ping timeout: 260 seconds]
t-recx has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
romankapitonov has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dminuoso>
And A - B gives you the relative compliment of B in A.
high_fiver has joined #ruby
<xco>
looks to me as if all - [:queued, :created] => :queued, then, is a hash. true or false?
<dminuoso>
xco, yes.
<dminuoso>
xco, using the result of all - [:queued, :created] as its key, and :queued as its value
<xco>
peeeeerfect
<xco>
something so simple boggled my mind :D
<xco>
you’re awesome
<dminuoso>
If I had been awesome I wouldnt have made this so complicated.
charliesome has joined #ruby
guille-moe has joined #ruby
<xco>
also i didn’t nkow doing “hello” => “world” was a way of creating hashes...
<xco>
but now i know :)
<xco>
one beer for you
<dminuoso>
xco, its actually the "real" way. { a: 1 } is just a shorthand for { :a => 1 }
naftilos76 has quit [Quit: Αποχώρησε]
<dminuoso>
xco, for brevity you are allowed to omit the parens in method calls
<xco>
yeap. it’s evident now
<dminuoso>
or braces I guess?
charliesome has quit [Ping timeout: 252 seconds]
numbdewd has joined #ruby
skweek has quit [Ping timeout: 248 seconds]
<apeiros>
there seems to be no real standard, but personally I use parens = (), brackets = [], (curly) braces = {}
<dminuoso>
apeiros, what would you call <> ?
<apeiros>
angle brackets iirc
SteenJobs_ has joined #ruby
<dminuoso>
The C++ standard would agree with you at least.
<apeiros>
or lt & gt :)
<dminuoso>
Heh.
<dminuoso>
Or SQL ne
FrostCandy has quit []
<apeiros>
I only recently learned that most sql also supports !=
hutch34 has joined #ruby
charliesome has joined #ruby
enterprisey has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
mark_on_the_moon has quit [Ping timeout: 252 seconds]
<PacificSalmon>
does it support html entities. i'm only interested in databases that support: `select * from table where 'table.version' > 9000`. which is why i have yet to use a database.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<dminuoso>
PacificSalmon, looks trivial enough to implement in Postgres.
<dminuoso>
Maybe Ill keep that idea ready for next april fool's day.