What do you call this in Ruby?
21–30 of 69 posts
Re: What do you call this in Ruby?
#22Say what you will about us, but Ruby people get to have the most fun. hops on hipster hashrocket and tribbles off into the sunset
Re: What do you call this in Ruby?
#23Re: What do you call this in Ruby?
#24'!!' -> "truthy?"
! -> "not truthy". So !! means "not 'not truthy'" which is truthy. Truthy is something that isn't exactly a true boolean but will equate to true(thy) when evaluated with this type of comparison. Things like undefined, null, and empty string will not be truthy. More info on what's truthy (for JavaScript at least) is here http://james.padolsey.com/javascript/truthy-falsey/ edit: typically, if you want to test for truth…
```
my_option = !!ENV[MY_OPTION] # is false when not set
puts "my_option is: #{my_option}"
```Re: What do you call this in Ruby?
#25edit: Makes total sense. Thanks for the replies.
Re: What do you call this in Ruby?
#26Took me a while to figure out why it was called that way.
Re: What do you call this in Ruby?
#27Earlier quoted context omitted.
Perl hackers will disagree :)
There's something very special about a language that supports the goatse operator.
That whole list is gold. My favourite so far is "space station": -+-
Re: What do you call this in Ruby?
#28 Mathematica 10.0 for Mac OS X x86 (64-bit)
Copyright 1988-2014 Wolfram Research, Inc.
In[1]:= FullForm[x->y*z^w]
Out[1]//FullForm= Rule[x, Times[y, Power[z, w]]]
In[2]:= x\[UnionPlus]y\[RightTee]z
Out[2]= x ⊎ y ⊢ z
There's no reason your programming language shouldn't be able to tell you what these things are called in English without an external reference.Re: What do you call this in Ruby?
#29How did hashrocket get named? I would think instead of => a hashrocket would look like: #> edit: Makes total sense. Thanks for the replies.
{:cats => "foo"}
Re: What do you call this in Ruby?
#30How did hashrocket get named? I would think instead of => a hashrocket would look like: #> edit: Makes total sense. Thanks for the replies.