What do you call this in Ruby?
41–50 of 69 posts
Re: What do you call this in Ruby?
#42Meanwhile: 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?
#43Re: What do you call this in Ruby?
#44'!!' -> "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…
You could just use:
return myObject;
Since that value will be truthy or falsy, any code that tests it will generally work, as your if statement example demonstrates.But there are two advantages to doing this instead:
return !! myObject;
1) Now you are returning an actual boolean value, not just a truthy/falsy value.2) Sometimes more importantly, you are now releasing this function's reference to the object, instead of possibly keeping that reference around much longer than needed and preventing it from being garbage collected.
Re: What do you call this in Ruby?
#45[0] http://www.muppetlabs.com/~breadbox/intercal-man/tonsila.htm...
Re: What do you call this in Ruby?
#46Just added a PR for the spermy operator (~>).
For those wondering, here's the request: https://github.com/JuanitoFatas/what-do-you-call-this-in-rub... Here's the response: Hi Christian, thanks for the Pull Request! But I think this is not appropriate rubygems/rubygems#124. :bow:
Re: What do you call this in Ruby?
#47Earlier quoted context omitted.
Written words are symbols as well. What should we do when we don't understand words?
We Google them, which is an impossible task for non-alphabetic symbols. :P
Re: What do you call this in Ruby?
#48Such little imagination... You should learn from your forefathers. Quantity is no substitute for quality. ;) http://search.cpan.org/dist/perlsecret/lib/perlsecret.pod#SY...
=( )= goatse operator
cannot unsee.Re: What do you call this in Ruby?
#49stabby lambda is my favorite.
Re: What do you call this in Ruby?
#50my favorite is the "Elvis operator" in kotlin ?: Took me a while to figure out why it was called that way.